the underlying database type as being Integer-based.
[ticket:2005]
+ - Established consistency when server_default is present
+ on an Integer PK column. SQLA doesn't pre-fetch these,
+ nor do they come back in cursor.lastrowid (DBAPI).
+ Ensured all backends consistently return None
+ in result.inserted_primary_key for these. Regarding
+ reflection for this case, reflection of an int PK col
+ with a server_default sets the "autoincrement" flag to False,
+ except in the case of a PG SERIAL col where we detected a
+ sequence default. [ticket:2020] [ticket:2021]
+
- Result-row processors are applied to pre-executed SQL
defaults, as well as cursor.lastrowid, when determining
the contents of result.inserted_primary_key.
'name' : name,
'type' : coltype,
'nullable' : not bool(row['null_flag']),
- 'default' : defvalue
+ 'default' : defvalue,
+ 'autoincrement':default is None
}
if orig_colname.lower() == orig_colname:
'type': coltype,
'nullable': nullable,
'default': default,
+ 'autoincrement':default is None
}
if orig_colname.lower() == orig_colname:
cdict['quote'] = True
'type' : coltype,
'nullable' : nullable,
'default' : default,
+ 'autoincrement':default is None,
'primary_key': primary_key
})
return columns
t.select().execute().fetchall(),
[(5, 'data')]
)
- @testing.fails_on('firebird', "col comes back as autoincrement")
- @testing.fails_on('sqlite', "col comes back as autoincrement")
- @testing.fails_on('oracle', "col comes back as autoincrement")
@testing.provide_metadata
def test_autoincrement_reflected_from_server_default(self):
t = Table('x', metadata,
t2 = Table('x', m2, autoload=True, implicit_returning=False)
assert t2._autoincrement_column is None
- @testing.fails_on('firebird', "attempts to insert None")
- @testing.fails_on('sqlite', "returns a value")
@testing.provide_metadata
def test_int_default_none_on_insert_reflected(self):
t = Table('x', metadata,