|
Is it possible to ignore a field when updating a row? |
Answered by
North101
Jul 21, 2021
Replies: 2 comments 5 replies
|
Use a Companion. One is generated for each table. TodosCompanion(
category: Value(target.id),
);You need to wrap each value in TodosCompanion(
category: Value.absent(),
); |
0 replies
Answer selected by
lsaudon
|
If category is not set as nullable it gets the "required" annotation. When updating the column using the companion object and setting category to Value.absent() I get an error saying category is required. But I just want to set the category once and never update it. How do I go about doing that ? |
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Use a Companion. One is generated for each table.
You need to wrap each value in
Value(<value>)and if you don't want to update the value (or use the default for inserts) either don't include the field or do: