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
We already sort of support createdAt through default value, but we need a concept of readonly fields to make it semantically correct.
type Todo {
...
createAt: Instant = now()
}
But here, API still allows specifying a new value. If we enable marking this field as readonly (or an equivalent syntax), this will make it sound.
For updatedAt, the same idea works as long as developers have defined a trigger. But we may want to support that more directly (by creating a trigger during schema generation).
Note that while the interceptor mechanism can also work, a trigger is a better solution in the environment where the database is accessed by clients other than an Exograph-based server.
The text was updated successfully, but these errors were encountered:
other attribute will be @after-insert , @before-update @after-update
We can have the function already in the DB or define it as a postgres modeul type (this will also cater to views ) with defined paratemeter and return types if any . Such trigger function can then be shared across the schema .
N.B i.sona from Discord
We already sort of support
createdAt
through default value, but we need a concept ofreadonly
fields to make it semantically correct.But here, API still allows specifying a new value. If we enable marking this field as
readonly
(or an equivalent syntax), this will make it sound.For
updatedAt
, the same idea works as long as developers have defined a trigger. But we may want to support that more directly (by creating a trigger during schema generation).Note that while the interceptor mechanism can also work, a trigger is a better solution in the environment where the database is accessed by clients other than an Exograph-based server.
The text was updated successfully, but these errors were encountered: