Column.unique not populated in reflected tables

Issue #3869 wontfix
Eloy Félix created an issue

checking Column.unique in a column with unique key is always None. Problem in all dialects.

fix in this commit: https://github.com/eloyfelix/sqlalchemy/commit/c44f884dee5fdb0f5efdddec92eac0473c864e6b

I already sent a pull request for oracle's get_unique_constraints: https://gerrit.sqlalchemy.org/#/c/260/

do I make another pull request? I'm new in collaborating in this kind of projects.

Comments (6)

  1. Mike Bayer repo owner

    get_unique_constraints is fine, I need to find time to push some pending gerrits w/ changelog and also figure out where to target this.

    for column.unique, both column.index and column.unique imply the creation of a simple Index or UniqueConstraint. However, an arbitrary Index or UniqueConstraint can have multiple columns or even expressions. How would these more complex objects translate to column.index / column.unique? for this reason, having these objects present on a Table does not imply any setting for column.index / column.unique and these flags are not intended for introspection purposes.

  2. Mike Bayer repo owner

    that OK? this would be wontfix :)

    you need oracle get_unique_constraints in a 1.1.x release? get_unique_constraints can be a surprise for some setups, but for oracle perhaps not as jarring. 1.2 would be safer but a 1.2 release is not until the spring / summer 2017.

  3. Log in to comment