Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Fix unique constraints reflection in SQLite #72

Merged
merged 1 commit into from Feb 16, 2014

Conversation

Projects
None yet
2 participants
Contributor

malor commented Feb 14, 2014

Reflection of unique constraints didn't work properly, if reserved
identifiers had been used as column names. In this case column names
would be put in double quotes (e.g. the name of column asc would be
returned as "asc").

This issue is only present in 0.8.4 and not in 0.9.x (looks like this had been fixed in 0.9.x but was not backported to 0.8.x).

The snippet to reproduce:

import sqlalchemy as sa


eng = sa.create_engine('sqlite://')
meta = sa.MetaData(bind=eng)

table = sa.Table(
    'testtbl', meta,
    sa.Column('id', sa.Integer, primary_key=True),
    sa.Column('asc', sa.Integer),
    sa.Column('key', sa.Integer),
    sa.UniqueConstraint('asc', 'key', name='uniq_asc_key')
)
table.create()


inspector = sa.inspect(eng)
print inspector.get_unique_constraints('testtbl')
Fix unique constraints reflection in SQLite
Reflection of unique constraints didn't work properly, if reserved
identifiers had been used as column names. In this case column names
would be put in double quotes (e.g. the name of column asc would be
returned as "asc").

This issue is only present in 0.8.4 and not in 0.9.x.

@zzzeek zzzeek merged commit a7e0d3e into zzzeek:rel_0_8 Feb 16, 2014

Owner

zzzeek commented Feb 16, 2014

seems like you had sent me that change later and I didn't backport it to 0.8.

Contributor

malor commented Feb 17, 2014

Seems so, sorry :(

@malor malor deleted the malor:fix_sqlite_uc_reflection branch Feb 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment