changeset 466:750da8dd1253

trying to fix binds
author catherine@dellzilla
date Tue, 02 Mar 2010 19:11:52 -0500
parents 0be350ab306c
children e6df9ca78f31 acba268c93cc
files sqlpython/exampleSession.txt sqlpython/pgSession.txt sqlpython/sqlpyPlus.py
diffstat 3 files changed, 14 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- 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;
 /.*/
--- 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;
 
--- 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: