I have an "updated_at" attribute in a PostgreSQL t...
# exposed
a
I have an "updated_at" attribute in a PostgreSQL table updated by a trigger, so I just want to read this attribute but I want to ignore it when writing an entry via Exposed. One solution would be having two classes, one read model and one write model. However, is there a solution with Exposed to exclude a non-nullable field when it comes to inserting data?
t
You could define some default value if your trigger changes value just after insert.
a
Thanks for your answer, your suggestion is perfectly valid. However I opted for having two different models: ReadModel and WriteModel as for me it felt a bit strange writing a value to database and having it overwritten by trigger.