LeftJoin results in lost camelcase for joined table? #1040
Replies: 2 comments
-
To solve this issue I used an alias. export const productSnapshotTable = pgTable("product_snapshot", ...
export const productSnapshot = alias(productSnapshotTable, "productSnapshot"); That should get you the correct naming in your return json. I use this method to remove my table name prefixes i.e. mydb_product, mydb_product_snapshot, etc. There is a secondary issue if you use this method. Drizzle insert, update, and delete do not currently support "alias". So for insert, update, and delete you would have to use productSnapshotTable not the alias name. |
Beta Was this translation helpful? Give feedback.
-
same problem, may be a bug ? |
Beta Was this translation helpful? Give feedback.
-
Hello, I am wondering if this is expected behavior. When I do a left join, my tables are losing their camelcase. Here's what it looks like below:
Query
Here are my table definitions:
Beta Was this translation helpful? Give feedback.
All reactions