Mercurial > sqlpython
changeset 309:0d16630d8e04
added table comment to desc -l
author | catherine@Elli.myhome.westell.com |
---|---|
date | Wed, 25 Mar 2009 18:42:22 -0400 |
parents | 4d24fea42364 |
children | c897add05eb1 |
files | sqlpython/sqlpyPlus.py |
diffstat | 1 files changed, 9 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/sqlpython/sqlpyPlus.py Wed Mar 25 17:16:23 2009 -0400 +++ b/sqlpython/sqlpyPlus.py Wed Mar 25 18:42:22 2009 -0400 @@ -420,6 +420,11 @@ commentGrammars = pyparsing.Or([Parser.comment_def, pyparsing.cStyleComment]) prefixParser = pyparsing.Optional(pyparsing.Word(pyparsing.nums)('connection_number') + ':') + reserved_words = [ + 'alter', 'begin', 'comment', 'create', 'delete', 'drop', 'end', 'for', 'grant', + 'insert', 'intersect', 'lock', 'minus', 'on', 'order', 'rename', + 'resource', 'revoke', 'select', 'share', 'start', 'union', 'update', + 'where', 'with'] default_file_name = 'afiedt.buf' def __init__(self): sqlpython.sqlpython.__init__(self) @@ -439,6 +444,7 @@ self.substvars = {} self.result_history = [] self.store_results = True + self.pystate = {'r': [], 'binds': self.binds, 'substs': self.substvars} # overrides cmd's parseline @@ -1021,6 +1027,9 @@ self.stdout.write("%s %s.%s\n" % (object_type, owner, object_name)) try: if object_type == 'TABLE': + if opts.long: + self._execute(queries['tabComments'], {'table_name':object_name, 'owner':owner}) + self.stdout.write(self.curs.fetchone()[0]) descQ = descQueries[object_type][opts.long] else: descQ = descQueries[object_type][opts.long]