Mercurial > sqlpython
changeset 439:0a2474b76db6
trying to make mysql connections work
author | catherine@dellzilla |
---|---|
date | Mon, 01 Feb 2010 10:15:28 -0500 |
parents | 39a664a87c51 |
children | e1a962dd7139 |
files | sqlpython/connections.py sqlpython/sqlpython.py |
diffstat | 2 files changed, 5 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/sqlpython/connections.py Sun Jan 31 08:17:58 2010 -0500 +++ b/sqlpython/connections.py Mon Feb 01 10:15:28 2010 -0500 @@ -35,12 +35,15 @@ class DatabaseInstance(object): import_failure = None + username = None password = None + port = None uri = None pickledir = os.path.join(os.getenv('HOME'), '.sqlpython') connection_uri_parser = re.compile('(postgres|oracle|mysql|sqlite|mssql):/(.*$)', re.IGNORECASE) def __init__(self, arg, opts, default_rdbms = 'oracle'): + opts.username = opts.username or opts.user self.default_rdbms = default_rdbms if not self.parse_connect_uri(arg): self.parse_connect_arg(arg, opts)
--- a/sqlpython/sqlpython.py Sun Jan 31 08:17:58 2010 -0500 +++ b/sqlpython/sqlpython.py Mon Feb 01 10:15:28 2010 -0500 @@ -139,6 +139,8 @@ cmd2.make_option('-d', '--database', type='string', help='Database name to connect to'), cmd2.make_option('-U', '--username', type='string', + help='Database user name to connect as'), + cmd2.make_option('-u', '--user', type='string', help='Database user name to connect as') ]) def do_connect(self, arg, opts):