# HG changeset patch # User Catherine Devlin # Date 1284586105 14400 # Node ID af846fd968cdb35c0f14ca9cd5c45a70a2c13777 # Parent 490ede56f348485f5f52303246173815b635ac71 wildcards in find -c diff -r 490ede56f348 -r af846fd968cd sqlpython/connections.py --- a/sqlpython/connections.py Tue Sep 14 23:21:57 2010 -0400 +++ b/sqlpython/connections.py Wed Sep 15 17:28:25 2010 -0400 @@ -199,7 +199,7 @@ >>> (str(result.owner), str(result.type), str(result.name)) ('scott', 'table', '%') """ - identifier = identifier.replace('*', '%') + identifier = self.sql_format_wildcards(identifier) result = {'owner': '%', 'type': '%', 'name': '%'} result.update(dict(self.ls_parser.parseString(identifier))) return result @@ -208,7 +208,9 @@ operator = 'LIKE' else: operator = '=' - return operator + return operator + def sql_format_wildcards(self, target): + return target.replace('*', '%').replace('?', '_') def objects(self, target, opts): identifier = self.parse_identifier(target) clauses = [] @@ -229,6 +231,7 @@ curs.execute(qry, self.bindVariables(binds)) return curs def columns(self, target, opts): + target = self.sql_format_wildcards(target) if opts.all: owner = '%' else: diff -r 490ede56f348 -r af846fd968cd sqlpython/pgSession.txt --- a/sqlpython/pgSession.txt Tue Sep 14 23:21:57 2010 -0400 +++ b/sqlpython/pgSession.txt Wed Sep 15 17:28:25 2010 -0400 @@ -9,6 +9,7 @@ SQL.No_Connection> set colors off /.*/ SQL.No_Connection> connect --postgres --password=testpassword testplatform testuser +0:testuser@testplatform> 0:testuser@testplatform> drop table play; /.*/