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
The drizzle-zod package is awesome, but using createSelectSchema assumes that the object keys are createdAt and updatedAt versus created_at and updated_at.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
How would I go about turning an object that uses the actual raw database columns as keys into a type-safe object?
This is coming up because I'm using Supabase Realtime and the response object I'm getting from the database has the actual raw column names as keys.
Example
I want to turn an object of type
Record<{ [key:string]: any}>
, like this one:into a type-safe object (as if I had used Drizzle to query it)
This is the underlying table definition:
The
drizzle-zod
package is awesome, but usingcreateSelectSchema
assumes that the object keys arecreatedAt
andupdatedAt
versuscreated_at
andupdated_at
.Beta Was this translation helpful? Give feedback.
All reactions