mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-01-24 18:55:04 +08:00
Improve tab-completion for FETCH/MOVE.
Author: Naoki Nakamichi Reviewed-by: Fujii Masao Discussion: https://postgr.es/m/d05a46b599634ca0d94144387507f4b4@oss.nttdata.com
This commit is contained in:
parent
110d81728a
commit
8176afd8b7
@ -3077,19 +3077,27 @@ psql_completion(const char *text, int start, int end)
|
||||
COMPLETE_WITH("SELECT", "INSERT", "DELETE", "UPDATE", "DECLARE");
|
||||
|
||||
/* FETCH && MOVE */
|
||||
/* Complete FETCH with one of FORWARD, BACKWARD, RELATIVE */
|
||||
else if (Matches("FETCH|MOVE"))
|
||||
COMPLETE_WITH("ABSOLUTE", "BACKWARD", "FORWARD", "RELATIVE");
|
||||
/* Complete FETCH <sth> with one of ALL, NEXT, PRIOR */
|
||||
else if (Matches("FETCH|MOVE", MatchAny))
|
||||
COMPLETE_WITH("ALL", "NEXT", "PRIOR");
|
||||
|
||||
/*
|
||||
* Complete FETCH <sth1> <sth2> with "FROM" or "IN". These are equivalent,
|
||||
* Complete FETCH with one of ABSOLUTE, BACKWARD, FORWARD, RELATIVE, ALL,
|
||||
* NEXT, PRIOR, FIRST, LAST
|
||||
*/
|
||||
else if (Matches("FETCH|MOVE"))
|
||||
COMPLETE_WITH("ABSOLUTE", "BACKWARD", "FORWARD", "RELATIVE",
|
||||
"ALL", "NEXT", "PRIOR", "FIRST", "LAST");
|
||||
|
||||
/* Complete FETCH BACKWARD or FORWARD with one of ALL, FROM, IN */
|
||||
else if (Matches("FETCH|MOVE", "BACKWARD|FORWARD"))
|
||||
COMPLETE_WITH("ALL", "FROM", "IN");
|
||||
|
||||
/*
|
||||
* Complete FETCH <direction> with "FROM" or "IN". These are equivalent,
|
||||
* but we may as well tab-complete both: perhaps some users prefer one
|
||||
* variant or the other.
|
||||
*/
|
||||
else if (Matches("FETCH|MOVE", MatchAny, MatchAny))
|
||||
else if (Matches("FETCH|MOVE", "ABSOLUTE|BACKWARD|FORWARD|RELATIVE",
|
||||
MatchAnyExcept("FROM|IN")) ||
|
||||
Matches("FETCH|MOVE", "ALL|NEXT|PRIOR|FIRST|LAST"))
|
||||
COMPLETE_WITH("FROM", "IN");
|
||||
|
||||
/* FOREIGN DATA WRAPPER */
|
||||
|
Loading…
Reference in New Issue
Block a user