]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
(no commit message)
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 24 Sep 2005 04:51:07 +0000 (04:51 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 24 Sep 2005 04:51:07 +0000 (04:51 +0000)
lib/sqlalchemy/schema.py
lib/sqlalchemy/sql.py
test/pool.py
test/query.py

index ce6dd8c6335b9d5a5e116b949f2e100df57c9ab1..8952f038be446e6d7898a4eb57aef7309bff774a 100644 (file)
@@ -204,7 +204,6 @@ class ForeignKey(SchemaItem):
             else:
                 self._column = self._colspec
 
-            print "setting up key " + self._column.key + " onto table " + self.parent.table.name
             self.parent.table.foreign_keys[self._column.key] = self
         return self._column
             
index 12666d72a6741c81071c856973604c204fd88a3d..56e26b5db64023b9459f04ffabba7031b32b18ca 100644 (file)
@@ -141,6 +141,7 @@ def _compound_select(keyword, *selects, **params):
 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."""
@@ -568,9 +569,13 @@ class TableImpl(Selectable):
     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
     
index 6de08412d530fd460d2921a072035d82c55f6422..c7613eb48ed11da75ee856a3fa13efd6aa59132e 100644 (file)
@@ -16,7 +16,7 @@ class PoolTest(PersistTest):
         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)
@@ -27,7 +27,7 @@ class PoolTest(PersistTest):
         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)
@@ -37,7 +37,7 @@ class PoolTest(PersistTest):
     
         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()
@@ -63,7 +63,8 @@ class PoolTest(PersistTest):
         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)
         
index b9f62b855f041938b46e0f2df9551989157ac3cf..47e56ee162758335e1170aa8e8f8a46bfc770ef8 100644 (file)
@@ -14,6 +14,7 @@ class QueryTest(PersistTest):
         self.users = Table('users', db,
             Column('user_id', INT, primary_key = True),
             Column('user_name', VARCHAR(20)),
+            redefine = True
         )
         self.users.create()