SQLite reflection does not preserve primary key constraint names

Issue #3629 resolved
Michal Petrucha created an issue

Title says it all, I'm attaching a patch containing a test case for this.

Comments (4)

  1. Mike Bayer repo owner

    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!

  2. Log in to comment