Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita01f6fa

Browse files
committed
psql: Tab completion for JOIN ... ON/USING
Offer ON/USING clauses for join types that require join conditions (i.e.anything except for NATURAL/CROSS joins).Author: Andreas KarlssonReviewed-By: Tomas VondraDiscussion:https://postgr.es/m/3a7e27bc-d6ed-4cb0-9b21-f21143fc1b37@proxel.se
1 parent5dd5786 commita01f6fa

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎src/bin/psql/tab-complete.in.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5167,6 +5167,18 @@ match_previous_words(int pattern_id,
51675167
/* ... JOIN ... */
51685168
elseif (TailMatches("JOIN"))
51695169
COMPLETE_WITH_SCHEMA_QUERY_PLUS(Query_for_list_of_selectables,"LATERAL");
5170+
elseif (TailMatches("JOIN",MatchAny)&& !TailMatches("CROSS|NATURAL","JOIN",MatchAny))
5171+
COMPLETE_WITH("ON","USING (");
5172+
elseif (TailMatches("JOIN",MatchAny,MatchAny)&&
5173+
!TailMatches("CROSS|NATURAL","JOIN",MatchAny,MatchAny)&& !TailMatches("ON|USING"))
5174+
COMPLETE_WITH("ON","USING (");
5175+
elseif (TailMatches("JOIN","LATERAL",MatchAny,MatchAny)&&
5176+
!TailMatches("CROSS|NATURAL","JOIN","LATERAL",MatchAny,MatchAny)&& !TailMatches("ON|USING"))
5177+
COMPLETE_WITH("ON","USING (");
5178+
elseif (TailMatches("JOIN",MatchAny,"USING")||
5179+
TailMatches("JOIN",MatchAny,MatchAny,"USING")||
5180+
TailMatches("JOIN","LATERAL",MatchAny,MatchAny,"USING"))
5181+
COMPLETE_WITH("(");
51705182

51715183
/* ... AT [ LOCAL | TIME ZONE ] ... */
51725184
elseif (TailMatches("AT"))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp