diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-01-15 16:42:29 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2011-01-15 16:42:29 -0500 |
commit | dff5a404e489d5215da5aa30870b78aca8423de5 (patch) | |
tree | 39f6ae1949762d269f6a73e0315f0fa6910ceacd /lib/sqlalchemy/engine/reflection.py | |
parent | fc0ffac24155931c2db10d1a469e1f7898268e45 (diff) | |
download | sqlalchemy-dff5a404e489d5215da5aa30870b78aca8423de5.tar.gz |
- getting slightly more consistent behavior for the edge case of pk columns
with server default - autoincrement is now false with any server_default,
so these all return None, applies consistency to [ticket:2020], [ticket:2021].
if prefetch is desired a "default" should be used instead of server_default.
Diffstat (limited to 'lib/sqlalchemy/engine/reflection.py')
-rw-r--r-- | lib/sqlalchemy/engine/reflection.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/sqlalchemy/engine/reflection.py b/lib/sqlalchemy/engine/reflection.py index cf254cba6..00b2fd1bf 100644 --- a/lib/sqlalchemy/engine/reflection.py +++ b/lib/sqlalchemy/engine/reflection.py @@ -398,7 +398,11 @@ class Inspector(object): if col_d.get('default') is not None: # the "default" value is assumed to be a literal SQL expression, # so is wrapped in text() so that no quoting occurs on re-issuance. - colargs.append(sa_schema.DefaultClause(sql.text(col_d['default']))) + colargs.append( + sa_schema.DefaultClause( + sql.text(col_d['default']), _reflected=True + ) + ) if 'sequence' in col_d: # TODO: mssql, maxdb and sybase are using this. |