[HELP]: I'm trying to re-create a CTE-insert in drizzle, having some difficulties

with cart_products as (
  select * from cart_product where cart_id = ${cartId}
)
insert into order_product (order_id, cart_product_id)
select ${orderId}, id from cart_products
returning 
   id,
   order_id as "orderId",
   cart_product_id as "cartProductId";


How does the query above translate to drizzle?

I think more examples that translates to the above would be awesome in the docs, I've been fighting a bit with the API. I know from the start how to do it on sql, but sometimes it gets really hard translating to drizzle.

I feel this could be solved with more examples, maybe?
Was this page helpful?