-
Is it possible to declare a constant column in a table ? (like constant int of value 0 let's say) That way, I would be able to set that column as the primary key (unique) of the table and enforce a single row table. Something like: IntColumn get unique => integer().constant(0)(); // ?
@override
Set<Column> get primaryKey => {unique}; |
Beta Was this translation helpful? Give feedback.
Answered by
simolus3
Oct 29, 2024
Replies: 1 comment
-
That's not possible, but you can set a default and a check which effectively does the same thing: IntColumn get unique => integer().withDefault(const Constant(0)).check(unique.equals(0))();
@override
Set<Column> get primaryKey => {unique}; |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
gruvw
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
That's not possible, but you can set a default and a check which effectively does the same thing: