-
SQL allows defining unique constraint for a table on multiple columns. For example, with sqlite> CREATE TABLE person (
first_name varchar(255) NOT NULL,
last_name varchar(255) NOT NULL,
UNIQUE (first_name, last_name)
); However, there is no way to express this with the |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
It should be possible to do something like this let index = Index::create()
.name("idx-glyph-aspect")
.table(Glyph::Table)
.col(Glyph::Aspect)
.col(Glyph::Ratio)
.unique(); let me know if it works! |
Beta Was this translation helpful? Give feedback.
-
@tyt2y3 Thanks, that works! It would be nice to be able to specify the constraint without the index as well, though. |
Beta Was this translation helpful? Give feedback.
-
FYI unique constraint are implemented with a unique index. It is just a syntax sugar. |
Beta Was this translation helpful? Give feedback.
It should be possible to do something like this
let me know if it works!