This is a patch to provide direct support for UNIQUE
table constraints by marking each column in the
constraint with uniqueKey=True. I stole the idea from
hibernate (actually in hibernate you specify a
constraint name, so you can have multiple unique
constraints per table; this is just a first pass at the
idea and a RFC).
baz = StringCol(uniqueKey=True)
quux = StringCol(uniqueKey=True)
CREATE TABLE foo (
id INTEGER PRIMARY KEY,
Right now you can get the same practical effect with a
unique index, but this provides direct semantic (or is
it syntactic? I get them confused) support for unique
table constraints, and lets the database decide how it
will enforce the constraint.
I think all the supported DBs support UNIQUE table
constraints, I haven't checked yet. I'll try to come
up with some test cases later.