mirror of https://github.com/dbcli/pgcli
Include functions from search_path in completion.
This commit is contained in:
parent
0ada5a6c6a
commit
1d2570f462
|
@ -7,6 +7,7 @@ Features:
|
|||
* Consider `update` queries destructive and issue a warning. Change
|
||||
`destructive_warning` setting to `all|moderate|off`, vs `true|false`. (#1239)
|
||||
* Skip initial comment in .pg_session even if it doesn't start with '#'
|
||||
* Include functions from schemas in search_path. (`Amjith Ramanujam`_)
|
||||
|
||||
Bug fixes:
|
||||
----------
|
||||
|
|
|
@ -327,8 +327,6 @@
|
|||
"FIRST_VALUE",
|
||||
"FLOOR",
|
||||
"FORMAT",
|
||||
"GENERATE_SERIES",
|
||||
"GENERATE_SUBSCRIPTS",
|
||||
"GET_BIT",
|
||||
"GET_BYTE",
|
||||
"HEIGHT",
|
||||
|
|
|
@ -491,11 +491,14 @@ class PGCompleter(Completer):
|
|||
|
||||
def get_column_matches(self, suggestion, word_before_cursor):
|
||||
tables = suggestion.table_refs
|
||||
do_qualify = suggestion.qualifiable and {
|
||||
"always": True,
|
||||
"never": False,
|
||||
"if_more_than_one_table": len(tables) > 1,
|
||||
}[self.qualify_columns]
|
||||
do_qualify = (
|
||||
suggestion.qualifiable
|
||||
and {
|
||||
"always": True,
|
||||
"never": False,
|
||||
"if_more_than_one_table": len(tables) > 1,
|
||||
}[self.qualify_columns]
|
||||
)
|
||||
qualify = lambda col, tbl: (
|
||||
(tbl + "." + self.case(col)) if do_qualify else self.case(col)
|
||||
)
|
||||
|
@ -703,7 +706,11 @@ class PGCompleter(Completer):
|
|||
not f.is_aggregate
|
||||
and not f.is_window
|
||||
and not f.is_extension
|
||||
and (f.is_public or f.schema_name == suggestion.schema)
|
||||
and (
|
||||
f.is_public
|
||||
or f.schema_name in self.search_path
|
||||
or f.schema_name == suggestion.schema
|
||||
)
|
||||
)
|
||||
|
||||
else:
|
||||
|
|
Loading…
Reference in New Issue