Mercurial > sqlpython
changeset 331:a6cbcf24f148
oops, needed to fix resolve_many
author | Catherine Devlin <catherine.devlin@gmail.com> |
---|---|
date | Tue, 07 Apr 2009 13:15:07 -0400 |
parents | 8dd71d47f3cb |
children | 8d5e4ad05a45 |
files | sqlpython/metadata.py sqlpython/sqlpyPlus.py |
diffstat | 2 files changed, 8 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/sqlpython/metadata.py Mon Apr 06 17:37:19 2009 -0400 +++ b/sqlpython/metadata.py Tue Apr 07 13:15:07 2009 -0400 @@ -143,4 +143,9 @@ '' as current_username FROM sqlite_master""" +metaqueries['resolve_many']['oracle'] = """ +SELECT owner, object_type, object_name, user as current_username +FROM all_objects""" + + '''oof, metadata is hard. \d information_schema.tables, http://www.alberton.info/postgresql_meta_info.html''' \ No newline at end of file
--- a/sqlpython/sqlpyPlus.py Mon Apr 06 17:37:19 2009 -0400 +++ b/sqlpython/sqlpyPlus.py Tue Apr 07 13:15:07 2009 -0400 @@ -732,7 +732,7 @@ if opts.dump: statekeeper = Statekeeper(self, ('stdout',)) try: - for (owner, object_type, object_name) in self.resolve_many(arg, opts): + for (owner, object_name, object_type) in self.resolve_many(arg, opts): if object_type in self.supported_ddl_types: object_type = {'DATABASE LINK': 'DB_LINK', 'JAVA CLASS': 'JAVA_SOURCE' }.get(object_type) or object_type @@ -1295,10 +1295,8 @@ return '\n'.join(where) def resolve_many(self, arg, opts): - statement = ''' - SELECT owner, object_type, object_name - FROM all_objects %s - ORDER BY object_type, object_name''' % self.ls_where_clause(arg, opts) + statement = """SELECT owner, object_name, object_type FROM (%s) + %s""" % (metaqueries['ls'][self.rdbms], self.ls_where_clause(arg, opts)) self._execute(statement) return self.curs.fetchall()