summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/firebird/base.py
diff options
context:
space:
mode:
authorDiana Clarke <diana.joan.clarke@gmail.com>2012-04-02 21:07:37 -0400
committerDiana Clarke <diana.joan.clarke@gmail.com>2012-04-02 21:07:37 -0400
commit3cbe90efbebd38c570a137d2801753e3aa55823b (patch)
treeffdde3e783fc511d9f71c24afa69038b9177413d /lib/sqlalchemy/dialects/firebird/base.py
parent47a799ecd5d03b78e5d67918302c0da2950d27b8 (diff)
downloadsqlalchemy-3cbe90efbebd38c570a137d2801753e3aa55823b.tar.gz
deprecate inspector.get_primary_keys() in favor of inspector.get_pk_constraint()
- see #2422
Diffstat (limited to 'lib/sqlalchemy/dialects/firebird/base.py')
-rw-r--r--lib/sqlalchemy/dialects/firebird/base.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/sqlalchemy/dialects/firebird/base.py b/lib/sqlalchemy/dialects/firebird/base.py
index 5ef30b36d..a0e48da2c 100644
--- a/lib/sqlalchemy/dialects/firebird/base.py
+++ b/lib/sqlalchemy/dialects/firebird/base.py
@@ -474,7 +474,7 @@ class FBDialect(default.DefaultDialect):
return None
@reflection.cache
- def get_primary_keys(self, connection, table_name, schema=None, **kw):
+ def get_pk_constraint(self, connection, table_name, schema=None, **kw):
# Query to extract the PK/FK constrained fields of the given table
keyqry = """
SELECT se.rdb$field_name AS fname
@@ -486,7 +486,7 @@ class FBDialect(default.DefaultDialect):
# get primary key fields
c = connection.execute(keyqry, ["PRIMARY KEY", tablename])
pkfields = [self.normalize_name(r['fname']) for r in c.fetchall()]
- return pkfields
+ return {'constrained_columns':pkfields, 'name':None}
@reflection.cache
def get_column_sequence(self, connection,
@@ -541,7 +541,8 @@ class FBDialect(default.DefaultDialect):
ORDER BY r.rdb$field_position
"""
# get the PK, used to determine the eventual associated sequence
- pkey_cols = self.get_primary_keys(connection, table_name)
+ pk_constraint = self.get_pk_constraint(connection, table_name)
+ pkey_cols = pk_constraint['constrained_columns']
tablename = self.denormalize_name(table_name)
# get all of the fields for this table