This PR implements regex-based uniqueness validation for the upsert plugin, replacing both the generated Index and the order field for multi-column upsert keys. We now simply check to make sure that the user has explicitly specified either a uniqueness or primary key constraint for exactly the set of columns annotated with @UpsertKey. This is safer because it doesn't require the user to remember to create the autogenerated index, and lets the constraint itself inform the index ordering rather than requiring the order field in the annotation. (The order of the criterion construction doesn't matter because the SQLite query optimizer can reorder terms in an AND clause to take advantage of indices).
This PR implements regex-based uniqueness validation for the upsert plugin, replacing both the generated Index and the
order
field for multi-column upsert keys. We now simply check to make sure that the user has explicitly specified either a uniqueness or primary key constraint for exactly the set of columns annotated with@UpsertKey
. This is safer because it doesn't require the user to remember to create the autogenerated index, and lets the constraint itself inform the index ordering rather than requiring theorder
field in the annotation. (The order of the criterion construction doesn't matter because the SQLite query optimizer can reorder terms in an AND clause to take advantage of indices).