-
assigned issue to
- changed milestone to 1.x.xx
- marked as enhancement
SQLite reflection does not preserve primary key constraint names
Issue #3629
resolved
Title says it all, I'm attaching a patch containing a test case for this.
Comments (4)
-
repo owner -
Here's a pull request for this issue: https://github.com/zzzeek/sqlalchemy/pull/230
-
repo owner - changed status to resolved
sqlite: reflect primary key constraint names, fixes
#3629→ <<cset b3b3c68a4a08>>
-
repo owner → <<cset 5370f0503ad7>>
- Log in to comment
this is known, the sqlite dialect has for years used "PRAGMA table_info" to reflect tables which does not support this information, only in very recent versions have we begun to use "SELECT sql FROM sqlite_master" and then parsing the SQL using regular expressions. A contributor would need to imitate the logic currently in sqlalchemy/dialects/sqlite/base.py -> get_foreign_keys() for the case of primary key constraint.
Feel free to propose a pull request to add this behavior thanks!