-
Is it possible to ignore a field when updating a row? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
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(),
); |
Beta Was this translation helpful? Give feedback.
-
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 ? |
Beta Was this translation helpful? Give feedback.
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: