]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
factoring out mysql's rowid stuff since its down in the base engine class now
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 1 Jan 2006 21:17:34 +0000 (21:17 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 1 Jan 2006 21:17:34 +0000 (21:17 +0000)
lib/sqlalchemy/databases/mysql.py
lib/sqlalchemy/databases/sqlite.py
lib/sqlalchemy/engine.py

index 9f8bb8a1229d7684832ab9d9b59b647087de9c1c..4e43f36730e93a26c36813d7aeb02b1dc6eee716 100644 (file)
@@ -100,14 +100,6 @@ class MySQLEngine(ansisql.ANSISQLEngine):
     def last_inserted_ids(self):
         return self.context.last_inserted_ids
 
-    def rowid_column_name(self):
-        """returns the ROWID column name for this engine."""
-        
-        # well, for MySQL cant really count on this being there, surprise (not).
-        # so we do some silly hack down below in MySQLTableImpl to provide
-        # something for an OID column
-        return "_rowid"
-
     def supports_sane_rowcount(self):
         return False
 
@@ -153,17 +145,7 @@ class MySQLTableImpl(sql.TableImpl):
     """attached to a schema.Table to provide it with a Selectable interface
     as well as other functions
     """
-    def _rowid_col(self):
-        if getattr(self, '_mysql_rowid_column', None) is None:
-            if len(self.table.primary_key) > 0:
-                c = self.table.primary_key[0]
-            else:
-                c = self.table.columns[self.table.columns.keys()[0]]
-            self._mysql_rowid_column = schema.Column(c.name, c.type, hidden=True)
-            self._mysql_rowid_column._set_parent(self.table)
-
-        return self._mysql_rowid_column
-    rowid_column = property(lambda s: s._rowid_col())
+    pass
 
 class MySQLCompiler(ansisql.ANSICompiler):
     def limit_clause(self, select):
index 0288beae89e1abf51beefc3b2c62e0e4c643ac69..5a143a201c7fd0fe04311552b7f7786b15d29e03 100644 (file)
@@ -107,6 +107,9 @@ class SQLiteSQLEngine(ansisql.ANSISQLEngine):
     def last_inserted_ids(self):
         return self.context.last_inserted_ids
 
+    def rowid_column_name(self):
+        return "oid"
+
     def connect_args(self):
         return ([self.filename], self.opts)
 
index 68cf08931528252200e530c55688201779638b6d..07574a260ab9dd6845d66f95452537ced0d2fbad 100644 (file)
@@ -260,7 +260,7 @@ class SQLEngine(schema.SchemaEngine):
 
     def rowid_column_name(self):
         """returns the ROWID column name for this engine, or None if the engine cant/wont support OID/ROWID."""
-        return "oid"
+        return None
 
     def supports_sane_rowcount(self):
         """Provided to indicate when MySQL is being used, which does not have standard behavior