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";
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";