diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-04-24 16:25:20 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2012-04-24 16:25:20 -0400 |
commit | 1fe06a551c28a6e0886f96334deebdee68d9fff9 (patch) | |
tree | 8ed3a735d220cc8a95d4067b331d64e01bc51d03 /lib/sqlalchemy/engine/base.py | |
parent | f69ccd193b5f1bfe4f2f50e93fe912ceac1af66e (diff) | |
parent | 3cbe90efbebd38c570a137d2801753e3aa55823b (diff) | |
download | sqlalchemy-1fe06a551c28a6e0886f96334deebdee68d9fff9.tar.gz |
- [feature] Inspector.get_primary_keys() is
deprecated; use Inspector.get_pk_constraint().
Courtesy Diana Clarke. [ticket:2422]
- restored default get_primary_keys()/get_pk_constraint() wrapper
to help maintain compatibility with third party dialects
created against 0.6 or 0.7
Diffstat (limited to 'lib/sqlalchemy/engine/base.py')
-rw-r--r-- | lib/sqlalchemy/engine/base.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py index 93d2b19f1..a2695e337 100644 --- a/lib/sqlalchemy/engine/base.py +++ b/lib/sqlalchemy/engine/base.py @@ -261,20 +261,23 @@ class Dialect(object): def get_primary_keys(self, connection, table_name, schema=None, **kw): """Return information about primary keys in `table_name`. - - Given a :class:`.Connection`, a string - `table_name`, and an optional string `schema`, return primary - key information as a list of column names. - + + + Deprecated. This method is only called by the default + implementation of :meth:`get_pk_constraint()`. Dialects should + instead implement this method directly. + """ + raise NotImplementedError() - def get_pk_constraint(self, table_name, schema=None, **kw): + def get_pk_constraint(self, connection, table_name, schema=None, **kw): """Return information about the primary key constraint on table_name`. - Given a string `table_name`, and an optional string `schema`, return - primary key information as a dictionary with these keys: + Given a :class:`.Connection`, a string + `table_name`, and an optional string `schema`, return primary + key information as a dictionary with these keys: constrained_columns a list of column names that make up the primary key |