You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Postgres 12 supports generated columns. We should be able to support these.
The current ability to support is pretty limited. Per the Postgres docs,
A generated column cannot be written to directly. In INSERT or UPDATE commands, a value cannot be specified for a generated column, but the keyword DEFAULT may be specified.
So if we have a model definition like:
User
name Text
birthday Day
age Int GeneratedAsDifferenceFromAgeToBirthday Virtual
Then we would currently need to provide some dummy value to this field when performing writes/updates, like:
The inserting code would see that the column is generated and use DEFAULT instead of a value.
The design in #1037 makes this trivial - generated columns would be present on the full entity, while New entity would not have them, and (importantly) Partial entity would not either.
The text was updated successfully, but these errors were encountered:
Postgres 12 supports generated columns. We should be able to support these.
The current ability to support is pretty limited. Per the Postgres docs,
So if we have a model definition like:
Then we would currently need to provide some dummy value to this field when performing writes/updates, like:
The inserting code would see that the column is generated and use
DEFAULT
instead of a value.The design in #1037 makes this trivial - generated columns would be present on the full entity, while
New entity
would not have them, and (importantly)Partial entity
would not either.The text was updated successfully, but these errors were encountered: