diff options
-rw-r--r-- | TODO | 2 | ||||
-rw-r--r-- | pgcli/pgexecute.py | 11 |
2 files changed, 3 insertions, 10 deletions
@@ -1,4 +1,3 @@ -* [] postgres:// url is failing. * [] Meta-enter to end the line not just semi-colon. * [] Cmd-K breaks in OS X. * [] Typing mid stream doesn't complete, only end of line is auto-completed. @@ -21,6 +20,7 @@ * [ ] Detect a '.' and parse the word before it and get it's real name. * [] Refactor the execution and output into a separate class. * [] Create a class for the config and make it easy to access. +* [X] postgres:// url is failing. * [X] Implement \l, show databases * [X] DESCRIBE is also not listed in the autocompletion. * [X] Add MySQL commands (use, describe etc) diff --git a/pgcli/pgexecute.py b/pgcli/pgexecute.py index 2d276e8d..1edbf079 100644 --- a/pgcli/pgexecute.py +++ b/pgcli/pgexecute.py @@ -49,11 +49,12 @@ class PGExecute(object): databases_query = '''SELECT datname FROM pg_database;''' def __init__(self, database, user, password, host, port): - self.conn = psycopg2.connect(database) (self.dbname, self.user, self.password, self.host, self.port) = \ _parse_dsn(database, default_user=user, default_password=password, default_host=host, default_port=port) + self.conn = psycopg2.connect(database=self.dbname, user=self.user, + password=self.password, host=self.host, port=self.port) self.conn.autocommit = True def run(self, sql): @@ -114,11 +115,3 @@ class PGExecute(object): with self.conn.cursor() as cur: cur.execute(self.databases_query) return [x[0] for x in cur.fetchall()] - - #def _meta_execute(self, sql, query_params=()): - #with self.conn.cursor() as cur: - #if query_params: - #cur.execute(sql, query_params) - #else: - #cur.execute(sql) - #return [x[0] for x in cur.fetchall()] |