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
Hello, i'm currently using drizzle, but must rely on native postgres-js for features not currently supported by drizzle (e.g. triggers/function, publications, subscriptions).
While this works kinda fine, an issue i frequently face is the lack of transformation with this raw postgres usage.
Let assume i have a users table with: lastName: text(last_name)
When fetching data via drizzle last_name would be aliased to lastName and i can access the property via value.lastName on the result.
the row properties will be unaliased and all the helper functions i built around the drizzle types will break.
Does drizzle somehow expose this transform / alias? I couldn't find anything on the docs.
I imagine a schema.transformToAliased(rawValue) to map from unaliased to aliased object properties would be quite helpful to workaround shortcomings on more complex db functionality not currently supported by drizzle.
The text was updated successfully, but these errors were encountered:
I want to use supabase realtime but the events from it send back the raw rows. It would be great if I could run them through some helper function from drizzle so the typings match.
Describe what you want
Hello, i'm currently using drizzle, but must rely on native
postgres-js
for features not currently supported by drizzle (e.g. triggers/function, publications, subscriptions).While this works kinda fine, an issue i frequently face is the lack of transformation with this raw postgres usage.
Let assume i have a users table with:
lastName: text(last_name)
When fetching data via drizzle
last_name
would be aliased tolastName
and i can access the property viavalue.lastName
on the result.When i do e.g. a subscription via raw postgres-js
the row properties will be unaliased and all the helper functions i built around the drizzle types will break.
Does drizzle somehow expose this transform / alias? I couldn't find anything on the docs.
I imagine a
schema.transformToAliased(rawValue)
to map from unaliased to aliased object properties would be quite helpful to workaround shortcomings on more complex db functionality not currently supported by drizzle.The text was updated successfully, but these errors were encountered: