# HG changeset patch # User catherine@dellzilla # Date 1267575112 18000 # Node ID 750da8dd125303903ba5f7526b0c966783ce3e3f # Parent 0be350ab306c32ec1a44ea2e1f49cdd21b0b5c4d trying to fix binds diff -r 0be350ab306c -r 750da8dd1253 sqlpython/exampleSession.txt --- a/sqlpython/exampleSession.txt Tue Mar 02 15:58:31 2010 -0500 +++ b/sqlpython/exampleSession.txt Tue Mar 02 19:11:52 2010 -0500 @@ -5,6 +5,7 @@ privilege (`GRANT RESOURCE TO testschema`). SQL.No_Connection> set color off +/.*/ SQL.No_Connection> connect testschema/testschema@orcl 0:testschema@orcl> drop table play; /.*/ diff -r 0be350ab306c -r 750da8dd1253 sqlpython/pgSession.txt --- a/sqlpython/pgSession.txt Tue Mar 02 15:58:31 2010 -0500 +++ b/sqlpython/pgSession.txt Tue Mar 02 19:11:52 2010 -0500 @@ -4,8 +4,10 @@ user ``testuser``, password ``testpassword``, with full rights on schema ``testuser``. -SQL.No_Connection> set color off - +SQL.No_Connection> set +/.*/ +SQL.No_Connection> set colors off +/.*/ SQL.No_Connection> connect --postgres --password=testpassword testplatform testuser 0:testuser@testplatform> drop table play; /.*/ @@ -63,8 +65,8 @@ 5 rows selected. -0:testuser@testplatform> ls 0:testuser@testplatform> refresh +0:testuser@testplatform> py import time; time.sleep(120) # allow metadata to load 0:testuser@testplatform> ls table/play 0:testuser@testplatform> ls -l @@ -86,12 +88,6 @@ Executed --- undone: reading comments! --- ls -l --- bind variable set using quotes fails --- \dt total fail --- set color off fail (in testing; weird) - 0:testuser@testplatform> :author = Shakespeare 0:testuser@testplatform> select * from play where author = %(author)s; diff -r 0be350ab306c -r 750da8dd1253 sqlpython/sqlpyPlus.py --- a/sqlpython/sqlpyPlus.py Tue Mar 02 15:58:31 2010 -0500 +++ b/sqlpython/sqlpyPlus.py Tue Mar 02 19:11:52 2010 -0500 @@ -358,6 +358,10 @@ raise ValueError, 'Too many matches: %s' % str(result) return result[0] +# TODO: read comments in psql +# ls -l +# bind variables / quotes + class sqlpyPlus(sqlpython.sqlpython): defaultExtension = 'sql' abbrev = True @@ -1380,7 +1384,10 @@ ''' #TODO: quoted assignments currently failing? - arg = self.parsed(arg) + #arg = self.parsed(arg) + if hasattr(arg, 'parsed'): + arg = arg.parsed.raw + arg = arg.strip(self.terminators) try: var, val = self.assignmentSplitter.split(arg, maxsplit=1) except ValueError: