- attached clean_mssql_test.py
MS-SQL reflection does not pick up primary key
Issue #317
resolved
Setup
- SQLAlchemy 0.2.8 (tried trunk as well with same result)
- MS SQL Server 2005 Express
- pymssql
I have two simple tables which are defined in the database already:
property(pk=PropertyID)
deal(pk=DealID, fk=property.c.PropertyID)
I am using reflection to build OR and would expect mapper to pick up PK, but instead I get the following error:
sqlalchemy.exceptions.ArgumentError: Could not assemble any primary key columns
for mapped table 'property'
Comments (8)
-
Account Deleted -
repo owner - changed component to mssql
-
repo owner - assigned issue to
-
Account Deleted - attached property.sql
DDL for property
-
Account Deleted - attached deal.sql
DDL for deal (exported from SQL Server)
-
Account Deleted - attached workaround_mssql_test.py
Workaround by using explicit override in class definition
-
Account Deleted - changed status to resolved
(original author: ram) Fixed in r
#1913Note that you'll need to modify your program slightly to work -- the table names in the DDL are spelled 'Property' and 'Deal', while your program refers to them as 'property' and 'deal' -- MS-SQL is case-sensitive, so you'll need to change lines 8 & 9 in your testcase to match the DB table names.
-
repo owner the changeset is changeset:1913
- Log in to comment
Model code causing the error