Ensure auto-complete works for objects in schemas other than public and pg_catalog. Fixes #3630

This commit is contained in:
Akshay Joshi
2018-09-11 12:56:14 +01:00
committed by Dave Page
parent 9c5e42c7a6
commit 4010dc80a9
4 changed files with 66 additions and 2 deletions

View File

@@ -116,16 +116,22 @@ class SQLAutoComplete(object):
self.search_path = []
schema_names = []
# Fetch the search path
if self.conn.connected():
# Fetch the search path
query = render_template(
"/".join([self.sql_path, 'schema.sql']), search_path=True)
status, res = self.conn.execute_dict(query)
if status:
for record in res['rows']:
schema_names.append(record['schema'])
self.search_path.append(record['schema'])
# Fetch the schema names
query = render_template("/".join([self.sql_path, 'schema.sql']))
status, res = self.conn.execute_dict(query)
if status:
for record in res['rows']:
schema_names.append(record['schema'])
pref = Preferences.module('sqleditor')
keywords_in_uppercase = \
pref.preference('keywords_in_uppercase').get()