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 have a section to show how to get the select columns for pg table but not views nor materialized view. If someone can add the example using the code above that would be awesome.
The text was updated successfully, but these errors were encountered:
For anyone looking for a way to infer a matview's select model, this is the way to go:
importtype{InferModelFromColumns}from'drizzle-orm';exporttypeMatViewSelectModel<MextendsPgMaterializedView<string,any,Record<string,PgColumn>>>=InferModelFromColumns<M['_']['selectedFields'],'select'>;// Usage:declareconstmatView: PgMaterializedView<string,any,Record<string,PgColumn>>;// <- this should be your matview object defined using `pgMaterializedView()`typeM=MatViewSelectModel<typeofmatView>;
For anyone looking for a way to infer a matview's select model, this is the way to go:
importtype{InferModelFromColumns}from'drizzle-orm';exporttypeMatViewSelectModel<MextendsPgMaterializedView<string,any,Record<string,PgColumn>>>=InferModelFromColumns<M['_']['selectedFields'],'select'>;// Usage:declareconstmatView: PgMaterializedView<string,any,Record<string,PgColumn>>;// <- this should be your matview object defined using `pgMaterializedView()`typeM=MatViewSelectModel<typeofmatView>;
Describe what you want
We have a section to show how to get the select columns for pg table but not views nor materialized view. If someone can add the example using the code above that would be awesome.
The text was updated successfully, but these errors were encountered: