hey list -

im working on explicit CONSTRAINT objects, primarily a FOREIGN KEY  
constraint which cleanly allows composite foreign keys that work in a  
CREATE statement.  but while im adding "ForeignKeyConstraint", im  
also adding a distinct "PrimaryKeyConstraint" as well as  
"UniqueConstraint".

Thing is, we already have "unique" as an option on Column, which  
results in the creation of a UNIQUE INDEX clause after that of the  
Table itself.

The way this is going, it would be cleaner for Column(....,  
unique=True) to create a CONSTRAINT instead of an INDEX, i.e.:

        CREATE TABLE foo (
                col1 INTEGER PRIMARY KEY,
                col2 VARCHAR(20),
                UNIQUE (col2)
        )

as opposed to:

        CREATE TABLE foo (
                col1 INTEGER PRIMARY KEY,
                col2 VARCHAR(20),
        )
        CREATE UNIQUE INDEX uix_foo_col2 ON foo (col2)

its not immediately clear to me how these two things differ.  does  
anyone have any comments on this ?   does this make a huge difference  
for various DBs ?   while the explicit Index object would still be  
available, the "unique" keyword argument on column would result in  
the first syntax instead of the second one.  is anything going to  
break ?

- mike




-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to