# HG changeset patch # User catherine.devlin@gmail.com # Date 1281006408 14400 # Node ID 8cf08822207ba19fbbf85dbcaa0c1a89c28e8bd4 # Parent 7e72a5f6a94bf0498dba09633f17dd9de0917082 beginning move to Gerald 0.4 diff -r 7e72a5f6a94b -r 8cf08822207b setup.py --- a/setup.py Wed Jun 30 00:15:35 2010 -0400 +++ b/setup.py Thu Aug 05 07:06:48 2010 -0400 @@ -22,7 +22,7 @@ url="http://packages.python.org/sqlpython", packages=find_packages(), include_package_data=True, - install_requires=['pyparsing','cmd2>=0.6.1','gerald>=0.3.6', + install_requires=['pyparsing','cmd2>=0.6.1','gerald>=0.4.0', 'genshi>=0.5'], extras_require = { 'oracle': ['cx_Oracle>=5.0.2'], diff -r 7e72a5f6a94b -r 8cf08822207b sqlpython/connections.py --- a/sqlpython/connections.py Wed Jun 30 00:15:35 2010 -0400 +++ b/sqlpython/connections.py Thu Aug 05 07:06:48 2010 -0400 @@ -147,7 +147,6 @@ colon_between_username_passwd = re.compile(r':(?=[^/]+@)') def gerald_uri(self): result = self.uri().split('?mode=')[0] - result = result.replace('://', ':/') return result def determine_rdbms(self): if self.opts.mysql: @@ -161,6 +160,31 @@ def set_corrections(self): pass + +parser = optparse.OptionParser() +parser.add_option('--postgres', action='store_true', help='Connect to postgreSQL: `connect --postgres [DBNAME [USERNAME]]`') +parser.add_option('--oracle', action='store_true', help='Connect to an Oracle database') +parser.add_option('--mysql', action='store_true', help='Connect to a MySQL database') +parser.add_option('-H', '--hostname', type='string', + help='Machine where database is hosted') +parser.add_option('-p', '--port', type='int', + help='Port to connect to') +parser.add_option('--password', type='string', + help='Password') +parser.add_option('-d', '--database', type='string', + help='Database name to connect to') +parser.add_option('-U', '--username', type='string', + help='Database user name to connect as') + +def connect(connstr): + (options, args) = parser.parse_args(connstr) + print options + print args + + + + + class MySQLConnectionData(ConnectionData): rdbms = 'mysql' default_port = 3306 diff -r 7e72a5f6a94b -r 8cf08822207b sqlpython/pgSession.txt --- a/sqlpython/pgSession.txt Wed Jun 30 00:15:35 2010 -0400 +++ b/sqlpython/pgSession.txt Thu Aug 05 07:06:48 2010 -0400 @@ -8,7 +8,7 @@ /.*/ SQL.No_Connection> set colors off /.*/ -SQL.No_Connection> connect --postgres --password=testpass00word testplatform testuser +SQL.No_Connection> connect --postgres --password=testpassword testplatform testuser 0:testuser@testplatform> drop table play; /.*/