Compare commits

...

33 commits

Author SHA1 Message Date
b4c4d1bb26 use unix line endings for setup.py 2025-10-06 14:11:42 -05:00
dafac32f94 update home page URL for project 2025-10-06 14:11:01 -05:00
bd74701c42 add readme file, to replace old home page
which was at https://sqlalchemy-sa.edbob.org
2025-10-06 14:05:25 -05:00
Lance Edgar
756f0a8e5d bumped version 2010-07-31 20:15:49 -05:00
Lance Edgar
6841f1444a Added tag v0.1b4 for changeset 12904bc2d1e5 2010-07-31 20:09:44 -05:00
Lance Edgar
3ee47ed87f added outer join support...michael was right :)
And once again, thanks to Michael Bayer for forging the way on this one.
The Oracle dialect code was still pretty much copied directly over.
2010-07-31 20:09:17 -05:00
Lance Edgar
8846e9b372 bumped version 2010-06-25 13:01:15 -05:00
Lance Edgar
ef941891e4 Added tag v0.1b3 for changeset faf1f77492bb 2010-06-25 12:59:04 -05:00
Lance Edgar
f7c4a2c2df bumped sqlalchemy requirement
It's been discovered that SQLAlchemy 0.5.2 won't work; some problem with joining the sales log tables.
2010-06-25 12:58:34 -05:00
Lance Edgar
2fd3f190af Bumped version to 0.1b3. 2010-05-28 11:29:49 -05:00
Lance Edgar
c06909f5f4 Added tag v0.1b2 for changeset 610c63f302f7 2010-05-28 11:29:34 -05:00
Lance Edgar
2edda5c7b4 Bumped version to 0.1b2. 2010-05-28 10:34:59 -05:00
Lance Edgar
e1616260af Added tag v0.1b1 for changeset fa58f0f4ac2c 2010-05-28 10:34:37 -05:00
Lance Edgar
8fb11fd269 more upload prep
Added manifest.in, gave license file a .txt extension.
2010-05-28 10:22:20 -05:00
Lance Edgar
e68268c283 Fleshed out setup.py in prep for PyPI upload. 2010-05-28 10:17:15 -05:00
Lance Edgar
5021d47ff4 Bumped version to 0.1b1. 2010-05-28 10:16:48 -05:00
Lance Edgar
2b9957d2a1 Added entry point for SA 0.5 (whoops); emptied __init__ module. 2010-05-28 10:05:02 -05:00
Lance Edgar
4369f88c54 Fixed operator overloading in SA05 dialect; was doing so globally instead of dialect-local. 2010-05-27 13:00:39 -05:00
Lance Edgar
416a710dff Bumped version to 0.1a5. 2010-05-21 20:14:15 -05:00
Lance Edgar
6a2d358663 Added tag v0.1a4 for changeset 4a0d02f410ed 2010-05-21 20:10:54 -05:00
Lance Edgar
e89d6e978d Merged sqlalchemy-0.5 branch. 2010-05-21 20:10:27 -05:00
Lance Edgar
8bea24fb91 Closed sqlalchemy-0.5 branch. 2010-05-21 20:09:59 -05:00
Lance Edgar
782c60b263 Added .dev build tag; bumped version to 0.1a4. 2010-05-21 20:08:32 -05:00
Lance Edgar
21214df490 Merged sqlalchemy-0.5 branch. 2010-05-21 20:06:47 -05:00
Lance Edgar
c2ba733f0d Fixed primary key reflection for SA 0.5. 2010-05-21 19:50:23 -05:00
Lance Edgar
617c28e8c7 Added support for SA 0.5 (previously only 0.6 was supported). 2010-05-21 18:29:49 -05:00
Lance Edgar
fd200738b9 Added tag v0.1a3 for changeset b762be696018 2010-05-04 15:32:29 -05:00
Lance Edgar
34e32041f5 Bumped version to 0.1a3. 2010-05-04 15:31:43 -05:00
Lance Edgar
6423627665 Added "long" type bind parameter check. 2010-05-04 15:31:15 -05:00
Lance Edgar
1a36f614cf Added tag v0.1a2 for changeset 296bae083a73 2010-04-27 16:27:30 -05:00
Lance Edgar
64ae45af90 Bumped version to 0.1a2. 2010-04-27 16:27:20 -05:00
Lance Edgar
ad845f5765 Added unicode parameter workaround. 2010-04-27 16:26:39 -05:00
Lance Edgar
e28e7a5592 Added tag v0.1a1 for changeset df236cc3cd85 2010-04-25 20:17:44 -05:00
12 changed files with 375 additions and 178 deletions

1
MANIFEST.in Normal file
View file

@ -0,0 +1 @@
include COPYING.txt

43
README.md Normal file
View file

@ -0,0 +1,43 @@
# SQLBase7-SA
SQLBase7-SA is a SQLAlchemy driver/dialect for the Centura SQLBase
database, specifically version 7.5.1.
## About the Project
From what I can tell, SQLBase is still an actively-developed database,
but it is no longer owned by Centura (see
[here](http://en.wikipedia.org/wiki/Gupta_Technologies)). Also, the
current version (according to [this
page](http://www.unify.com/Products/Data_Management/SQLBase/), as of
25 Apr 2010) is 11.5, so I have no idea how useful this project will
be for versions of SQLBase more recent than 7.5.1.
This project exists only for the sake of providing read-only access to
legacy data, specifically that used by the
[CAM32](http://www.camcommerce.com/products/CAM32.aspx) Point of Sale
software. It's possible that it could allow writing data, etc., but I
personally won't be adding any such features unless/until the need
arises.
I don't expect there to be much of anyone using SQLBase 7.5.1 at this
point (besides perhaps other CAM32 users), but if you do happen to
need additional functionality from this project or just have questions
or comments, feel free to drop me a line at lance@edbob.org.
## Downloads
The code is released under the [GNU General Public
License](http://www.gnu.org/licenses/gpl.html), version 3.
It is available at [PyPI](http://pypi.python.org/pypi/SQLBase7-SA), so
the easiest way to get the package is with the command:
# pip install SQLBase7-SA
Again, this project is extremely specific to my needs, so I'm only
building eggs for Python 2.5 and 2.6 at this point. If you happen to
need something else then please contact me.
Copyright © 2010 Lance Edgar <lance@edbob.org>

2
setup.cfg Normal file
View file

@ -0,0 +1,2 @@
[egg_info]
tag_build = .dev

139
setup.py
View file

@ -1,53 +1,86 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# SQLBase7-SA -- SQLAlchemy driver/dialect for Centura SQLBase v7
# Copyright © 2010 Lance Edgar
#
# This file is part of SQLBase7-SA.
#
# SQLBase7-SA is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SQLBase7-SA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SQLBase7-SA. If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from setuptools import setup, find_packages
import os
execfile(os.path.join(os.path.dirname(__file__), 'sqlbase7_sa', '_version.py'))
setup(
name = 'SQLBase7-SA',
version = __version__,
description = 'SQLAlchemy driver/dialect for Centura SQLBase v7',
author = 'Lance Edgar',
author_email = 'lance@edbob.org',
packages = find_packages(),
install_requires = [
'SQLAlchemy>=0.6.0',
],
entry_points = {
'sqlalchemy.dialects' : [
'sqlbase7 = sqlbase7_sa:base.dialect',
],
},
test_suite = 'sqlbase7_sa.tests',
)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# SQLBase7-SA -- SQLAlchemy driver/dialect for Centura SQLBase v7
# Copyright © 2010 Lance Edgar
#
# This file is part of SQLBase7-SA.
#
# SQLBase7-SA is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SQLBase7-SA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SQLBase7-SA. If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from setuptools import setup, find_packages
import os
execfile(os.path.join(os.path.dirname(__file__), 'sqlbase7_sa', '_version.py'))
setup(
name = 'SQLBase7-SA',
version = __version__,
author = 'Lance Edgar',
author_email = 'lance@edbob.org',
url = "https://forgejo.wuttaproject.org/rattail/sqlbase7-sa",
license = "GNU GPL v3",
description = 'SQLAlchemy dialect for Centura SQLBase v7',
long_description = """
SQLBase7-SA - SQLAlchemy dialect for Centura SQLBase v7
-------------------------------------------------------
This package provides a (possibly rudimentary) implementation
of a SQLAlchemy dialect for the Centura SQLBase database
engine. It is only intended (and known) to work with a very
specific version of this database, that version being 7.5.1.
""",
classifiers = [
'Development Status :: 4 - Beta',
'Environment :: Plugins',
'Environment :: Win32 (MS Windows)',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Natural Language :: English',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python',
'Programming Language :: Python :: 2.5',
'Programming Language :: Python :: 2.6',
'Topic :: Database',
'Topic :: Software Development :: Libraries :: Python Modules',
],
packages = find_packages(),
install_requires = [
'SQLAlchemy>0.5.2',
],
entry_points = {
# SQLAlchemy 0.5
'sqlalchemy.databases' : [
'sqlbase7 = sqlbase7_sa.sqlbase7_sa05:SQLBase7Dialect_SA05',
],
# SQLAlchemy 0.6
'sqlalchemy.dialects' : [
'sqlbase7 = sqlbase7_sa.sqlbase7_sa06:SQLBase7Dialect_SA06_pyodbc',
],
},
test_suite = 'sqlbase7_sa.tests',
)

View file

@ -23,11 +23,4 @@
################################################################################
from sqlbase7_sa import base
from sqlbase7_sa import pyodbc
from sqlbase7_sa._version import __version__
# default dialect
base.dialect = pyodbc.dialect

View file

@ -23,4 +23,4 @@
################################################################################
__version__ = '0.1a1'
__version__ = '0.1b5'

View file

@ -1,44 +0,0 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# SQLBase7-SA -- SQLAlchemy driver/dialect for Centura SQLBase v7
# Copyright © 2010 Lance Edgar
#
# This file is part of SQLBase7-SA.
#
# SQLBase7-SA is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SQLBase7-SA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SQLBase7-SA. If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from sqlalchemy.connectors.pyodbc import PyODBCConnector
from sqlbase7_sa.base import SQLBase7Dialect
class SQLBase7_pyodbc(PyODBCConnector, SQLBase7Dialect):
def create_connect_args(self, url):
connection_string = ';'.join((
"DRIVER={Centura SQLBase 3.5 32-bit Driver -NT & Win95}",
"SERVER=%s" % url.host,
"DATABASE=%s" % url.database,
"UID=%s" % url.username,
"PWD=%s" % url.password,
))
return [connection_string], {}
dialect = SQLBase7_pyodbc

View file

@ -25,8 +25,16 @@
from sqlalchemy.engine.default import DefaultDialect
from sqlalchemy import types, and_
from sqlalchemy.sql.compiler import SQLCompiler
from sqlalchemy.sql.expression import Join
from sqlalchemy.sql import visitors, operators, ClauseElement
import sqlalchemy
from pkg_resources import parse_version
if parse_version(sqlalchemy.__version__) <= parse_version('0.5.99'):
from sqlalchemy.sql.compiler import DefaultCompiler as CompilerBase
else:
from sqlalchemy.sql.compiler import SQLCompiler as CompilerBase
class LimitClauseNotSupported(Exception):
@ -39,7 +47,7 @@ class LimitClauseNotSupported(Exception):
return "Centura SQLBase 7.5.1 doesn't support a LIMIT clause for the SELECT statement (received: limit = %u, offset = %u)" % (self.limit, self.offset)
class SQLBase7Compiler(SQLCompiler):
class SQLBase7Compiler(CompilerBase):
# Most of the code below was copied from the Oracle dialect. Thanks to Michael Bayer
# for pointing that out. Oh, and for writing SQLAlchemy; that was pretty cool.
@ -49,7 +57,12 @@ class SQLBase7Compiler(SQLCompiler):
return self.process(join.left, **kwargs) + ", " + self.process(join.right, **kwargs)
def visit_select(self, select, **kwargs):
froms = select._get_display_froms()
if self.stack and 'from' in self.stack[-1]:
existingfroms = self.stack[-1]['from']
else:
existingfroms = None
froms = select._get_display_froms(existingfroms)
whereclause = self._get_join_whereclause(froms)
if whereclause is not None:
select = select.where(whereclause)
@ -58,13 +71,22 @@ class SQLBase7Compiler(SQLCompiler):
raise LimitClauseNotSupported(select._limit, select._offset)
kwargs['iswrapper'] = getattr(select, '_is_wrapper', False)
return SQLCompiler.visit_select(self, select, **kwargs)
return super(SQLBase7Compiler, self).visit_select(select, **kwargs)
def _get_join_whereclause(self, froms):
clauses = []
def visit_join(join):
clauses.append(join.onclause)
if join.isouter:
def visit_binary(binary):
if binary.operator == operators.eq:
if binary.left.table is join.right:
binary.left = _OuterJoinColumn(binary.left)
elif binary.right.table is join.right:
binary.right = _OuterJoinColumn(binary.right)
clauses.append(visitors.cloned_traverse(join.onclause, {}, {'binary':visit_binary}))
else:
clauses.append(join.onclause)
for j in join.left, join.right:
if isinstance(j, Join):
visit_join(j)
@ -77,23 +99,26 @@ class SQLBase7Compiler(SQLCompiler):
return and_(*clauses)
return None
def visit_ilike_op(self, binary, **kw):
escape = binary.modifiers.get("escape", None)
return '@lower(%s) LIKE @lower(%s)' % (
self.process(binary.left, **kw),
self.process(binary.right, **kw)) \
+ (escape and ' ESCAPE \'%s\'' % escape or '')
def visit_outer_join_column(self, vc):
return self.process(vc.column) + "(+)"
class _OuterJoinColumn(ClauseElement):
__visit_name__ = 'outer_join_column'
def __init__(self, column):
self.column = column
class SQLBase7Dialect(DefaultDialect):
name = 'sqlbase7'
max_identifier_length = 18
statement_compiler = SQLBase7Compiler
type_map = {
max_identifier_length = 18
_type_map = {
'CHAR' : types.CHAR,
'DATE' : types.DATE,
'DECIMAL' : types.DECIMAL,
@ -104,59 +129,29 @@ class SQLBase7Dialect(DefaultDialect):
'VARCHAR' : types.VARCHAR,
}
def _check_unicode_returns(self, connection):
return False
def create_connect_args(self, url):
connection_string = ';'.join((
"DRIVER={Centura SQLBase 3.5 32-bit Driver -NT & Win95}",
"SERVER=%s" % url.host,
"DATABASE=%s" % url.database,
"UID=%s" % url.username,
"PWD=%s" % url.password,
))
return [connection_string], {}
def get_table_names(self, connection, schema=None, **kw):
if schema is None:
schema = ''
else:
schema = '%s.' % schema
cursor = connection.connection.cursor()
table_names = [row.NAME for row in cursor.execute(
"SELECT NAME FROM %sSYSTABLES WHERE REMARKS IS NOT NULL" % schema
)]
cursor.close()
return table_names
def get_columns(self, connection, table_name, schema=None, **kw):
if schema is None:
schema = ''
else:
schema = '%s.' % schema
cursor = connection.connection.cursor()
columns = []
for row in cursor.execute("SELECT NAME,COLTYPE,NULLS FROM %sSYSCOLUMNS WHERE TBNAME = '%s'" % (schema, table_name)):
columns.append({
'name' : row.NAME,
'type' : self.type_map[row.COLTYPE],
'nullable' : row.NULLS == 'Y',
'default' : None,
'autoincrement' : False,
})
cursor.close()
return columns
def get_primary_keys(self, connection, table_name, schema=None, **kw):
if schema is None:
schema = ''
else:
schema = '%s.' % schema
cursor = connection.connection.cursor()
primary_keys = [row.COLNAME for row in cursor.execute(
"SELECT COLNAME FROM %sSYSPKCONSTRAINTS WHERE NAME = '%s' ORDER BY PKCOLSEQNUM" % (schema, table_name)
)]
cursor.close()
return primary_keys
def get_foreign_keys(self, connection, table_name, schema=None, **kw):
return []
def get_indexes(self, connection, table_name, schema=None, **kw):
return []
def get_default_schema_name(self, connection):
return 'SYSADM'
def do_execute(self, cursor, statement, parameters, context=None):
# For some (perhaps good?) reason, the SQLBase ODBC driver doesn't like
# parameters if they're of Unicode or Long type. I'd hoped at first that
# the "supports_unicode_binds" attribute would take care of the Unicode
# problem but it didn't seem to. And now the Long parameters seem to
# throw the same error, so...
parameters = list(parameters)
for i, parameter in enumerate(parameters):
if isinstance(parameter, unicode):
parameters[i] = str(parameter)
elif isinstance(parameter, long):
parameters[i] = int(parameter)
super(SQLBase7Dialect, self).do_execute(cursor, statement, tuple(parameters), context)

View file

@ -0,0 +1,76 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# SQLBase7-SA -- SQLAlchemy driver/dialect for Centura SQLBase v7
# Copyright © 2010 Lance Edgar
#
# This file is part of SQLBase7-SA.
#
# SQLBase7-SA is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SQLBase7-SA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SQLBase7-SA. If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from sqlalchemy import types, Column, PrimaryKeyConstraint
from sqlalchemy.sql.compiler import OPERATORS
from sqlalchemy.sql import operators as sql_operators
from sqlbase7_sa.sqlbase7 import SQLBase7Compiler, SQLBase7Dialect
class SQLBase7Compiler_SA05(SQLBase7Compiler):
operators = SQLBase7Compiler.operators.copy()
operators.update({
sql_operators.ilike_op: lambda x, y, escape=None: "@lower(%s) LIKE @lower(%s)" % (x, y) + (escape and ' ESCAPE \'%s\'' % escape or ''),
})
class SQLBase7Dialect_SA05(SQLBase7Dialect):
statement_compiler = SQLBase7Compiler_SA05
@classmethod
def dbapi(cls):
import pyodbc
return pyodbc
def table_names(self, connection, schema):
cursor = connection.connection.cursor()
table_names = [row.NAME for row in cursor.execute(
"SELECT NAME FROM %s.SYSTABLES WHERE REMARKS IS NOT NULL" % schema
)]
cursor.close()
return table_names
def reflecttable(self, connection, table, include_columns=None):
if table.schema is None:
table.schema = connection.default_schema_name()
sql = "SELECT NAME,COLTYPE,NULLS FROM %s.SYSCOLUMNS WHERE TBNAME = '%s'" % (table.schema, table.name)
if include_columns:
sql += " AND NAME NOT IN (%s)" % ','.join(include_columns)
cursor = connection.connection.cursor()
for row in cursor.execute(sql):
table.append_column(Column(row.NAME, self._type_map[row.COLTYPE]))
cursor.close()
cursor = connection.connection.cursor()
key_columns = [row.COLNAME for row in cursor.execute(
"SELECT COLNAME FROM %s.SYSPKCONSTRAINTS WHERE NAME = '%s' ORDER BY PKCOLSEQNUM" % (table.schema, table.name)
)]
if key_columns:
table.append_constraint(PrimaryKeyConstraint(*key_columns))
cursor.close()

View file

@ -0,0 +1,99 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
################################################################################
#
# SQLBase7-SA -- SQLAlchemy driver/dialect for Centura SQLBase v7
# Copyright © 2010 Lance Edgar
#
# This file is part of SQLBase7-SA.
#
# SQLBase7-SA is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# SQLBase7-SA is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SQLBase7-SA. If not, see <http://www.gnu.org/licenses/>.
#
################################################################################
from sqlbase7_sa.sqlbase7 import SQLBase7Compiler, SQLBase7Dialect
from sqlalchemy.connectors.pyodbc import PyODBCConnector
class SQLBase7Compiler_SA06(SQLBase7Compiler):
def visit_ilike_op(self, binary, **kw):
escape = binary.modifiers.get("escape", None)
return '@lower(%s) LIKE @lower(%s)' % (
self.process(binary.left, **kw),
self.process(binary.right, **kw)) \
+ (escape and ' ESCAPE \'%s\'' % escape or '')
class SQLBase7Dialect_SA06(SQLBase7Dialect):
statement_compiler = SQLBase7Compiler_SA06
def _get_default_schema_name(self, connection):
return 'SYSADM'
def _check_unicode_returns(self, connection):
return False
def get_table_names(self, connection, schema=None, **kw):
cursor = connection.connection.cursor()
table_names = [row.NAME for row in cursor.execute(
"SELECT NAME FROM %s.SYSTABLES WHERE REMARKS IS NOT NULL" % schema
)]
cursor.close()
return table_names
def get_columns(self, connection, table_name, schema=None, **kw):
if schema is None:
schema = self.get_default_schema_name(connection)
cursor = connection.connection.cursor()
columns = []
for row in cursor.execute("SELECT NAME,COLTYPE,NULLS FROM %s.SYSCOLUMNS WHERE TBNAME = '%s'" % (schema, table_name)):
columns.append({
'name' : row.NAME,
'type' : self._type_map[row.COLTYPE],
'nullable' : row.NULLS == 'Y',
'default' : None,
'autoincrement' : False,
})
cursor.close()
return columns
def get_primary_keys(self, connection, table_name, schema=None, **kw):
if schema is None:
schema = self.get_default_schema_name(connection)
cursor = connection.connection.cursor()
primary_keys = [row.COLNAME for row in cursor.execute(
"SELECT COLNAME FROM %s.SYSPKCONSTRAINTS WHERE NAME = '%s' ORDER BY PKCOLSEQNUM" % (schema, table_name)
)]
cursor.close()
return primary_keys
def get_foreign_keys(self, connection, table_name, schema=None, **kw):
return []
def get_indexes(self, connection, table_name, schema=None, **kw):
return []
class SQLBase7Dialect_SA06_pyodbc(SQLBase7Dialect_SA06, PyODBCConnector):
pass
dialect = SQLBase7Dialect_SA06_pyodbc

View file

@ -51,6 +51,5 @@ class ConnectionTestCase(TestCase):
class ReflectionTestCase(TestCase):
def runTest(self):
metadata = MetaData(bind=self.engine)
metadata.reflect(schema='SYSADM')
metadata = MetaData(bind=self.engine, reflect=True)
self.assert_(metadata.tables)