Mercurial > sqlpython
comparison sqlpyPlus.py @ 145:7e5105efa15d
catch all terminators when parsing
author | catherine@Elli.myhome.westell.com |
---|---|
date | Tue, 23 Sep 2008 07:43:11 -0400 |
parents | 5a021524805a |
children | d5917f02ae83 |
comparison
equal
deleted
inserted
replaced
144:5a021524805a | 145:7e5105efa15d |
---|---|
553 stmt = "SELECT object_name FROM all_objects WHERE object_name LIKE '%s%%'" | 553 stmt = "SELECT object_name FROM all_objects WHERE object_name LIKE '%s%%'" |
554 completions = self.select_scalar_list(stmt % (text)) | 554 completions = self.select_scalar_list(stmt % (text)) |
555 return completions | 555 return completions |
556 | 556 |
557 rowlimitPattern = pyparsing.Word(pyparsing.nums)('rowlimit') | 557 rowlimitPattern = pyparsing.Word(pyparsing.nums)('rowlimit') |
558 terminatorPattern = (pyparsing.oneOf('; \\s \\S \\c \\C \\t \\x \\h') | 558 terminatorPattern = (pyparsing.oneOf('; \\s \\S \\c \\C \\t \\x \\h \\g \\G \\i') |
559 ^ pyparsing.Literal('\n/') ^ \ | 559 ^ pyparsing.Literal('\n/') ^ \ |
560 (pyparsing.Literal('\nEOF') + pyparsing.stringEnd)) \ | 560 (pyparsing.Literal('\nEOF') + pyparsing.stringEnd)) \ |
561 ('terminator') + \ | 561 ('terminator') + \ |
562 pyparsing.Optional(rowlimitPattern) + \ | 562 pyparsing.Optional(rowlimitPattern) + \ |
563 pyparsing.FollowedBy(pyparsing.LineEnd()) | 563 pyparsing.FollowedBy(pyparsing.LineEnd()) |
724 object_type, object_name, owner = self.curs.fetchone() | 724 object_type, object_name, owner = self.curs.fetchone() |
725 except TypeError: | 725 except TypeError: |
726 print 'Could not resolve object %s.' % identifier | 726 print 'Could not resolve object %s.' % identifier |
727 object_type, owner, object_name = '', '', '' | 727 object_type, owner, object_name = '', '', '' |
728 return object_type, owner, object_name | 728 return object_type, owner, object_name |
729 #todo: resolve not finding cwm$ table | |
730 | 729 |
731 def do_resolve(self, arg): | 730 def do_resolve(self, arg): |
732 arg = self.parsed(arg).unterminated.upper() | 731 arg = self.parsed(arg).unterminated.upper() |
733 self.stdout.write(','.join(self.resolve(arg))+'\n') | 732 self.stdout.write(','.join(self.resolve(arg))+'\n') |
734 | 733 |