]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add basic support of unique constraints reflection
authorRoman Podolyaka <roman.podolyaka@gmail.com>
Sun, 9 Jun 2013 16:07:00 +0000 (19:07 +0300)
committerRoman Podolyaka <roman.podolyaka@gmail.com>
Sun, 9 Jun 2013 20:49:55 +0000 (23:49 +0300)
commitc69fe4acf8929856735e5d90adb7f6b6d5ebcd46
treee193633bdf96f536d826122a1186d067dbc9890f
parentf65ddee93a7143924b417e1c988802f10d0c7b11
Add basic support of unique constraints reflection

Inspection API already supports reflection of table
indexes information and those also include unique
constraints (at least for PostgreSQL and MySQL).
But it could be actually useful to distinguish between
indexes and plain unique constraints (though both are
implemented in the same way internally in RDBMS).

This change adds a new method to Inspection API - get_unique_constraints()
and implements it for SQLite, PostgreSQL and MySQL dialects.
lib/sqlalchemy/dialects/mysql/base.py
lib/sqlalchemy/dialects/postgresql/base.py
lib/sqlalchemy/dialects/sqlite/base.py
lib/sqlalchemy/engine/interfaces.py
lib/sqlalchemy/engine/reflection.py
test/engine/test_reflection.py