summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/schema.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2011-01-11 15:22:46 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2011-01-11 15:22:46 -0500
commit67e0f356b2093fdc03303d50be1f89e75e847c7f (patch)
treee2209edb3a8aeb16702bc47573b9809a8e521db5 /lib/sqlalchemy/schema.py
parent0342a4886f00b34cf02e0d2d986a0896ba946788 (diff)
downloadsqlalchemy-67e0f356b2093fdc03303d50be1f89e75e847c7f.tar.gz
- A TypeDecorator of Integer can be used with a primary key
column, and the "autoincrement" feature of various dialects as well as the "sqlite_autoincrement" flag will honor the underlying database type as being Integer-based. [ticket:2005] - Result-row processors are applied to pre-executed SQL defaults, as well as cursor.lastrowid, when determining the contents of result.inserted_primary_key. [ticket:2006] - Bind parameters present in the "columns clause" of a select are now auto-labeled like other "anonymous" clauses, which among other things allows their "type" to be meaningful when the row is fetched, as in result row processors. - TypeDecorator is present in the "sqlalchemy" import space.
Diffstat (limited to 'lib/sqlalchemy/schema.py')
-rw-r--r--lib/sqlalchemy/schema.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/sqlalchemy/schema.py b/lib/sqlalchemy/schema.py
index f4b214061..a81874500 100644
--- a/lib/sqlalchemy/schema.py
+++ b/lib/sqlalchemy/schema.py
@@ -323,9 +323,10 @@ class Table(SchemaItem, expression.TableClause):
def _autoincrement_column(self):
for col in self.primary_key:
if col.autoincrement and \
- isinstance(col.type, types.Integer) and \
+ issubclass(col.type._type_affinity, types.Integer) and \
not col.foreign_keys and \
- isinstance(col.default, (type(None), Sequence)):
+ isinstance(col.default, (type(None), Sequence)) and \
+ col.server_default is None:
return col
@@ -544,7 +545,7 @@ class Column(SchemaItem, expression.ColumnClause):
The setting *only* has an effect for columns which are:
- * Integer derived (i.e. INT, SMALLINT, BIGINT)
+ * Integer derived (i.e. INT, SMALLINT, BIGINT).
* Part of the primary key