summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2007-01-24 03:21:26 +0000
committerMike Bayer <mike_mp@zzzcomputing.com>2007-01-24 03:21:26 +0000
commitc4199178cac96fb8f4d899d6cc5866444e92d189 (patch)
tree009ed92f74ac8ed59441a72e7d05ccbde54091c2 /lib/sqlalchemy/engine
parent4e9aaff50ff679fc51c4d799b000c2fcfc70a999 (diff)
downloadsqlalchemy-c4199178cac96fb8f4d899d6cc5866444e92d189.tar.gz
oracle can conditionally decide if it wants to say "use rowid" in a select statement.
needs to be tweaked vs. when ROW NUMBER OVER ORDER BY is being used, but currently fixes [ticket:436]
Diffstat (limited to 'lib/sqlalchemy/engine')
-rw-r--r--lib/sqlalchemy/engine/base.py9
-rw-r--r--lib/sqlalchemy/engine/default.py2
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py
index 77ab866c7..c7b5d93fe 100644
--- a/lib/sqlalchemy/engine/base.py
+++ b/lib/sqlalchemy/engine/base.py
@@ -52,8 +52,13 @@ class Dialect(sql.AbstractDialect):
which comes from the types module. Subclasses will usually use the adapt_type()
method in the types module to make this job easy."""
raise NotImplementedError()
- def oid_column_name(self):
- """returns the oid column name for this dialect, or None if the dialect cant/wont support OID/ROWID."""
+ def oid_column_name(self, column):
+ """return the oid column name for this dialect, or None if the dialect cant/wont support OID/ROWID.
+
+ the Column instance which represents OID for the query being compiled is passed, so that the dialect
+ can inspect the column and its parent selectable to determine if OID/ROWID is not selected for a particular
+ selectable (i.e. oracle doesnt support ROWID for UNION, GROUP BY, DISTINCT, etc.)
+ """
raise NotImplementedError()
def supports_sane_rowcount(self):
"""Provided to indicate when MySQL is being used, which does not have standard behavior
diff --git a/lib/sqlalchemy/engine/default.py b/lib/sqlalchemy/engine/default.py
index 94c01f324..06409377c 100644
--- a/lib/sqlalchemy/engine/default.py
+++ b/lib/sqlalchemy/engine/default.py
@@ -41,7 +41,7 @@ class DefaultDialect(base.Dialect):
if type(typeobj) is type:
typeobj = typeobj()
return typeobj
- def oid_column_name(self):
+ def oid_column_name(self, column):
return None
def supports_sane_rowcount(self):
return True