diff options
-rw-r--r-- | AUTHORS | 2 | ||||
-rw-r--r-- | changelog.rst | 5 | ||||
-rw-r--r-- | pgcli/main.py | 4 | ||||
-rw-r--r-- | pgcli/pgcompleter.py | 3 |
4 files changed, 8 insertions, 6 deletions
@@ -85,7 +85,7 @@ Contributors: * Artur Balabanov * Kenny Do * Max Rothman - * DanEEStar + * Daniel Egger Creator: -------- diff --git a/changelog.rst b/changelog.rst index 50fc631d..bc2a6797 100644 --- a/changelog.rst +++ b/changelog.rst @@ -4,7 +4,8 @@ Upcoming: Bug fixes: ---------- -Set default port in `connect_uri` when none is given. (Thanks: `DanEEStar`_) +* Fix for loading/saving named queries from provided config file (#938). (Thanks: `Daniel Egger`_) +* Set default port in `connect_uri` when none is given. (Thanks: `Daniel Egger`_) * Fix for error listing databases (#951). (Thanks: `Irina Truong`_) Internal: @@ -899,5 +900,5 @@ Improvements: .. _`Artur Balabanov`: https://github.com/arturbalabanov .. _`Kenny Do`: https://github.com/kennydo .. _`Max Rothman`: https://github.com/maxrothman -.. _`DanEEStar`: https://github.com/DanEEStar +.. _`Daniel Egger`: https://github.com/DanEEStar .. _`Ignacio Campabadal`: https://github.com/igncampa diff --git a/pgcli/main.py b/pgcli/main.py index 696de5fa..86a86b1e 100644 --- a/pgcli/main.py +++ b/pgcli/main.py @@ -3,6 +3,8 @@ from __future__ import unicode_literals import warnings +from pgspecial.namedqueries import NamedQueries + warnings.filterwarnings("ignore", category=UserWarning, module='psycopg2') import os @@ -147,6 +149,8 @@ class PGCli(object): # Load config. c = self.config = get_config(pgclirc_file) + NamedQueries.instance = NamedQueries.from_config(self.config) + self.logger = logging.getLogger(__name__) self.initialize_logging() diff --git a/pgcli/pgcompleter.py b/pgcli/pgcompleter.py index 7eaadc86..2ec0ac5a 100644 --- a/pgcli/pgcompleter.py +++ b/pgcli/pgcompleter.py @@ -21,9 +21,6 @@ from .config import load_config, config_location _logger = logging.getLogger(__name__) -NamedQueries.instance = NamedQueries.from_config( - load_config(config_location() + 'config')) - Match = namedtuple('Match', ['completion', 'priority']) _SchemaObject = namedtuple('SchemaObject', 'name schema meta') |