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
Is your feature request related to a problem? Please describe.
To keep data layer logic centralized, it would be nice to be able to specify check constraints on fields.
The productMeta would be some sort of construct to access the underlying column names to be able to construct the constraint according to the naming strategy. There are a few ways this could go down, not sure what would be most idiomatic.
Describe alternatives you've considered
They could be manually added to migrations
Handle these at the API layer
Additional context
N/A
The text was updated successfully, but these errors were encountered:
Check constraints can also be added to a table directly. This is actually how TypeORM did implement them. The resulting SQL from that usually looks something like this:
This should be fairly easy to implement as a @Check annotation to the @Entity. We could basically allow the developer to write any SQL check expression, and then diff on the expression for migrations. This would also be the most flexible approach. For instance:
Is your feature request related to a problem? Please describe.
To keep data layer logic centralized, it would be nice to be able to specify check constraints on fields.
Describe the solution you'd like
The sql generated should be something like:
The
productMeta
would be some sort of construct to access the underlying column names to be able to construct the constraint according to the naming strategy. There are a few ways this could go down, not sure what would be most idiomatic.Describe alternatives you've considered
Additional context
N/A
The text was updated successfully, but these errors were encountered: