def _is_literal(element):
return not isinstance(element, ClauseElement) and not isinstance(element, schema.SchemaItem)
+
class ClauseVisitor(schema.SchemaVisitor):
"""builds upon SchemaVisitor to define the visiting of SQL statement elements in
addition to Schema elements."""
as well as other functions
"""
-# def _engine(self):
-# return self.table.engine
-
+ def __init__(self, table):
+ self.table = table
+ self.id = self.table.name
+
+ def get_from_text(self):
+ return self.table.name
+
def group_parenthesized(self):
return False
connection2 = manager.connect('foo.db')
connection3 = manager.connect('bar.db')
- print "connection " + repr(connection)
+ self.echo( "connection " + repr(connection))
self.assert_(connection.cursor() is not None)
self.assert_(connection is connection2)
self.assert_(connection2 is not connection3)
connection = manager.connect('foo.db')
connection2 = manager.connect('foo.db')
- print "connection " + repr(connection)
+ self.echo( "connection " + repr(connection))
self.assert_(connection.cursor() is not None)
self.assert_(connection is not connection2)
def status(pool):
tup = (pool.size(), pool.checkedin(), pool.overflow(), pool.checkedout())
- print "Pool size: %d Connections in pool: %d Current Overflow: %d Current Checked out connections: %d" % tup
+ self.echo( "Pool size: %d Connections in pool: %d Current Overflow: %d Current Checked out connections: %d" % tup)
return tup
c1 = p.connect()
self.assert_(status(p) == (3, 2, 0, 1))
def tearDown(self):
- for file in ('foo.db', 'bar.db'):
+ pool.clear_managers()
+ for file in ('foo.db', 'bar.db'):
if os.access(file, os.F_OK):
os.remove(file)
self.users = Table('users', db,
Column('user_id', INT, primary_key = True),
Column('user_name', VARCHAR(20)),
+ redefine = True
)
self.users.create()