Columns that not allowed to updated

Hi guys, I'm looking for a proper way to declare SQL schema and its InferModel types when there're columns that are not allowed to update programmatically.

Will there be sth like uuid().const() or text().static(),... for that type of columns? and then InferModel will only accept updatable column.

I'm new to SQL and drizzleORM, below is my current implementation.
eg: one of that type of column is updated_at on attached image 1.
I have a trigger & function to auto-update the updated_at column (img 2) that execute with the migrate script.

For now, Im using Omit to InferModel to remove those columns from the update & insert types. Its quite inefficient if there are many such columns tho.
Screenshot_2023-07-14_075205.png
db_trigger_func.png
Was this page helpful?