Fixed the get_primary_keys() method so it returns column names instead of table names...sheesh.

This commit is contained in:
Lance Edgar 2010-04-19 17:34:15 -05:00
parent bf7822ca90
commit 810b27abe3

View file

@ -72,8 +72,8 @@ class SQLBase7Dialect(default.DefaultDialect):
def get_primary_keys(self, connection, table_name, schema=None, **kw): def get_primary_keys(self, connection, table_name, schema=None, **kw):
cursor = connection.connection.cursor() cursor = connection.connection.cursor()
primary_keys = [row.NAME for row in cursor.execute( primary_keys = [row.COLNAME for row in cursor.execute(
"SELECT NAME FROM SYSADM.SYSPKCONSTRAINTS WHERE NAME = '%s' ORDER BY PKCOLSEQNUM" % table_name "SELECT COLNAME FROM SYSADM.SYSPKCONSTRAINTS WHERE NAME = '%s' ORDER BY PKCOLSEQNUM" % table_name
)] )]
cursor.close() cursor.close()
return primary_keys return primary_keys