valderman / selda

A type-safe, high-level SQL library for Haskell
https://selda.link
MIT License
478 stars 58 forks source link

Allow multiple primary keys #111

Closed tomberek closed 5 years ago

tomberek commented 5 years ago

Would something like this fix #25 ?

valderman commented 5 years ago

Pretty much, yes. The only thing left to do here is to extend the TableInfo type (defined in Database.Selda.Backend.Internal) with a tablePkGroups or similar, and make sure the validation and migration machinery takes it into account. It's probably a good idea to get rid of the colIsPK field from ColInfo as well (and perhaps colIsUnique while we're at it).

The one fiddly thing about it is to implement support in the backends (getTableInfo), but the code will probably be very similar to that for getting the unique groups, for both backends.

valderman commented 5 years ago

Closing this since #113 was merged.