Skip to content

Constant value column / Single row table #3315

Answered by simolus3
gruvw asked this question in Q&A
Discussion options

You must be logged in to vote

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};

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gruvw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants