eudoxia0 / crane

An ORM for Common Lisp.
http://eudoxia.me/crane/
201 stars 19 forks source link

Request: Multi-column constraints #40

Open wnortje opened 9 years ago

wnortje commented 9 years ago

Please add support for multi-column constraints such as

CONSTRAINT "constraint_name" UNIQUE ("col1" , "col2", "col3")
eudoxia0 commented 8 years ago

What is the advantage of this over the present system, aside from terseness?

wnortje commented 8 years ago

The constraint means the combination of the named columns must be unique. I.e. in each of the named columns there may be non-unique entries as long as the combination remains unique.

With the present system you can only specify the unique constraint on a single column at a time, which will not allow any duplicates in any of the named columns.

eudoxia0 commented 8 years ago

I've thought about this.

I think the deftable form should have an extra section :constraints for specifying multi-column UNIQUE constraints and possibly other extensions.