magic sql column naming
Ok, here's a doozy:
One of the things i like best about drizzle vs prisma is the fact that we can keep the standard naming conventions at the database level and still get the objects with cool camelCase properties. For example:
Yesterday, i was working on a custom query, so i decided to use the magical sql operator, provided by drizzle ORM.
The problem here is that the resulting objects i get come with the database column naming:
variant_id
, currency_code
...
Even if i try using AS
, the return doesn't keep the capitalize characters in the column name
still gives me back:
My questions are:
- Is there a way to make this work as expected?
- if not, why should i use the drizzle magic sql operator, instead of just a normal call through the postgres driver, which would allow me to just write pure SQL instead of having to use: ${Purchases.variantId}
?
TY1 Reply
same here