How to use JSON_TABLE with drizzle?

I'm trying to use JSON_TABLE that was added to Postgres 17, but I can't figure out who to make drizzle work with it.
1 Reply
MAST
MASTOP5mo ago
OK, I hacked it in like this:
.innerJoin(
sql`json_table(data, '$[*]' columns
(
col_id uuid path '$.revision_group_id',
quantity numeric path '$.quantity'
)) as jt`,
sql`true`,
)
.innerJoin(
sql`json_table(data, '$[*]' columns
(
col_id uuid path '$.revision_group_id',
quantity numeric path '$.quantity'
)) as jt`,
sql`true`,
)

Did you find this page helpful?