# HG changeset patch # User catherine.devlin@gmail.com # Date 1309396682 14400 # Node ID 853b9e675dd77126d1ffc57531b132ac3cd58c2b # Parent 0eea48bd3ad6a55f11da3c691534ef6ecd8b3235 fixed \dt for mysql, postgresql; ls base table still failing diff -r 0eea48bd3ad6 -r 853b9e675dd7 sqlpython/connections.py --- 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 )) diff -r 0eea48bd3ad6 -r 853b9e675dd7 sqlpython/sqlpyPlus.py --- 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):