Mercurial > sqlpython
changeset 530:853b9e675dd7
fixed \dt for mysql, postgresql; ls base table still failing
author | catherine.devlin@gmail.com |
---|---|
date | Wed, 29 Jun 2011 21:18:02 -0400 |
parents | 0eea48bd3ad6 |
children | 5c49b5a32687 |
files | sqlpython/connections.py sqlpython/sqlpyPlus.py |
diffstat | 2 files changed, 9 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/sqlpython/connections.py Tue Feb 01 19:16:33 2011 -0500 +++ b/sqlpython/connections.py Wed Jun 29 21:18:02 2011 -0400 @@ -170,11 +170,12 @@ self.instance_number = instance_number self.prompt = "%d:%s@%s> " % (self.instance_number, self.username, self.database) sqlname = pyparsing.Word(pyparsing.alphas + '$_#%*', pyparsing.alphanums + '$_#%*') + typname = pyparsing.Word(pyparsing.alphas + ' ') ls_parser = ( (pyparsing.Optional(sqlname("owner") + "/") + - pyparsing.Optional(sqlname("type") + "/") + + pyparsing.Optional(typname("type") + "/") + pyparsing.Optional(sqlname("name")) + pyparsing.stringEnd ) - | ( pyparsing.Optional(sqlname("type") + "/") + + | ( pyparsing.Optional(typname("type") + "/") + pyparsing.Optional(sqlname("owner") + ".") + pyparsing.Optional(sqlname("name")) + pyparsing.stringEnd ))
--- a/sqlpython/sqlpyPlus.py Tue Feb 01 19:16:33 2011 -0500 +++ b/sqlpython/sqlpyPlus.py Wed Jun 29 21:18:02 2011 -0400 @@ -1133,13 +1133,17 @@ self.perror(self.do_psql.__doc__) def _do_dir(self, type, arg, opts): - self._do_ls("%s/%s%s%s" % (type, str(arg), arg.parsed.terminator, arg.parsed.suffix), opts) + self._do_ls("%%/%s/%s%s%s" % (type, str(arg), arg.parsed.terminator, arg.parsed.suffix), opts) @options(standard_options) def do__dir_tables(self, arg, opts): 'Shortcut for ``ls table/``' - self._do_dir('table', arg, opts) + if self.rdbms in ('postgres','mysql'): + target = 'base table' + else: + target = "table" + self._do_dir(target, arg, opts) @options(standard_options) def do__dir_views(self, arg, opts):