Skip to content

Commit 704144f

Browse files
committed
test(plpgsql-deparser): update snapshot with pretty-printed INSERT VALUES and ON CONFLICT
The snapshot now shows proper multi-line formatting for: - VALUES tuple items: each value on its own line - ON CONFLICT DO UPDATE SET: each assignment on its own line
1 parent 6428b87 commit 704144f

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

packages/plpgsql-deparser/__tests__/__snapshots__/hydrate-demo.test.ts.snap

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,33 @@ LIMIT 1;
139139
note,
140140
updated_at
141141
) VALUES
142-
(p_org_id, p_user_id, p_from_ts, p_to_ts, p_currency, v_orders_scanned, v_gross, v_discount, v_tax, v_net, v_avg, v_top_sku, v_top_sku_qty, p_note, now()) ON CONFLICT (org_id, user_id, period_from, period_to, currency) DO UPDATE SET orders_scanned = excluded.orders_scanned, gross_total = excluded.gross_total, discount_total = excluded.discount_total, tax_total = excluded.tax_total, net_total = excluded.net_total, avg_order_total = excluded.avg_order_total, top_sku = excluded.top_sku, top_sku_qty = excluded.top_sku_qty, note = COALESCE(excluded.note, app_public.order_rollup.note), updated_at = now();
142+
(
143+
p_org_id,
144+
p_user_id,
145+
p_from_ts,
146+
p_to_ts,
147+
p_currency,
148+
v_orders_scanned,
149+
v_gross,
150+
v_discount,
151+
v_tax,
152+
v_net,
153+
v_avg,
154+
v_top_sku,
155+
v_top_sku_qty,
156+
p_note,
157+
now()
158+
) ON CONFLICT (org_id, user_id, period_from, period_to, currency) DO UPDATE SET
159+
orders_scanned = excluded.orders_scanned,
160+
gross_total = excluded.gross_total,
161+
discount_total = excluded.discount_total,
162+
tax_total = excluded.tax_total,
163+
net_total = excluded.net_total,
164+
avg_order_total = excluded.avg_order_total,
165+
top_sku = excluded.top_sku,
166+
top_sku_qty = excluded.top_sku_qty,
167+
note = COALESCE(excluded.note, app_public.order_rollup.note),
168+
updated_at = now();
143169
GET DIAGNOSTICS v_rowcount = ;
144170
v_orders_upserted := v_rowcount;
145171
v_sql := format(

0 commit comments

Comments
 (0)