tested vs sqlite and pg. mssql should also be ok (uses ischema like pg.) others are best-guess based on has_table code.
def max_identifier_length(self):
return 31
+
+ def table_names(self, connection, schema):
+ s = "SELECT R.RDB$RELATION_NAME FROM RDB$RELATIONS R"
+ return [row[0] for row in connection.execute(s)]
def has_table(self, connection, table_name, schema=None):
tblqry = """
return self.cache[name]
+def table_names(connection, schema):
+ s = select([tables.c.table_name], tables.c.table_schema==schema)
+ return [row[0] for row in connection.execute(s)]
+
+
def reflecttable(connection, table, include_columns, ischema_names):
key_constraints = pg_key_constraints
def schemadropper(self, *args, **params):
return InfoSchemaDroper( self , *args , **params)
+ def table_names(self, connection, schema):
+ s = "select tabname from systables"
+ return [row[0] for row in connection.execute(s)]
+
def has_table(self, connection, table_name,schema=None):
cursor = connection.execute("""select tabname from systables where tabname=?""", table_name.lower() )
return bool( cursor.fetchone() is not None )
except Exception, e:
raise exceptions.SQLError(statement, parameters, e)
+ def table_names(self, connection, schema):
+ from sqlalchemy.databases import information_schema as ischema
+ return ischema.table_names(connection, schema)
+
def raw_connection(self, connection):
"""Pull the raw pymmsql connection out--sensative to "pool.ConnectionFairy" and pymssql.pymssqlCnx Classes"""
try:
row = c.fetchone()
return row is not None
+ def table_names(self, connection):
+ sql = "SELECT tablename FROM pg_tables WHERE schemaname = 'public'"
+ return [row[0] for row in connection.execute(s)]
+
def reflecttable(self, connection, table, include_columns):
import sqlalchemy.databases.information_schema as ischema
dblink = ''
return name, owner, dblink
raise
+
+ def table_names(self, connection, schema):
+ # sorry, I have no idea what that dblink stuff is about :)
+ s = "select table_name from all_tables"
+ return [row[0] for row in connection.execute(s)]
def reflecttable(self, connection, table, include_columns):
preparer = self.identifier_preparer
return "losed the connection unexpectedly" in str(e)
else:
return False
+
+ def table_names(self, connection, schema):
+ return ischema.table_names(connection, schema)
def reflecttable(self, connection, table, include_columns):
if self.use_information_schema:
def oid_column_name(self, column):
return "oid"
+
+ def table_names(self, connection, schema):
+ s = "SELECT name FROM sqlite_master WHERE type='table'"
+ return [row[0] for row in connection.execute(s)]
def has_table(self, connection, table_name, schema=None):
cursor = connection.execute("PRAGMA table_info(%s)" %
"""
return Connection(self, close_with_result=close_with_result, **kwargs)
+
+ def table_names(self, schema=None):
+ conn = self.contextual_connect()
+ if not schema:
+ try:
+ schema = self.dialect.get_default_schema_name(conn)
+ except NotImplementedError:
+ pass
+ try:
+ return self.dialect.table_names(conn, schema)
+ finally:
+ conn.close()
def reflecttable(self, table, connection=None, include_columns=None):
"""Given a Table object, reflects its columns and properties from the database."""