gemi 0.203.0 → 0.204.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ai/Agent.d.ts +20 -1
- package/dist/ai/Agent.d.ts.map +1 -1
- package/dist/ai/AgentProvider.d.ts +5 -0
- package/dist/ai/AgentProvider.d.ts.map +1 -1
- package/dist/ai/index.d.ts +1 -1
- package/dist/ai/index.d.ts.map +1 -1
- package/dist/ai/index.js +52 -55
- package/dist/ai/index.js.map +3 -13
- package/dist/ai/providers/request.d.ts +1 -0
- package/dist/ai/providers/request.d.ts.map +1 -1
- package/dist/ai/testing/Fingerprints.d.ts +106 -0
- package/dist/ai/testing/Fingerprints.d.ts.map +1 -0
- package/dist/ai/testing/RecordingProvider.d.ts +258 -0
- package/dist/ai/testing/RecordingProvider.d.ts.map +1 -0
- package/dist/ai/testing/index.d.ts +4 -0
- package/dist/ai/testing/index.d.ts.map +1 -0
- package/dist/ai/testing/index.js +6 -0
- package/dist/ai/testing/index.js.map +12 -0
- package/dist/ai/testing/pinClock.d.ts +19 -0
- package/dist/ai/testing/pinClock.d.ts.map +1 -0
- package/dist/app/index.js +2 -2
- package/dist/app/index.js.map +1 -1
- package/dist/bun/plugin.js +2 -2
- package/dist/bun/plugin.js.map +1 -1
- package/dist/bun/preload.js +2 -2
- package/dist/bun/preload.js.map +1 -1
- package/dist/{chunk-dj9nspcw.js → chunk-0hfzzb3k.js} +3 -3
- package/dist/{chunk-dj9nspcw.js.map → chunk-0hfzzb3k.js.map} +1 -1
- package/dist/chunk-0pgk811s.js +4 -0
- package/dist/{chunk-3e19n0f2.js.map → chunk-0pgk811s.js.map} +2 -2
- package/dist/{chunk-2fbsd1b0.js → chunk-0shq2d31.js} +2 -2
- package/dist/{chunk-2fbsd1b0.js.map → chunk-0shq2d31.js.map} +1 -1
- package/dist/{chunk-wfwpjx25.js → chunk-0t1d9s34.js} +3 -3
- package/dist/{chunk-wfwpjx25.js.map → chunk-0t1d9s34.js.map} +1 -1
- package/dist/{chunk-gz2ekvd6.js → chunk-13vtn7h9.js} +2 -2
- package/dist/{chunk-gz2ekvd6.js.map → chunk-13vtn7h9.js.map} +2 -2
- package/dist/{chunk-hergje99.js → chunk-1e82gfk9.js} +3 -3
- package/dist/{chunk-hergje99.js.map → chunk-1e82gfk9.js.map} +1 -1
- package/dist/{chunk-95re1b2y.js → chunk-1kehwa3s.js} +1 -1
- package/dist/chunk-1x60thpm.js +8 -0
- package/dist/chunk-1x60thpm.js.map +19 -0
- package/dist/{chunk-px2a83jv.js → chunk-2ngdhbz7.js} +2 -2
- package/dist/{chunk-px2a83jv.js.map → chunk-2ngdhbz7.js.map} +1 -1
- package/dist/{chunk-5dhp90cx.js → chunk-2t1eyzvq.js} +2 -2
- package/dist/{chunk-5dhp90cx.js.map → chunk-2t1eyzvq.js.map} +1 -1
- package/dist/{chunk-ggmznkqs.js → chunk-39hed4yr.js} +3 -3
- package/dist/{chunk-ggmznkqs.js.map → chunk-39hed4yr.js.map} +1 -1
- package/dist/{chunk-tgbj942e.js → chunk-3gkxnfef.js} +3 -3
- package/dist/{chunk-tgbj942e.js.map → chunk-3gkxnfef.js.map} +1 -1
- package/dist/{chunk-k3m1wr1c.js → chunk-3xzhbkya.js} +3 -3
- package/dist/{chunk-k3m1wr1c.js.map → chunk-3xzhbkya.js.map} +1 -1
- package/dist/chunk-418n4s1m.js +6 -0
- package/dist/{chunk-z97tptd1.js.map → chunk-418n4s1m.js.map} +2 -2
- package/dist/{chunk-95cs3r49.js → chunk-4c0rb2ng.js} +2 -2
- package/dist/{chunk-95cs3r49.js.map → chunk-4c0rb2ng.js.map} +1 -1
- package/dist/chunk-4ex4s616.js +4 -0
- package/dist/{chunk-tkskgvhc.js.map → chunk-4ex4s616.js.map} +2 -2
- package/dist/{chunk-n5g9a48h.js → chunk-4m8t67px.js} +2 -2
- package/dist/{chunk-n5g9a48h.js.map → chunk-4m8t67px.js.map} +1 -1
- package/dist/{chunk-1hpedme7.js → chunk-4v5c4mes.js} +2 -2
- package/dist/{chunk-1hpedme7.js.map → chunk-4v5c4mes.js.map} +1 -1
- package/dist/{chunk-g5j5hx6a.js → chunk-5gvc03cv.js} +3 -3
- package/dist/{chunk-g5j5hx6a.js.map → chunk-5gvc03cv.js.map} +1 -1
- package/dist/{chunk-r842yxd9.js → chunk-5km0np8s.js} +2 -2
- package/dist/{chunk-r842yxd9.js.map → chunk-5km0np8s.js.map} +1 -1
- package/dist/{chunk-m3xvm2va.js → chunk-6bfj0mbp.js} +3 -3
- package/dist/{chunk-m3xvm2va.js.map → chunk-6bfj0mbp.js.map} +1 -1
- package/dist/chunk-6g1xac70.js +7 -0
- package/dist/chunk-6g1xac70.js.map +10 -0
- package/dist/{chunk-kmpxda7j.js → chunk-6w6q9mxe.js} +3 -3
- package/dist/{chunk-kmpxda7j.js.map → chunk-6w6q9mxe.js.map} +2 -2
- package/dist/{chunk-dyb649h3.js → chunk-77x9vxht.js} +3 -3
- package/dist/{chunk-dyb649h3.js.map → chunk-77x9vxht.js.map} +1 -1
- package/dist/{chunk-5q2tt76t.js → chunk-7gxmf9rg.js} +2 -2
- package/dist/{chunk-5q2tt76t.js.map → chunk-7gxmf9rg.js.map} +1 -1
- package/dist/{chunk-vyp7d7xz.js → chunk-8jfnn7v6.js} +2 -2
- package/dist/{chunk-vyp7d7xz.js.map → chunk-8jfnn7v6.js.map} +1 -1
- package/dist/{chunk-zvhks9s7.js → chunk-8pw4zjnx.js} +1 -1
- package/dist/{chunk-9q5xhb64.js → chunk-9bjggtdt.js} +2 -2
- package/dist/{chunk-9q5xhb64.js.map → chunk-9bjggtdt.js.map} +1 -1
- package/dist/{chunk-rwe4bgt3.js → chunk-9hqnecjt.js} +2 -2
- package/dist/{chunk-rwe4bgt3.js.map → chunk-9hqnecjt.js.map} +1 -1
- package/dist/{chunk-s0z61m9j.js → chunk-9m7c4mws.js} +2 -2
- package/dist/{chunk-s0z61m9j.js.map → chunk-9m7c4mws.js.map} +1 -1
- package/dist/{chunk-r02em4jv.js → chunk-b1mdan5a.js} +2 -2
- package/dist/{chunk-r02em4jv.js.map → chunk-b1mdan5a.js.map} +1 -1
- package/dist/{chunk-7txst143.js → chunk-bq4pgzcd.js} +2 -2
- package/dist/{chunk-7txst143.js.map → chunk-bq4pgzcd.js.map} +1 -1
- package/dist/chunk-c7nbzryd.js +9 -0
- package/dist/chunk-c7nbzryd.js.map +10 -0
- package/dist/{chunk-pp34d463.js → chunk-cdgnwzwf.js} +2 -2
- package/dist/{chunk-pp34d463.js.map → chunk-cdgnwzwf.js.map} +1 -1
- package/dist/chunk-cf7xc02m.js +5 -0
- package/dist/{chunk-9mhr0kwd.js.map → chunk-cf7xc02m.js.map} +1 -1
- package/dist/{chunk-2nw8rf5y.js → chunk-cq7hk8v9.js} +2 -2
- package/dist/{chunk-2nw8rf5y.js.map → chunk-cq7hk8v9.js.map} +1 -1
- package/dist/{chunk-8m9kgynj.js → chunk-crqbzfd5.js} +2 -2
- package/dist/{chunk-8m9kgynj.js.map → chunk-crqbzfd5.js.map} +1 -1
- package/dist/{chunk-vee6v6qf.js → chunk-d3k38gk1.js} +3 -3
- package/dist/{chunk-vee6v6qf.js.map → chunk-d3k38gk1.js.map} +1 -1
- package/dist/{chunk-41fqkygr.js → chunk-d5d3a8bm.js} +3 -3
- package/dist/{chunk-41fqkygr.js.map → chunk-d5d3a8bm.js.map} +1 -1
- package/dist/chunk-d7kknkmq.js +13 -0
- package/dist/{chunk-4fw84bh6.js.map → chunk-d7kknkmq.js.map} +3 -4
- package/dist/{chunk-ke7d7j2y.js → chunk-dk1xxtgk.js} +2 -2
- package/dist/{chunk-ke7d7j2y.js.map → chunk-dk1xxtgk.js.map} +1 -1
- package/dist/{chunk-nqg7hdy8.js → chunk-e3ehv27z.js} +3 -3
- package/dist/{chunk-nqg7hdy8.js.map → chunk-e3ehv27z.js.map} +1 -1
- package/dist/{chunk-se58ty45.js → chunk-e5mqjren.js} +4 -4
- package/dist/{chunk-se58ty45.js.map → chunk-e5mqjren.js.map} +2 -2
- package/dist/{chunk-t91x2k88.js → chunk-efnerp0c.js} +2 -2
- package/dist/{chunk-t91x2k88.js.map → chunk-efnerp0c.js.map} +1 -1
- package/dist/{chunk-ys4q1jg2.js → chunk-ek0dvbck.js} +3 -3
- package/dist/{chunk-ys4q1jg2.js.map → chunk-ek0dvbck.js.map} +1 -1
- package/dist/{chunk-a4twd6qh.js → chunk-ezvtkbp9.js} +2 -2
- package/dist/{chunk-a4twd6qh.js.map → chunk-ezvtkbp9.js.map} +1 -1
- package/dist/{chunk-h19qtrg9.js → chunk-f52maa9b.js} +2 -2
- package/dist/{chunk-h19qtrg9.js.map → chunk-f52maa9b.js.map} +1 -1
- package/dist/{chunk-nfbf388w.js → chunk-f9c8bnzx.js} +3 -3
- package/dist/{chunk-nfbf388w.js.map → chunk-f9c8bnzx.js.map} +2 -2
- package/dist/{chunk-bwg7genv.js → chunk-fq5b1k4n.js} +2 -2
- package/dist/{chunk-bwg7genv.js.map → chunk-fq5b1k4n.js.map} +1 -1
- package/dist/{chunk-dvw8cr6n.js → chunk-gc9g7c4p.js} +3 -3
- package/dist/{chunk-dvw8cr6n.js.map → chunk-gc9g7c4p.js.map} +1 -1
- package/dist/{chunk-sq5ytcpd.js → chunk-jeq8wvj6.js} +2 -2
- package/dist/{chunk-sq5ytcpd.js.map → chunk-jeq8wvj6.js.map} +1 -1
- package/dist/{chunk-vw57atx4.js → chunk-jma5d7zd.js} +3 -3
- package/dist/{chunk-vw57atx4.js.map → chunk-jma5d7zd.js.map} +1 -1
- package/dist/{chunk-nsxw6v2b.js → chunk-jmsfkzav.js} +2 -2
- package/dist/{chunk-nsxw6v2b.js.map → chunk-jmsfkzav.js.map} +1 -1
- package/dist/chunk-js9rm7g0.js +4 -0
- package/dist/{chunk-02s440vh.js.map → chunk-js9rm7g0.js.map} +2 -2
- package/dist/{chunk-6t9n4qdm.js → chunk-k1gt7fgy.js} +3 -3
- package/dist/{chunk-6t9n4qdm.js.map → chunk-k1gt7fgy.js.map} +1 -1
- package/dist/{chunk-cbmne0wt.js → chunk-k62338g2.js} +2 -2
- package/dist/{chunk-cbmne0wt.js.map → chunk-k62338g2.js.map} +1 -1
- package/dist/{chunk-05k9201j.js → chunk-k9882kqg.js} +2 -2
- package/dist/{chunk-05k9201j.js.map → chunk-k9882kqg.js.map} +1 -1
- package/dist/chunk-ks6dczvn.js +24 -0
- package/dist/{chunk-70qqpvd9.js.map → chunk-ks6dczvn.js.map} +2 -2
- package/dist/{chunk-bzaespn5.js → chunk-n26atakz.js} +3 -3
- package/dist/{chunk-bzaespn5.js.map → chunk-n26atakz.js.map} +1 -1
- package/dist/{chunk-vbdy4k14.js → chunk-n3kg99yw.js} +3 -3
- package/dist/{chunk-vbdy4k14.js.map → chunk-n3kg99yw.js.map} +1 -1
- package/dist/{chunk-c6v3sjvh.js → chunk-n5k42dh7.js} +3 -3
- package/dist/{chunk-c6v3sjvh.js.map → chunk-n5k42dh7.js.map} +1 -1
- package/dist/chunk-p2nqksdq.js +10 -0
- package/dist/{chunk-ht5mq6ev.js.map → chunk-p2nqksdq.js.map} +2 -2
- package/dist/{chunk-mvd4mc8p.js → chunk-p9pwskv6.js} +2 -2
- package/dist/{chunk-mvd4mc8p.js.map → chunk-p9pwskv6.js.map} +1 -1
- package/dist/{chunk-14dtbk7d.js → chunk-phvvxv1a.js} +3 -3
- package/dist/{chunk-14dtbk7d.js.map → chunk-phvvxv1a.js.map} +1 -1
- package/dist/chunk-pq15dt8j.js +46 -0
- package/dist/chunk-pq15dt8j.js.map +27 -0
- package/dist/{chunk-q05648ac.js → chunk-ptpzh61m.js} +3 -3
- package/dist/{chunk-q05648ac.js.map → chunk-ptpzh61m.js.map} +1 -1
- package/dist/{chunk-nkasdjx2.js → chunk-qcrj4t72.js} +3 -3
- package/dist/{chunk-nkasdjx2.js.map → chunk-qcrj4t72.js.map} +1 -1
- package/dist/{chunk-bfhcx1ca.js → chunk-re9ac4tc.js} +27 -27
- package/dist/{chunk-bfhcx1ca.js.map → chunk-re9ac4tc.js.map} +7 -6
- package/dist/{chunk-q093ph67.js → chunk-rr8bzm6k.js} +2 -2
- package/dist/{chunk-q093ph67.js.map → chunk-rr8bzm6k.js.map} +1 -1
- package/dist/{chunk-gm34n6da.js → chunk-s5hdrpam.js} +3 -3
- package/dist/{chunk-gm34n6da.js.map → chunk-s5hdrpam.js.map} +1 -1
- package/dist/{chunk-k0220nam.js → chunk-s6bq91cm.js} +2 -2
- package/dist/{chunk-k0220nam.js.map → chunk-s6bq91cm.js.map} +1 -1
- package/dist/{chunk-vt0vybw8.js → chunk-vsd5h2d9.js} +3 -3
- package/dist/{chunk-vt0vybw8.js.map → chunk-vsd5h2d9.js.map} +1 -1
- package/dist/{chunk-a1cwr0wh.js → chunk-w3mc696j.js} +2 -2
- package/dist/{chunk-a1cwr0wh.js.map → chunk-w3mc696j.js.map} +1 -1
- package/dist/{chunk-811qpkzd.js → chunk-wn4j741t.js} +2 -2
- package/dist/{chunk-811qpkzd.js.map → chunk-wn4j741t.js.map} +1 -1
- package/dist/{chunk-xmy09pr9.js → chunk-wxyxnbh6.js} +4 -4
- package/dist/{chunk-xmy09pr9.js.map → chunk-wxyxnbh6.js.map} +1 -1
- package/dist/{chunk-tp37k8c0.js → chunk-x244kqcc.js} +2 -2
- package/dist/{chunk-tp37k8c0.js.map → chunk-x244kqcc.js.map} +1 -1
- package/dist/chunk-x26jb60f.js +4 -0
- package/dist/{chunk-z7wchajg.js.map → chunk-x26jb60f.js.map} +2 -2
- package/dist/{chunk-4ehzm7p1.js → chunk-xvk6aqd7.js} +3 -3
- package/dist/{chunk-4ehzm7p1.js.map → chunk-xvk6aqd7.js.map} +1 -1
- package/dist/chunk-xwqdh388.js +5 -0
- package/dist/chunk-xwqdh388.js.map +13 -0
- package/dist/{chunk-56b6m0d4.js → chunk-y45whafz.js} +2 -2
- package/dist/{chunk-56b6m0d4.js.map → chunk-y45whafz.js.map} +1 -1
- package/dist/{chunk-q8a7ncvs.js → chunk-y5kfqq4f.js} +2 -2
- package/dist/{chunk-q8a7ncvs.js.map → chunk-y5kfqq4f.js.map} +1 -1
- package/dist/chunk-ybcdxrqx.js +4 -0
- package/dist/{chunk-wqphnrej.js.map → chunk-ybcdxrqx.js.map} +2 -2
- package/dist/{chunk-7nmbzdys.js → chunk-yrbvfda9.js} +1 -1
- package/dist/{chunk-wc3q88a2.js → chunk-yykrvrpt.js} +1 -1
- package/dist/{chunk-fxvqtwte.js → chunk-zk1vwwv6.js} +2 -2
- package/dist/{chunk-fxvqtwte.js.map → chunk-zk1vwwv6.js.map} +1 -1
- package/dist/chunks/{RealtimeClient-BnNSz8AK.js → RealtimeClient-CLXePUcE.js} +2 -2
- package/dist/chunks/{RealtimeClient-BnNSz8AK.js.map → RealtimeClient-CLXePUcE.js.map} +1 -1
- package/dist/chunks/{ThemeProvider-CoQ-vnvy.js → ThemeProvider-COjYIalw.js} +74 -1273
- package/dist/chunks/ThemeProvider-COjYIalw.js.map +1 -0
- package/dist/chunks/{fetchFileRequest-Bhp0oJ0T.js → fetchFileRequest-BaufNZpI.js} +2 -2
- package/dist/chunks/{fetchFileRequest-Bhp0oJ0T.js.map → fetchFileRequest-BaufNZpI.js.map} +1 -1
- package/dist/chunks/{live-Dt8sq9W4.js → live-Dz_rk7fm.js} +4 -15
- package/dist/chunks/{live-Dt8sq9W4.js.map → live-Dz_rk7fm.js.map} +1 -1
- package/dist/chunks/{mutationExtras-ChOGPZlY.js → mutationExtras-DtSw6BcX.js} +2 -2
- package/dist/chunks/{mutationExtras-ChOGPZlY.js.map → mutationExtras-DtSw6BcX.js.map} +1 -1
- package/dist/chunks/rolldown-runtime-D7D4PA-g.js +13 -0
- package/dist/chunks/{subscriptionStream-DDl_H-QM.js → subscriptionStream-CqhJOfPn.js} +2 -2
- package/dist/chunks/{subscriptionStream-DDl_H-QM.js.map → subscriptionStream-CqhJOfPn.js.map} +1 -1
- package/dist/chunks/urlpattern-polyfill-Cc7YrzJf.js +913 -0
- package/dist/chunks/urlpattern-polyfill-Cc7YrzJf.js.map +1 -0
- package/dist/client/ClientRouter.d.ts +1 -1
- package/dist/client/ClientRouter.d.ts.map +1 -1
- package/dist/client/ClientRouterContext.d.ts +1 -1
- package/dist/client/ClientRouterContext.d.ts.map +1 -1
- package/dist/client/browserHistory.d.ts +13 -0
- package/dist/client/browserHistory.d.ts.map +1 -0
- package/dist/client/index.js +9 -6
- package/dist/client/index.js.map +1 -1
- package/dist/client/init.d.ts.map +1 -1
- package/dist/client/scrollRestoration.d.ts +1 -1
- package/dist/client/scrollRestoration.d.ts.map +1 -1
- package/dist/client/urlPattern.d.ts +30 -0
- package/dist/client/urlPattern.d.ts.map +1 -0
- package/dist/config/index.js +1 -1
- package/dist/console/run.js +2 -2
- package/dist/console/run.js.map +1 -1
- package/dist/container/index.js +2 -2
- package/dist/container/index.js.map +1 -1
- package/dist/database/index.js +2 -2
- package/dist/database/index.js.map +1 -1
- package/dist/email/index.js +2 -2
- package/dist/email/index.js.map +1 -1
- package/dist/facades/DB.d.ts +10 -0
- package/dist/facades/DB.d.ts.map +1 -1
- package/dist/facades/index.js +2 -2
- package/dist/facades/index.js.map +1 -1
- package/dist/foundation/index.js +2 -2
- package/dist/foundation/index.js.map +1 -1
- package/dist/http/index.js +2 -2
- package/dist/http/index.js.map +1 -1
- package/dist/i18n/dictionaryRuntime.js +2 -2
- package/dist/i18n/dictionaryRuntime.js.map +1 -1
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/index.js.map +2 -2
- package/dist/kernel/index.js +2 -2
- package/dist/kernel/index.js.map +2 -2
- package/dist/orm/Model.d.ts.map +1 -1
- package/dist/orm/context.d.ts +54 -0
- package/dist/orm/context.d.ts.map +1 -1
- package/dist/orm/index.d.ts +1 -1
- package/dist/orm/index.d.ts.map +1 -1
- package/dist/orm/index.js +4 -4
- package/dist/orm/index.js.map +3 -3
- package/dist/probe/index.js +2 -2
- package/dist/probe/index.js.map +1 -1
- package/dist/server/index.js +2 -2
- package/dist/server/index.js.map +1 -1
- package/dist/services/index.js +2 -2
- package/dist/services/index.js.map +2 -2
- package/dist/services/queue/work.js +2 -2
- package/dist/services/queue/work.js.map +1 -1
- package/dist/services/router/ViewRouteDispatcher.d.ts +1 -0
- package/dist/services/router/ViewRouteDispatcher.d.ts.map +1 -1
- package/dist/stats/route-table.js +1 -1
- package/dist/support/index.js +2 -2
- package/dist/support/index.js.map +1 -1
- package/dist/testing/index.d.ts +1 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +234 -2
- package/dist/testing/index.js.map +1 -1
- package/dist/vitest/index.js +2 -2
- package/dist/vitest/index.js.map +1 -1
- package/package.json +2 -1
- package/dist/chunk-02s440vh.js +0 -4
- package/dist/chunk-3e19n0f2.js +0 -4
- package/dist/chunk-4fw84bh6.js +0 -15
- package/dist/chunk-70qqpvd9.js +0 -24
- package/dist/chunk-9mhr0kwd.js +0 -5
- package/dist/chunk-ht5mq6ev.js +0 -10
- package/dist/chunk-rczmh97n.js +0 -9
- package/dist/chunk-rczmh97n.js.map +0 -10
- package/dist/chunk-tkskgvhc.js +0 -4
- package/dist/chunk-v325k8qj.js +0 -46
- package/dist/chunk-v325k8qj.js.map +0 -31
- package/dist/chunk-wqphnrej.js +0 -4
- package/dist/chunk-z7wchajg.js +0 -4
- package/dist/chunk-z97tptd1.js +0 -6
- package/dist/chunks/ThemeProvider-CoQ-vnvy.js.map +0 -1
- /package/dist/{chunk-95re1b2y.js.map → chunk-1kehwa3s.js.map} +0 -0
- /package/dist/{chunk-zvhks9s7.js.map → chunk-8pw4zjnx.js.map} +0 -0
- /package/dist/{chunk-7nmbzdys.js.map → chunk-yrbvfda9.js.map} +0 -0
- /package/dist/{chunk-wc3q88a2.js.map → chunk-yykrvrpt.js.map} +0 -0
package/dist/orm/index.js.map
CHANGED
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"import { compile } from \"./compile\";\nimport type { BindContext } from \"./compile/fragment\";\nimport type { NestedWriteStep, RelationPlan } from \"./compile/plan-relations\";\nimport type { SqlDialect } from \"./dialect\";\nimport { jsonNullKind } from \"./json-null\";\nimport type { RelationStrategy } from \"./compile/plan-relations\";\nimport type { ModelSchema } from \"./schema\";\n\n/**\n * The public operations. The raw operations are deliberately not among them:\n * they are excluded at the operation level rather than narrowed out of the\n * argument types, because narrowing Prisma's recursive where-inputs with `Omit`\n * is miserable.\n *\n * `aggregate` joined the list once there was a measured account of what Prisma\n * returns for one — see `compile/aggregate.ts`. `groupBy` followed in its own\n * change, for the reason this note gave for separating them: `having` is a\n * second predicate compiler over aggregate expressions rather than columns, and\n * `orderBy` carries a restriction no other operation has. See\n * `compile/group-by.ts`.\n */\nexport type Operation =\n | \"findUnique\"\n | \"findUniqueOrThrow\"\n | \"findFirst\"\n | \"findFirstOrThrow\"\n | \"findMany\"\n | \"count\"\n | \"aggregate\"\n | \"groupBy\"\n | \"create\"\n | \"createMany\"\n | \"update\"\n | \"updateMany\"\n | \"upsert\"\n | \"delete\"\n | \"deleteMany\";\n\n/**\n * Per-call options that are *not* part of the query.\n *\n * A second parameter rather than a key inside `args`, deliberately: `args` is\n * typed as Prisma's own `FindManyArgs` and friends, and intersecting every one\n * of them with a gemi-specific key would mean `Prisma.UserFindManyArgs` no longer\n * describes what the operation accepts. Keeping it outside leaves those types\n * usable verbatim, which is the DX parity the project is built on.\n *\n * It also keeps the plan cache honest: these do not affect the SQL, so they must\n * not affect the plan key, and they cannot if they never reach the compiler.\n */\nexport interface ExecOptions {\n /**\n * Which relation strategy loads this query's `include` tree.\n *\n * `\"batched\"` issues one query per include node; `\"lateral\"` folds them into\n * the root statement with a `LATERAL` join on Postgres, declining per node for\n * anything it cannot express. Omitted, `defaultStrategy` chooses.\n *\n * Unlike `track`, this **does** reach the compiler and **is** part of the plan\n * key — two strategies emit different SQL for the same arguments, so sharing a\n * plan between them would run one query's statement for the other's request.\n * That is the one thing a per-call option must not do, which is why this one is\n * threaded rather than kept out of the way like `track` is.\n */\n strategy?: \"batched\" | \"lateral\";\n /**\n * Record where each returned row came from, so `Model.save(row)` can update it.\n *\n * Off by default: it costs a `WeakMap` insert and a snapshot clone per row, and\n * iteration 7 measured shaping at ~55µs per 1000 rows — so the default path\n * does not pay for a feature most queries do not use.\n */\n track?: boolean;\n}\n\n/**\n * The output of compilation. `text` is a pure function of the argument\n * *shape*; `bind` is the only thing that ever sees a value. Splitting them is\n * what makes the plan cacheable, what will let Postgres reuse prepared\n * statements, and what makes injection structurally impossible.\n */\nexport interface QueryPlan {\n text: string;\n bind(args: any, context?: BindContext): unknown[];\n shape(rows: unknown[]): unknown;\n /**\n * Nested-write steps that run before the statement, contributing foreign keys\n * into the bind context, and after it, writing rows that reference the one\n * just created. Both left undefined for a query with no nested writes.\n */\n before?: NestedWriteStep[];\n after?: NestedWriteStep[];\n /**\n * The relation nodes this query's `include` / `select` asks for, one plan per\n * node. Empty — and left undefined — for a query with no relations, so the\n * choke point can skip the whole stage with one check.\n */\n relations?: RelationPlan[];\n /**\n * Which relation strategies this plan's own nodes used, deduplicated and\n * sorted. Undefined when the query has no relations.\n *\n * Exists because a silent planner is untestable: once more than one strategy\n * can be chosen, \"which one ran\" has to be answerable from outside, both for\n * tests and for debugging a query that is slower than expected.\n *\n * **This plan's own nodes only, and that is not a limitation to remove.** A\n * nested level is loaded by `$exec` on the *child* model, which compiles its\n * own plan and chooses its own strategy — so a depth-3 include is three plans\n * with three independent answers, and asking the root for all of them would\n * mean reporting decisions that have not been made yet. It also means a mixed\n * tree is expressible, which is the point of the strategy being per-node.\n */\n strategies?: string[];\n /**\n * Fields the query had to select to stitch relations, but which the caller's\n * `select` did not ask for. Dropped once the relations are attached.\n */\n hidden?: string[];\n /**\n * Whether this plan projects a `_count`. Undefined when it does not.\n *\n * A write needs this for the same reason it needs `relations`: a `delete`\n * with either one is read *before* the row goes, so the choke point has to\n * know there is something to read. A count is not a relation plan — it is a\n * column in the statement, not a second query — so it cannot be discovered by\n * looking at `relations`, and `include: { _count: … }` on its own leaves that\n * list empty.\n */\n counts?: boolean;\n}\n\n/**\n * The cache is bounded because one part of the key space is *not* finite per\n * application: on SQLite an `in` list expands to one placeholder per element,\n * so every distinct list length is its own plan — and list length is routinely\n * request-derived (`?ids=1,2,3` off a query string) or, from iteration 3,\n * derived from the number of parent rows a relation is being loaded for.\n * Unbounded, that is a slow memory leak reachable from untrusted input.\n *\n * Postgres binds the whole list to one parameter, so there the length is not\n * part of the key at all — see `collapsedList`.\n *\n * A coarser key cannot fix the SQLite side: collapsing lengths there would hand\n * a plan the wrong number of placeholders. Eviction is the only correct answer.\n *\n * Least-recently-used, implemented on `Map`'s insertion ordering: re-inserting\n * on a hit moves the entry to the end, so the first key `keys().next()` yields\n * is always the coldest. A miss past the cap evicts exactly one entry. The cap\n * is far above any realistic application's distinct query shapes, so a\n * well-behaved app never evicts at all.\n */\nconst MAX_CACHED_PLANS = 1000;\n\nconst cache = new Map<string, QueryPlan>();\nlet compiles = 0;\nlet hits = 0;\nlet evictions = 0;\n\n/**\n * A canonical description of an argument tree's *shape* — key paths, operators\n * and value kinds, never values. Keys are sorted so `{ where: { a, b } }` and\n * `{ where: { b, a } }` are one cache entry rather than two, and `undefined`\n * values are dropped because Prisma treats them as absent.\n *\n * The result is used directly as the cache key rather than being hashed: a\n * canonical string is a perfect hash, and a collision would mean running the\n * wrong SQL — not worth trading for shorter keys.\n */\n/**\n * Argument keys whose *values* are structural rather than parameters — they end\n * up in the SQL text, so two calls that differ only there are two different\n * queries and must be two different plans.\n *\n * Getting this wrong is silent: `orderBy: { id: \"asc\" }` and\n * `orderBy: { id: \"desc\" }` have identical *types*, so without this they would\n * share a cache entry and the second caller would get the first one's SQL. The\n * plan-cache discrimination tests exist to catch exactly that.\n */\nconst LITERAL_KEYS = new Set([\n \"orderBy\",\n \"select\",\n // `omit` is `select`'s complement and decides the same thing — which columns\n // the statement asks for — so it fails the same way and in the worse\n // direction. `omit: { password: true }` and `{ password: false }` both shape\n // to `boolean`, so whichever compiled first decided for the other: an admin\n // screen that keeps the column warms the cache, and the public endpoint that\n // asked to hide it gets the column back. The reverse order is harmless, which\n // is exactly the wrong asymmetry.\n \"omit\",\n \"include\",\n \"distinct\",\n \"mode\",\n // An aggregate's functions decide the *projection*, so they are structural\n // for exactly the reason `select` is — and they fail the same way. Without\n // them, `_count: { email: true }` and `_count: { email: false }` both shape to\n // `{_count:{email:boolean}}`, share one entry, and the second caller gets the\n // first one's statement: a column they switched off, counted anyway. `_count:\n // true` against `_count: false` is the same collision one level up.\n \"_count\",\n \"_avg\",\n \"_sum\",\n \"_min\",\n \"_max\",\n // `skipDuplicates: true` emits `on conflict do nothing` and `false` does not,\n // so the *value* is in the SQL text. Without it here both shape to `boolean`,\n // share one entry, and whichever call compiled first decides whether the\n // other one skips conflicts — an insert that raises where the caller asked it\n // not to, or worse, one that silently swallows a duplicate the caller wanted\n // to hear about.\n \"skipDuplicates\",\n // `groupBy`'s grouped columns, which reach the SQL as *identifiers* — both\n // the select list and the `group by`. `[\"role\"]` and `[\"locale\"]` have the\n // same shape, `[string]`, so without this they would be one cache entry and\n // the second caller would be grouped by the first caller's column. Silently:\n // the result is well-formed, just grouped by something else.\n \"by\",\n]);\n\n/**\n * The aggregate kinds, which mean **two different things by position**.\n *\n * As a *projection* — `_count: { email: true }` — their contents decide the\n * select list, so they are in {@link LITERAL_KEYS} and recorded verbatim.\n * Inside a `having` the same keys introduce a *comparison*, and its operand is\n * a bound parameter like any other.\n *\n * Nothing else in the walk is ambiguous this way, which is why this is a set\n * rather than a general rule: the position is what disambiguates, and only\n * these five keys have two positions.\n */\nconst AGGREGATE_KINDS = new Set([\"_count\", \"_avg\", \"_sum\", \"_min\", \"_max\"]);\n\nexport function canonicalShape(\n value: unknown,\n literal = false,\n /**\n * Set when the dialect binds an `in` list as a single parameter, so that the\n * list's *length* stops being part of the key. See `collapsedList`.\n */\n collapseLists = false,\n /**\n * Set inside a `having`, where an aggregate kind is an operator rather than a\n * projection selector.\n *\n * A separate flag rather than clearing `literal`, because clearing it would\n * be wrong: `mode` lives inside `where` — already a value subtree — and\n * *must* stay literal, since `insensitive` and `default` compile to `ilike`\n * and `like`. So \"nothing below a value key is structural\" is not the rule;\n * \"an aggregate kind below a `having` is not\" is.\n */\n inHaving = false,\n): string {\n if (value === null) return \"null\";\n if (value === undefined) return \"undefined\";\n\n const type = typeof value;\n // In a structural subtree the value itself is part of the query, so it is\n // recorded verbatim: \"asc\" and \"desc\" have to be two keys, and so do the\n // `true` and `false` of a `select`.\n if (type !== \"object\") return literal ? JSON.stringify(value) : type;\n\n if (value instanceof Date) return \"date\";\n\n /**\n * Prisma's Json null sentinels, each its own key.\n *\n * They carry no enumerable properties, so the object branch below recorded\n * all three — and a genuine empty Json object — as `{}`. They do not compile\n * alike: `DbNull` is `is null`, `JsonNull` and `{}` are `= ?` with different\n * bound values, and `AnyNull` is `is null or = ?`. So the first shape\n * compiled won the entry and every later one was answered with its text —\n * `JsonNull` served `is null` returns the SQL-NULL rows, and `DbNull` served\n * `= ?` binds NULL and matches nothing. Both silent, both wrong, and both\n * only reachable once two of them meet in one process (#266).\n *\n * This is invariant 2 read backwards. `binding.invariants.test.ts` asserts\n * that one shape with different values gives byte-identical SQL; the same\n * rule requires that different SQL means different shape, which is the half\n * nothing was checking.\n *\n * Imported rather than duplicated. `plan.ts` spells `$compositeIn` literally\n * to avoid depending on the compiler — `json-null.ts` is not the compiler but\n * a leaf module with no imports of its own, so this respects that rule\n * instead of making an exception to it.\n */\n const sentinel = jsonNullKind(value);\n if (sentinel) return `jsonNull:${sentinel}`;\n\n if (Array.isArray(value)) {\n // Element-wise by default, so the length is part of the shape. Usually that\n // is not a choice: `AND: [a, b]` and `AND: [a]` are different predicates,\n // `orderBy: [a, b]` is a different sort, and on SQLite `in: [a, b]`\n // compiles to `in (?, ?)` — collapsing any of them would hand a plan the\n // wrong SQL or the wrong number of placeholders.\n //\n // The exception is the `in` / `notIn` operand on a dialect that binds it as\n // one parameter, which `shapeOfMember` takes before this is reached.\n return `[${value\n .map((item) => canonicalShape(item, literal, collapseLists, inHaving))\n .join(\",\")}]`;\n }\n\n const entries = Object.entries(value as Record<string, unknown>)\n .filter(([, v]) => v !== undefined)\n .sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0))\n .map(\n ([key, v]) =>\n `${key}:${shapeOfMember(key, v, literal, collapseLists, inHaving)}`,\n );\n return `{${entries.join(\",\")}}`;\n}\n\n/**\n * The keys whose operand is an array that binds as **one** parameter, so its\n * length never reaches the SQL text and must not reach the cache key either.\n *\n * `in` / `notIn` bind as one `= any($1)` on Postgres. So do a scalar list's\n * `hasEvery`, `hasSome` and `push` (#300) — `col @> $1`, `col && $1` and\n * `array_cat(col, $1)` are each one parameter however long the operand is, so\n * recording it element-wise mints one entry per distinct length, every one of\n * them holding SQL identical to its neighbours'. A `hasEvery` built from user\n * input is exactly the churn `collapsedList` exists to prevent.\n *\n * **Three names, and the two obvious omissions are deliberate.**\n *\n * `equals` and `set` are *overloaded*, and `set` is the one that would have\n * been a real bug rather than a missed optimisation: it is also a **relation**\n * operator — `data: { tags: { set: [{ id: 1 }, { id: 2 }] } }` rewrites a join\n * table, and that statement's text grows with the list. Collapsing it would\n * hand a plan the wrong number of placeholders, which is precisely the failure\n * the note above warns about for `OR`. Checked in `compile/nested-writes.ts`\n * rather than assumed from the name.\n *\n * Those three carry no such second meaning: `grep` finds them only in the\n * scalar-list filter set and the list write operators.\n *\n * **`path` is not a list of values at all, and reaches the same arithmetic from\n * a different direction (#301).** `where: { metadata: { path: [\"a\", \"b\"],\n * equals: … } }` binds the whole path as one `text[]` through `#>`, so every\n * depth compiles to the identical `(\"metadata\" #>> $1) = $2`. Measured over the\n * corpus: `[\"a\"]`, `[\"a\",\"b\"]` and `[\"a\",\"b\",\"c\"]` were three cache entries\n * holding one statement, and a path depth taken off a request is as ordinary as\n * a list length taken off one.\n *\n * SQLite needs nothing here and gets nothing: a path is a *string* there\n * (`\"$.a.b\"`), so depth was never in the shape to begin with, and\n * `collapseLists` is false on that dialect anyway.\n *\n * **`path` collapses only when every segment is a `string`, and that narrowing\n * is the whole safety argument rather than a fussy detail.** `collapsedList`\n * erases the elements as well as the count, so `[*]` says nothing about what is\n * *in* the array — while `assertPathShape` (`compile/where.ts`) refuses an\n * array whose segments are not each a string or a number. Collapse the two\n * together and the refusal stops being reachable on a cache hit, the `disconnect:\n * true`/`false` failure this file describes a few lines below, arriving from the\n * other side: a plan compiled for `[\"a\"]` served `[\"a\", null]`, `[[\"a\"]]` and\n * `[{ k: 1 }]` without recompiling, and `[[\"a\"]]` is the bad one — it flattens\n * to `{\"a\"}` and answers as if the caller had written `[\"a\"]`. Wrong rows, no\n * error. Measured through `getOrCompile` + `bind` on Postgres, and it is a\n * regression this collapse would have introduced: on `main` those three key\n * apart from `[\"a\"]` element-wise, so each is refused on every call.\n *\n * The predicate has to stay a **subset** of what `assertPathShape` accepts, not\n * an equal — a collapsed shape must never cover an argument the compiler would\n * refuse, but leaving an accepted one uncollapsed costs a cache entry and\n * nothing else. `string` is that subset today (`assertPathShape` also takes a\n * `number`, so a numeric segment simply keeps its element-wise shape) and it\n * stays one under #380, which narrows `JsonPath` to `readonly string[]`. It is\n * duplicated knowledge either way — `plan.ts` holds no dependency on the\n * compiler, deliberately — so `plan-key.invariants.test.ts` asserts the\n * subset relation directly, over the malformed shapes above.\n *\n * **The gate is `collapseLists` — that is `bindsListAsOneParameter`, a property\n * about `in` lists rather than about paths — and the conflation deserves\n * stating.** It is the right condition on both implemented dialects because the\n * array path *grammar* exists only where `jsonPathSyntax` is `\"array\"`, and the\n * one dialect with that grammar binds the array whole. A dialect that spelled a\n * path as an array but emitted one parameter per segment would make this wrong\n * in the dangerous direction — a plan reached with the wrong number of\n * placeholders, the trap this comment already describes for SQLite's `in` — and\n * would need a flag of its own. None exists to hang one on today that is not\n * speculative, and `plan-key.invariants.test.ts` walks both grammars on both\n * dialects asserting same-key-implies-same-SQL, so that is what would fail —\n * conditional on the new dialect being added to `DIALECTS` there, which is the\n * same condition every other property in that file already carries.\n *\n * **A *column* named `path` is the other collision, and it is harmless —\n * measured rather than assumed**, since `LIST_KEYS` matches by name at any\n * depth. Every position where a bare array can sit directly under such a key\n * binds as one parameter on Postgres: `where: { path: [...] }` on a Json column\n * is `\"path\" = $1::text::jsonb`, `equals: [...]` on a scalar list is\n * `\"path\" = $1`, and `data: { path: [...] }` is one `values` placeholder for\n * either. A bare-array *filter* on a scalar list is refused outright. So the\n * collapse is correct there rather than merely unreachable, which incidentally\n * closes a sliver of the case named next.\n *\n * **One case is still uncollapsed and needs a schema to fix.** A bare array as\n * a *write* value — `data: { tags: [\"a\", \"b\"] }` — is keyed by the **field\n * name**, so no fixed set can recognise it; telling it from `data: { AND: … }`\n * needs to know that `tags` is a list on this model, and `canonicalShape` is\n * deliberately schema-free. Left as churn rather than guessed at: the cost is\n * bounded by the LRU and the SQL is identical either way, where a wrong\n * collapse is a wrong statement. The filter side — which is where a\n * user-sized list actually arrives — is covered.\n */\nconst LIST_KEYS = new Set([\n \"in\",\n \"notIn\",\n \"hasEvery\",\n \"hasSome\",\n \"push\",\n \"path\",\n // The JSON key-exists lists (#664): one `text[]` parameter under `?|` / `?&`\n // on Postgres. On SQLite they stay element-wise, one term per key, because\n // `bindsListAsOneParameter` is false there and this set is never consulted.\n \"has_some_keys\",\n \"has_every_key\",\n]);\n\n/**\n * The internal composite-`in` key — see `compile/where.ts`, which owns it.\n *\n * Spelled here rather than imported to keep `plan.ts` free of a dependency on\n * the compiler, the way it already is for every other key it recognises.\n */\nconst COMPOSITE_IN = \"$compositeIn\";\n\n/**\n * `in: [1, 2]` and `in: [1, 2, 3]` on Postgres are the same SQL text — the\n * whole array binds to `= any($1)` — so they must be the same cache entry.\n *\n * Recording them element-wise there is not *wrong*, but it mints one entry per\n * distinct list length, each holding SQL identical to its neighbours'. From\n * iteration 3 on that stops being a curiosity: every batched relation query is\n * an `in` over the parent keys, so the list length is the number of rows the\n * parent query returned, and a variably-sized parent set would churn the LRU on\n * every dialect rather than on the one that needs it.\n *\n * An empty list keeps its own key: `in: []` compiles to a constant-false\n * predicate rather than to `= any($1)`, which is a different text.\n *\n * **It covers `in` / `notIn` and nothing else, which leaves one gap worth\n * naming here rather than only where it happens.** A relation joining on more\n * than one field cannot be filtered with a single `in`, so the batched loader\n * builds an `OR` of `AND`s instead (see `childQuery`) — and an `OR`'s text\n * genuinely varies with its branch count, so it cannot be collapsed the way a\n * Postgres `= any($1)` can: a shared key would hand a plan the wrong number of\n * placeholders, which is the trap described above for SQLite. Measured over\n * parent counts 2, 3, 10, 50:\n *\n * sqlite composite: 4 keys single: 4 keys\n * postgres composite: 4 keys single: 1 key\n *\n * That gap is closed on Postgres by #97: a composite key binds one array per\n * *column* through `unnest`, so its text is fixed too, and `shapeOfMember`\n * collapses its tuple list on the same condition this function uses. SQLite has\n * no such form, keeps the `OR`, and churns as it always has — which is the same\n * sentence as above, and for the same reason.\n */\nfunction collapsedList(value: unknown[]): string {\n return value.length === 0 ? \"[]\" : \"[*]\";\n}\n\n/**\n * Keys that end the structural subtree. `select` and `include` are structural,\n * but a `where` nested inside one is filter *values* again — and recording\n * those verbatim would put user data into a long-lived global map and give\n * every distinct filter value its own cache entry.\n *\n * Live as of iteration 3: `include: { accounts: { where: { deletedAt: null } } }`\n * is one plan whatever the filter's values are, and the relation loader reads\n * those values back out of the *call's* argument tree rather than the compiled\n * plan's.\n */\nconst VALUE_KEYS = new Set([\"where\", \"cursor\", \"data\"]);\n\nfunction shapeOfMember(\n key: string,\n value: unknown,\n literal: boolean,\n collapseLists: boolean,\n inHaving: boolean,\n): string {\n // `take` is a parameter, but its *sign* is not: a negative take means \"the\n // last N\", which flips every ordering term and so changes the SQL text. The\n // magnitude stays out of the key, so `take: 10` and `take: 20` still share a\n // plan the way every other value does.\n if (key === \"take\" && typeof value === \"number\") {\n return `number:${Math.sign(value)}`;\n }\n // `skip` is a parameter with no structural half at all, and it needs saying\n // because a *relation node's* `skip` sits inside `include` — a literal\n // subtree, where a bare number would otherwise be recorded verbatim and mint\n // one plan entry per page. The root's `skip` never had the problem, which is\n // exactly why it went unnoticed until a node could carry one.\n if (key === \"skip\" && typeof value === \"number\") return \"number\";\n // `path` is the one member of `LIST_KEYS` whose *elements* are checked by the\n // compiler, so it is the one that cannot be collapsed unconditionally: `[*]`\n // erases the segment kinds, and `assertPathShape` refuses a segment that is\n // neither a string nor a number. A malformed path therefore keeps its\n // element-wise shape, keys apart from every valid one, and is refused on every\n // call rather than served by a plan compiled for a path it does not resemble.\n // See {@link LIST_KEYS}.\n if (collapseLists && LIST_KEYS.has(key) && Array.isArray(value)) {\n if (key !== \"path\" || value.every((segment) => typeof segment === \"string\")) {\n return collapsedList(value);\n }\n }\n /**\n * A composite `in`'s tuple list collapses on exactly the dialects where its\n * SQL text does not grow with it — the same condition, and the same reason,\n * as `collapsedList` for a single-column `in`.\n *\n * On Postgres the tuples become one array parameter per *column*, so every\n * parent count is one statement and must be one entry: without this a batched\n * composite `include` mints a plan per page size, which is #97 and the whole\n * point of the `unnest` form. On SQLite the key is never emitted — the loader\n * keeps the `OR`, whose text does grow — so the collapse cannot be reached\n * there to be wrong.\n *\n * The `fields` stay verbatim: they are *identifiers* in the emitted SQL, so\n * two relations joining on different columns must not share an entry. Only\n * the tuple list is collapsed.\n */\n if (key === COMPOSITE_IN) {\n const operand = value as { fields: unknown; values: unknown[] };\n return canonicalShape(\n collapseLists\n ? { fields: operand.fields, values: collapsedList(operand.values) }\n : value,\n true,\n collapseLists,\n );\n }\n\n /**\n * `disconnect: true` and `disconnect: false` are two different writes, and\n * nothing above tells them apart: they sit under `data`, which is a\n * {@link VALUE_KEYS} subtree, so both shape to `boolean` and share one entry.\n *\n * **On the owning side the boolean is structural — it decides the SET list\n * rather than a value bound into one**, and that is the whole of why the\n * guard has to exist. `disconnect: true` pushes a contribution for the\n * foreign key and `disconnect: false` pushes none, so the two spellings are\n * two assignment lists and therefore two statement *texts*, chosen once,\n * when the plan is built. Measured on `User.organization`, sqlite:\n *\n * data: { name, organization: { disconnect: true } }\n * -> update \"User\" set \"name\" = ?, \"organizationId\" = ?, \"updatedAt\" = ? …\n * data: { name, organization: { disconnect: false } }\n * -> update \"User\" set \"name\" = ?, \"updatedAt\" = ? …\n *\n * When the `disconnect` is the **only** member of `data` the `false` arm\n * leaves no assignment at all, and `compileUpdate` degenerates further, to a\n * bare `select` of the row. That is the special case, not the rule — say it\n * the other way round and a reader takes `{ name, disconnect: false }` to\n * drop the `name` write too.\n *\n * A cache **hit** skips compilation, so a hit that got the boolean wrong\n * runs the other spelling's statement, and nothing downstream can rescue it:\n * on this side the compiled plan *is* the decision.\n *\n * Note the worked example is deliberately *not* offered as parity with\n * Prisma. On a **many-to-one** — which `User.organization` is — Prisma\n * discards the operand and nulls the key for `disconnect: false`, and gemi\n * declines to reproduce that, since it is the same silent destructive write\n * #358 removed from this cache. `writes.differential.test.ts` pins the\n * divergence (\"where the two clients still disagree\"). The guard's argument\n * needs no agreement from Prisma: two statement texts is the whole of it.\n *\n * **The foreign side is not like it, and the contrast is what makes the key\n * load-bearing here and merely prudent there.** Where the child holds the\n * key the operand becomes a *statement the step runs*, and `toOneOperand`\n * re-reads the boolean out of the call at bind time — `listOf(null)` is no\n * statement — so a plan mis-served there still writes nothing. `delete`\n * shares this guard for that side's sake; on this side it is refused\n * outright, since deleting the far row through a `data` key would remove a\n * row the statement is not about.\n *\n * **The history, which is why the guard was added rather than why it stays.**\n * When #358 added it, `planOwningSide` still refused `operand !== true` at\n * compile time and then pushed a constant `value: () => null` for the one arm\n * it took — and the refusal was no protection at all, because a cache *hit*\n * skips compilation and so never re-runs it. A plan compiled from\n * `disconnect: true` served `disconnect: false` and nulled the foreign key on\n * a call that asked for nothing. Measured against the real client, so the\n * damage was the gap and not the guess. Measured on the one-to-one the\n * differential suite pins the grammar against, `Profile.user`:\n * `disconnect: false` with a child present leaves the row exactly as it was,\n * foreign key intact. That is the reference for the no-op — the many-to-one\n * of the worked example above is where the two clients part company, and\n * gemi answers one grammar one way on both shapes. #359 then implemented all\n * three arms and removed that refusal, which did not retire the guard — it\n * made it load-bearing a second way, since the two spellings now differ in\n * statement text and not only in what a contribution binds.\n *\n * **It cannot simply join {@link LITERAL_KEYS}, which is the same bug class\n * documented there twice already** — for `omit` and for `skipDuplicates`.\n * Those keys match by *name at any depth* and raise `literal` over the whole\n * subtree below them, so a to-many `disconnect: { id: 1 }` would record the\n * `1` verbatim and mint one cache entry per id — the unbounded growth\n * `VALUE_KEYS`' own comment exists to prevent, and user data in a long-lived\n * global map. Only the boolean spelling is structural, so only the boolean is\n * guarded; every other operand shape reaches the key through its structure,\n * as it always did.\n */\n if ((key === \"disconnect\" || key === \"delete\") && typeof value === \"boolean\") {\n return JSON.stringify(value);\n }\n\n if (VALUE_KEYS.has(key)) {\n return canonicalShape(value, false, collapseLists, inHaving);\n }\n\n /**\n * `having` is a predicate, so its operands are parameters — and unlike every\n * other value key it contains keys that {@link LITERAL_KEYS} would otherwise\n * re-raise one level down.\n *\n * Without this, `having: { role: { _count: { gt: 5 } } }` records `gt:5`\n * verbatim and mints one cache entry per threshold, each holding\n * byte-identical SQL. The cap is 1000 and a threshold off a query string is\n * ordinary, so it fills the cache and evicts every other query's plan — the\n * same pathology `plan.ts` already describes for `in`-list lengths, and the\n * thing `VALUE_KEYS`' own comment warns about: it would put user data into a\n * long-lived global map.\n *\n * The equivalent `where` — `{ role: { gt: 5 } }` — has always been one entry,\n * which is the behaviour this matches.\n */\n if (key === \"having\") return canonicalShape(value, false, collapseLists, true);\n\n // In a `having`, an aggregate kind is a comparison rather than a projection,\n // so it does not raise `literal` for its subtree.\n if (inHaving && AGGREGATE_KINDS.has(key)) {\n return canonicalShape(value, false, collapseLists, true);\n }\n\n return canonicalShape(\n value,\n literal || LITERAL_KEYS.has(key),\n collapseLists,\n inHaving,\n );\n}\n\n/**\n * Takes the dialect itself rather than its name: whether an `in` list's length\n * belongs in the key is a property of how that dialect *binds* the list, and\n * asking the dialect keeps `if (dialect === \"postgres\")` out of here the same\n * way the compiler keeps it out of itself.\n */\nexport function planKey(\n dialect: SqlDialect,\n model: string,\n op: Operation,\n args: unknown,\n /**\n * The relation strategy's name, because **different strategies emit different\n * SQL for the same arguments**.\n *\n * Leaving it out would let a query run under one strategy return a plan\n * compiled for the other — a lateral statement executed where the caller asked\n * for batched, or worse a batched one whose children are then never loaded\n * because `attachRelations` skips a plan carrying `root`. Silent wrong results\n * from a caching bug, which is the same failure shape iteration 6's policy\n * ordering had to avoid.\n *\n * Defaulted so every existing caller keys exactly as it did, which is what\n * keeps this from invalidating a warm cache.\n */\n strategy: string = \"batched\",\n): string {\n return `${dialect.name}:${strategy}:${model}:${op}:${canonicalShape(\n args,\n false,\n dialect.bindsListAsOneParameter,\n )}${lockKey(args)}${skipIfUnchangedKey(args)}`;\n}\n\n/**\n * An update's `skipIfUnchanged`, verbatim, because `true` adds a `where` term\n * and `false` does not — both shape to `boolean`, and a shared entry would hand\n * one caller the other's statement (#664). Top level only, for the reason\n * `lockKey` gives: a column of that name must stay a bound value.\n */\nfunction skipIfUnchangedKey(args: unknown): string {\n if (args === null || typeof args !== \"object\") return \"\";\n const skip = (args as { skipIfUnchanged?: unknown }).skipIfUnchanged;\n return skip === undefined ? \"\" : `:skipIfUnchanged=${String(skip)}`;\n}\n\n/**\n * A read's `lock`, verbatim, because its value is the statement's tail:\n * `\"update\"` and `\"share\"` both shape to `string`, and sharing one entry would\n * hand the second caller the first one's lock — a `for share` where\n * `for update` was asked for, or `skip locked` where the caller wanted to wait.\n *\n * Read here, at the top level only, rather than added to `LITERAL_KEYS`.\n * `LITERAL_KEYS` matches by name at any depth, so a model with a column called\n * `lock` would record every `where: { lock: … }` value verbatim — user data in\n * a long-lived map and one plan per distinct value. `lock` is only an argument\n * at the root of a read; a relation node refuses it.\n */\nfunction lockKey(args: unknown): string {\n if (args === null || typeof args !== \"object\") return \"\";\n const lock = (args as { lock?: unknown }).lock;\n return lock === undefined ? \"\" : `:lock=${canonicalShape(lock, true)}`;\n}\n\nexport function getOrCompile(\n schema: ModelSchema,\n op: Operation,\n args: any,\n dialect: SqlDialect,\n strategy?: RelationStrategy,\n): QueryPlan {\n const key = planKey(dialect, schema.name, op, args, strategy?.name);\n const cached = cache.get(key);\n if (cached) {\n hits++;\n // Re-insert to move this key to the end of `Map`'s insertion order, so the\n // oldest *unused* entry is the one eviction takes.\n cache.delete(key);\n cache.set(key, cached);\n return cached;\n }\n\n const plan = compile(schema, op, args, dialect, strategy);\n compiles++;\n\n if (cache.size >= MAX_CACHED_PLANS) {\n const coldest = cache.keys().next();\n if (!coldest.done) {\n cache.delete(coldest.value);\n evictions++;\n }\n }\n\n cache.set(key, plan);\n return plan;\n}\n\n/**\n * Public on purpose, not only as a test seam. `compiles` climbing in step with\n * `hits` means some query shape is not being reused — a metric worth graphing,\n * and the cheapest signal that a caller is accidentally varying its argument\n * shape per request. A non-zero `evictions` means the same thing more loudly:\n * the shape space has outgrown the cap, which for a normal application should\n * not happen.\n */\nexport function planCacheStats(): {\n size: number;\n compiles: number;\n hits: number;\n evictions: number;\n capacity: number;\n} {\n return {\n size: cache.size,\n compiles,\n hits,\n evictions,\n capacity: MAX_CACHED_PLANS,\n };\n}\n\n/**\n * Drops every compiled plan. Needed by tests that assert compile counts, and by\n * anything that reloads the generated schema in a running process.\n */\nexport function clearPlanCache(): void {\n cache.clear();\n compiles = 0;\n hits = 0;\n evictions = 0;\n}\n",
|
|
30
30
|
"import { currentConnectionName } from \"./context\";\nimport { UnsupportedQueryError } from \"./errors\";\nimport type { ModelSchema } from \"./schema\";\n\n/**\n * Row provenance: where a returned object came from, and what it looked like\n * when it arrived.\n *\n * This is the whole of invariant 5, and the reason it is opt-in. Queries return\n * plain objects — no proxies, no conditional return types, no signature that\n * changes depending on a flag — so `save(row)` needs somewhere *outside* the row\n * to remember which model and which primary key it belongs to. A `WeakMap` keyed\n * on the object is that somewhere, and it is the only shape that does not leak:\n * the entry goes when the row does.\n *\n * **The cost of that choice, stated up front because it is the first thing\n * anyone will hit.** Provenance is attached to an object *identity*. A row that\n * is spread (`{ ...user }`), cloned, or round-tripped through JSON is a\n * different object and has none. `save` raises in that case rather than\n * guessing, because the guess would be \"write every column\", and writing a\n * column the caller never fetched is how a partial select silently reverts data.\n *\n * Off by default. Iteration 7 measured shaping at ~55µs per 1000 rows, and a\n * WeakMap insert plus a snapshot clone per row is a real fraction of that — so\n * the default path must not pay for a feature most queries do not use.\n */\n\nexport interface Provenance {\n /** The model name, so `save` compiles against the right schema. */\n model: string;\n /**\n * The connection the row was read on, so `save` writes it back to the\n * database it came from.\n *\n * The one piece of ORM state that cannot live in the ambient scope, and the\n * reason it is recorded here instead. Everything else about a connection is\n * true for an async subtree; this is true of a *value* that outlives the\n * query that produced it — a row read on `analytics`, mutated three functions\n * later, and saved from a scope that never named a connection.\n *\n * Without it `save` compiled a correct `update` and sent it to the default\n * connection. In production, where two connections usually address the same\n * database with the same id space, that is not a failed write: it is the\n * *wrong row* updated, with no error to notice.\n */\n connection: string;\n /** The primary key values, captured at fetch time so a mutation cannot move the row. */\n key: Record<string, unknown>;\n /**\n * The values as fetched, for the columns that were fetched.\n *\n * Only those columns: a partially selected row can still be saved, it just\n * cannot write what it never read. That is the correct behaviour rather than a\n * limitation — the alternative is writing a default over a column that holds\n * something else.\n */\n snapshot: Record<string, unknown>;\n}\n\nconst provenance = new WeakMap<object, Provenance>();\n\n/**\n * Records provenance for a shaped row.\n *\n * Called only when the caller asked for it. The snapshot is a shallow copy of\n * the row's own scalar keys — shallow because a deep clone would have to decide\n * what to do with a `Json` column's nested object, and the dirty check compares\n * with `!==`, so a caller who mutates a nested object *in place* has changed\n * something this cannot see. That is documented rather than solved: solving it\n * means structural comparison per row per field, which is exactly the per-row\n * cost this feature is trying to keep off the default path.\n */\nexport function track(\n row: object,\n schema: ModelSchema,\n /**\n * Defaults to the connection in scope, which is the right answer for the only\n * caller that matters: `$exec` tracks inside the scope it entered, so a row\n * from `User.on(\"analytics\")` is stamped `analytics` with nothing passed.\n *\n * Explicit for `wrap`, which runs *after* that scope has closed and would\n * otherwise stamp every wrapped row with the default connection.\n */\n connection: string = currentConnectionName(),\n): void {\n const snapshot: Record<string, unknown> = {};\n const key: Record<string, unknown> = {};\n const source = row as Record<string, unknown>;\n\n for (const name of Object.keys(source)) {\n // The schema's own columns and nothing else. That covers the two things a\n // shaped row carries besides them — an attached relation, and a `_count` —\n // because neither is a field, and Prisma will not let a relation share a\n // name with one.\n //\n // This used to take a `relationKeys` list and skip those first. It never\n // changed the outcome: every name it excluded was excluded again on the\n // next line. What it did do was make the two call sites look like they\n // disagreed — `wrap` passed `[]`, `$exec` passed the plan's relations — and\n // give the reason for the exclusion to a line that was not performing it.\n // An attached child array in a snapshot would make every `save` look dirty,\n // since the relation loader replaces it; this is the line that prevents\n // that.\n if (!(name in schema.fields)) continue;\n snapshot[name] = source[name];\n }\n\n for (const name of schema.primaryKey) {\n key[name] = source[name];\n }\n\n provenance.set(row, { model: schema.name, connection, key, snapshot });\n}\n\nexport function provenanceOf(row: unknown): Provenance | undefined {\n // A fast path, not a correctness guard: `WeakMap.get` on a primitive returns\n // `undefined` rather than throwing, so removing this line would change\n // nothing an assertion could see. Recorded because a mutation of it survives\n // the suite, and a survivor with no test is normally worth chasing — this one\n // is not.\n if (row === null || typeof row !== \"object\") return undefined;\n return provenance.get(row);\n}\n\n/**\n * The columns whose value differs from the snapshot.\n *\n * Compared with `!==`, which is right for the scalars an encoder produces and\n * wrong for a `Date` — two Dates for the same instant are different objects. So\n * `Date` is compared by instant and typed arrays byte-wise, the same three cases\n * `sameEncoded` in the write compiler handles, and for the same reason: without\n * it, every save of a row carrying a timestamp would rewrite that timestamp.\n */\nexport function changedFields(\n row: object,\n /**\n * Required, not optional.\n *\n * The unfetched-column check below is `save`'s central safety guarantee, and an\n * optional schema would mean every caller that omitted it silently got the\n * permissive behaviour — the exact silent drop this function exists to refuse.\n * That is the same conclusion `render`'s `origin` reached on #49: optional\n * \"reintroduces in miniature the hole this check exists to close\".\n *\n * The argument is stronger here, because `changedFields` is exported from\n * `orm/index.ts`. An application computing its own diff would have got the old\n * semantics from a signature that read as though the schema were an extra, when\n * what it actually selected was whether the check ran at all.\n */\n schema: ModelSchema,\n): Record<string, unknown> {\n const record = provenanceOf(row);\n if (!record) return {};\n\n const source = row as Record<string, unknown>;\n const changed: Record<string, unknown> = {};\n\n for (const name of Object.keys(record.snapshot)) {\n if (!same(source[name], record.snapshot[name])) {\n changed[name] = source[name];\n }\n }\n\n // A value assigned to a column the query never fetched cannot be seen as\n // changed, because the diff walks the *snapshot's* keys — so it would be\n // silently dropped. That is the divergence class this codebase refuses\n // everywhere else: `save` returning happily having done less than it was told.\n //\n // The detection is exact rather than heuristic. A key on the row that the schema\n // declares as a field, is not a relation, and is *absent from the snapshot* can\n // only be an assignment to something unfetched — a fetched column is in the\n // snapshot by construction.\n assertNothingUnfetched(row, record, schema);\n\n return changed;\n}\n\nfunction assertNothingUnfetched(\n row: object,\n record: Provenance,\n schema: ModelSchema,\n): void {\n for (const name of Object.keys(row as Record<string, unknown>)) {\n if (name in record.snapshot) continue;\n if (!(name in schema.fields)) continue;\n if (name in schema.relations) continue;\n\n throw new UnsupportedQueryError(\n `save.${name}`,\n schema.name,\n \"save\",\n `'${name}' was not fetched by the query this row came from, so save ` +\n `cannot write it — the diff has nothing to compare it against, and ` +\n `writing it blind would overwrite whatever the column actually holds. ` +\n `Select '${name}' in the query, or update it explicitly with ` +\n `${schema.name}.update({ where, data: { ${name} } }).`,\n );\n }\n}\n\n/** Replaces the snapshot after a successful save, so a second save is a no-op. */\nexport function resnapshot(row: object, written: Record<string, unknown>): void {\n const record = provenanceOf(row);\n if (!record) return;\n\n for (const name of Object.keys(written)) {\n record.snapshot[name] = written[name];\n }\n}\n\n/**\n * Raised when `save` is handed something it cannot place.\n *\n * Separate from a generic error because the two causes have different fixes and\n * both are easy to hit: the query did not ask for tracking, or the object is a\n * copy of one that did.\n */\nexport function untracked(row: unknown, model: string): UnsupportedQueryError {\n const shape =\n row === null || row === undefined\n ? String(row)\n : Array.isArray(row)\n ? \"an array\"\n : typeof row;\n\n return new UnsupportedQueryError(\n \"save\",\n model,\n \"save\",\n `This object carries no provenance, so there is no row to update. Either ` +\n `the query did not ask for it — pass { track: true } as the second ` +\n `argument, e.g. ${model}.findUnique({ where }, { track: true }) — or this ` +\n `is a copy of a row that did. Provenance is keyed on object identity, so ` +\n `spreading, cloning or JSON round-tripping a row loses it. ` +\n `(Received ${shape}.)`,\n );\n}\n\n/** Test-only: provenance is a module-level WeakMap, and a test may need it empty. */\nexport function isTracked(row: unknown): boolean {\n return provenanceOf(row) !== undefined;\n}\n\n/**\n * Value equality for the dirty check. See `changedFields` for why it is not\n * `!==`.\n */\nfunction same(a: unknown, b: unknown): boolean {\n if (a === b) return true;\n\n if (a instanceof Date && b instanceof Date) {\n return a.getTime() === b.getTime();\n }\n\n if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n const left = new Uint8Array(a.buffer, a.byteOffset, a.byteLength);\n const right = new Uint8Array(b.buffer, b.byteOffset, b.byteLength);\n if (left.length !== right.length) return false;\n for (let i = 0; i < left.length; i++) {\n if (left[i] !== right[i]) return false;\n }\n return true;\n }\n\n return false;\n}\n",
|
|
31
31
|
"import { UnsupportedQueryError } from \"./errors\";\nimport type { TrashedMode } from \"./context\";\nimport type { ModelPolicy } from \"./policy\";\nimport type { ModelSchema } from \"./schema\";\n\n/**\n * Soft deletes, as a policy.\n *\n * This ships as a small built-in because it is the proof that the policy hook is\n * expressive enough to be worth having: hiding deleted rows from *every* read\n * including nested ones, and turning a `delete` into an `update`, is the thing\n * ORMs traditionally implement as a special case threaded through the query\n * builder. Here it is thirty lines against the same `ModelPolicy` interface an\n * application writes, with no privileged access to anything.\n *\n * Usage — `deletedAt` must be a nullable `DateTime` on the model:\n *\n * export class User extends UserModel {\n * static $policies = [softDeletes<typeof User>()]\n * }\n *\n * `typeof User` rather than `User`: the class carries `$schema`, which is what\n * constrains `field` to real columns (#262). The instance spelling still\n * compiles and simply checks nothing.\n *\n * await User.findMany({}) // deleted rows are not there\n * await User.expire({ where }) // sets deletedAt, does not remove the row\n *\n * **`User.delete()` is still a hard delete**, and cannot be made otherwise —\n * see the note on #263 above `softDelete` below. The policy scopes reads; it is\n * the wrapper that rewrites a write, and the wrapper cannot be named `delete`.\n *\n * Composing it with a policy of your own is now just a longer list, in the order\n * they should apply:\n *\n * static $policies = [softDeletes<typeof User>(), new TenantPolicy()]\n *\n * That ordering is the author's, and within a class it is the array's. Across\n * classes `policiesFor` still walks base to derived, so a `$policies` on a\n * shared base is applied before a subclass's and can only be narrowed further.\n *\n * It stays a **factory** rather than a class because it takes configuration and\n * a model type parameter, and a bare constructor in a `$policies` array has\n * nowhere to put either. `PolicyEntry` accepts both forms for exactly this\n * reason.\n */\n\n/**\n * The column names a model *class* declares, read off its generated `$schema`.\n *\n * This is the part of #262 that made it worth doing. The old constraint was\n * `keyof M & string` against an **instance** type, which is not a column check:\n * `softDeletes<User>({ field: \"save\" })` compiled clean and then raised\n * `UnknownFieldError` at runtime, because `save` is a method. Reading\n * `$schema.fields` instead asks the schema what the columns are, so the check\n * and the runtime error now disagree about nothing.\n *\n * It works because the generator emits `satisfies ModelSchema` rather than a\n * `: ModelSchema` annotation — see `bin/orm/emit.ts`. An annotation would widen\n * `fields` to `Record<string, FieldSchema>` and `keyof` it back to `string`.\n *\n * **Falls back to `string` rather than to `never`.** A caller can pass anything\n * that behaves like a model — the structural fakes in `soft-deletes.test.ts` do\n * — and those carry no literal schema. Degrading to unchecked keeps them\n * working; degrading to `never` would reject every `field` they pass.\n */\nexport type SchemaFields<M> = M extends { $schema: { fields: infer F } }\n ? Extract<keyof F, string> extends never\n ? string\n : Extract<keyof F, string>\n : string;\n\n/**\n * The row a model class describes, so one type parameter can carry both.\n *\n * `softDeletes` hands its parameter to `ModelPolicy`, which uses it as the\n * **row** type — `redact` is called with a `Partial` of it. The schema, though,\n * hangs off the *class*. Taking the class and recovering the row through\n * `prototype` is what lets one spelling supply both, and it is the mechanism\n * #243 found and recorded rather than a new invention.\n *\n * An instance type has no `prototype`, so `softDeletes<User>()` still resolves\n * to `User` and keeps compiling — it simply gets no field checking, because an\n * instance type is not where the column names live.\n */\ntype RowOf<M> = M extends { prototype: infer Row } ? Row : M;\n\n/**\n * **The parameter is still the model type, not the field union.**\n *\n * `SoftDeleteOptions` is exported, so an application can annotate with it —\n * `const opts: SoftDeleteOptions<User> = …`. Constraining the parameter to\n * `extends string` and taking the union directly read more honestly from inside\n * this file and broke every such annotation from outside it, with *\"Type 'User'\n * does not satisfy the constraint 'string'\"*. Keeping the model type and\n * resolving the union here costs nothing and keeps those compiling: a row type\n * has no `$schema`, so it degrades to `string` exactly as it did before, and\n * `SoftDeleteOptions<typeof User>` is the spelling that gains the check.\n */\nexport interface SoftDeleteOptions<M = any> {\n /**\n * The timestamp column. Defaults to `deletedAt`, which the template uses.\n *\n * Constrained to the model's **schema fields** when the model is reachable —\n * `softDeletes<typeof User>()`, `softDelete(User)`, `softDeleteMany(User)` —\n * so a typo, or a column the model does not have, is a compile error instead\n * of an `UnknownFieldError` on the first read.\n *\n * Passing no model leaves it `string`, and therefore unchecked. That is the\n * one spelling that cannot be constrained: there is nothing to constrain it\n * against.\n */\n field?: SchemaFields<M>;\n}\n\n/**\n * The read half: every query is scoped to rows whose delete timestamp is null.\n *\n * It applies to nested relation reads for the same reason every policy does —\n * a relation read is `$exec` on the related model — which is the half that\n * ORM-level soft deletes usually get wrong. A deleted `Account` does not appear\n * under `User.findMany({ include: { accounts: true } })` without anything being\n * written at the include site.\n */\nexport function softDeletes<M = any>(\n options: SoftDeleteOptions<M> = {},\n): ModelPolicy<any, any, RowOf<M>> {\n const field = options.field ?? \"deletedAt\";\n\n const policy: ModelPolicy<any, any, RowOf<M>> = {\n scope: () => ({ [field]: null }),\n\n // A soft-deleted model still creates ordinary rows; the column is left to\n // its own default (null). Present because a policy carrying `scope` with no\n // `onCreate` is refused — deliberately, since for a tenant scope that\n // combination is a half-written policy. Here the pass-through *is* the\n // correct behaviour, so it is stated rather than implied.\n onCreate: (_context, data) => data,\n\n // The same statement for updates, and here it is doing real work rather than\n // satisfying a formality. This policy scopes on `deletedAt`, and\n // `softDelete()` below turns a delete into an update that *writes*\n // `deletedAt` — which is precisely the \"an update moves a row out of the\n // scope that selected it\" shape `ScopeEscapeError` refuses. It is also\n // exactly what soft deleting means, so this policy is the one that gets to\n // say the write is intended.\n //\n // Note it does not authorise anything else: the guard is per policy, so a\n // tenant policy sitting beside this one in `$policies` still has to answer\n // for its own column. That separation is the point of the per-policy check.\n onUpdate: (_context, data) => data,\n };\n\n // Tagged with its column, so a model that also sets `$softDeletes` on the\n // same column does not apply the scope twice — and so `withTrashed` lifts\n // this one too. See `softDeletePolicies`. A symbol, so the policy-shape\n // check (which reads string keys) never sees it.\n return Object.assign(policy, { [POLICY_FIELD]: field });\n}\n\n/**\n * What `softDelete` needs from the model it wraps: the write to delegate to,\n * and the schema to name in a refusal.\n *\n * Structural rather than `typeof Model`, so a caller can pass anything that\n * behaves like one — which is why `$schema` is optional here even though every\n * generated model has it.\n */\ntype SoftDeletable<T, Op extends string> = {\n [K in Op]: (args: any) => Promise<T>;\n} & { $schema?: { name: string } };\n\n/**\n * The write half: rewrites a `delete` into an `update` that sets the timestamp.\n *\n * Kept separate from `softDeletes()` and applied at the call site rather than\n * folded into the policy, because a policy rewrites *arguments* and this\n * changes the *operation* — and `$exec` dispatches on the operation before a\n * policy is consulted. Widening `ModelPolicy` to let a policy swap the\n * operation would make every `$exec` call's meaning depend on a hook, which is\n * a much larger claim than scoping a `where`.\n *\n * export class User extends UserModel {\n * static $policies = [softDeletes<typeof User>()]\n * static expire = softDelete(User)\n * static expireMany = softDeleteMany(User)\n * }\n *\n * **The name is not `delete`, and cannot be** — the reason is below.\n * `User.delete()` stays a hard delete.\n *\n * Both return the row(s) the way the real operations do, and both are still\n * subject to the model's policies, because they go through `update` /\n * `updateMany` — which means the soft-delete scope applies and a\n * `expire({ where })` naming an already-deleted row finds nothing, exactly as\n * a hard delete of a missing row would.\n *\n * Why this does not return the generated `delete`'s own signature — #263.\n *\n * `static delete = softDelete(User)` is the recipe the docs used to teach, and\n * it does not type-check. The obvious repair is to have this return the model's\n * own `delete` type so the override is assignable to what it overrides. That\n * cannot work, and the reason is the language rather than the typing:\n *\n * static delete = softDelete(User)\n * // ^ the type of this member would be read off `User`...\n * // ^ ...whose `delete` is the member being defined\n *\n * TypeScript answers `TS7022: 'delete' implicitly has type 'any' because it\n * does not have a type annotation and is referenced directly or indirectly in\n * its own initializer.` Annotating it does not help either: the annotation has\n * to name `typeof UserModel.delete`, and `softDelete(User)` is then checked\n * against a generic signature it still cannot satisfy.\n *\n * Passing the *base* instead of the subclass would break the cycle and break\n * the feature: `softDelete` delegates to `model.update`, policies are resolved\n * per registered class, and `UserModel` carries none — so the soft-delete scope\n * would not apply and `delete` would hide rows it never filtered.\n *\n * So the recipe changed instead of the types, and `delete` stays a hard delete.\n * `docs/orm.md` says so in the words a reader needs, and\n * `soft-delete.test-d.ts` holds the documented snippet verbatim so it cannot\n * drift back.\n \n */\nexport function softDelete<T, M = any>(\n model: SoftDeletable<T, \"update\"> & M,\n options: SoftDeleteOptions<M> = {},\n): (args: any) => Promise<T> {\n const field = options.field ?? \"deletedAt\";\n\n return (args: any) => {\n assertNoData(model, args, \"delete\");\n return model.update({\n ...args,\n data: { [field]: new Date() },\n });\n };\n}\n\nexport function softDeleteMany<T, M = any>(\n model: SoftDeletable<T, \"updateMany\"> & M,\n options: SoftDeleteOptions<M> = {},\n): (args: any) => Promise<T> {\n const field = options.field ?? \"deletedAt\";\n\n return (args: any = {}) => {\n assertNoData(model, args, \"deleteMany\");\n return model.updateMany({\n ...args,\n data: { [field]: new Date() },\n });\n };\n}\n\n/**\n * A `delete` takes no `data`, so one being present means the caller thinks they\n * are calling something else — most likely they wrote `update` and meant it.\n * Refused rather than silently overwritten by the timestamp.\n */\nfunction assertNoData(\n model: { $schema?: { name: string } },\n args: any,\n operation: string,\n): void {\n if (args?.data === undefined) return;\n\n throw new UnsupportedQueryError(\n \"data\",\n // The real model, not the literal `\"soft delete\"` this used to pass.\n // `UnsupportedQueryError` documents `model` as inspectable, and a string\n // that is not a model name can never be what an application matches on\n // (#112). `$schema` is optional only because the parameter is structural —\n // every generated model carries it.\n model.$schema?.name ?? \"unknown\",\n operation,\n `${operation} takes no 'data' — the soft-delete rewrite supplies it. ` +\n `Call update directly if you meant to change other fields at the same ` +\n `time.`,\n );\n}\n\n// ---------------------------------------------------------------------------\n// `static $softDeletes` — soft deletes as a model setting rather than a policy\n// ---------------------------------------------------------------------------\n\n/**\n * The value of `static $softDeletes`: `true` for a `deletedAt` column, or the\n * column named.\n *\n * **Not a policy, and that is the point (#663).** `Model.asSystem` suspends\n * every `$policies` entry, which is right for authorization and wrong for soft\n * deletes: a soft-deleted row is gone as far as the application is concerned,\n * whoever is asking. An application that runs its data access under `asSystem`\n * therefore never got `softDeletes()`'s scope and hand-wrote `deletedAt: null`\n * on every query — one missed filter was a public data leak. The setting is\n * applied by `$exec` whether or not policies are suspended.\n *\n * It still *rides* the policy machinery — the scope is a `ModelPolicy` built\n * here and appended to the model's chain — because that machinery is what\n * reaches every place a read of the model can hide: nested `include`s under\n * both strategies, `_count`, relation filters and relation orderings. A second\n * mechanism would have to rediscover each of them.\n */\nexport type SoftDeletesSetting<M = any> =\n | boolean\n | {\n /** The timestamp column. Defaults to `deletedAt`. */\n field?: SchemaFields<M>;\n };\n\n/** Marks a `softDeletes()` policy with the column it scopes on. */\nconst POLICY_FIELD = Symbol(\"gemi.orm.softDeletesField\");\n\n/** The column a `softDeletes()` policy scopes on, or `undefined` for any other policy. */\nfunction policyField(policy: ModelPolicy): string | undefined {\n return (policy as { [POLICY_FIELD]?: string })[POLICY_FIELD];\n}\n\n/**\n * The column a model soft-deletes on, or `undefined` when it does not.\n *\n * Validated against the schema on every call — one property read and one\n * lookup — because the failure it prevents is a model that *believes* it hides\n * deleted rows and hides nothing: a misspelt column would otherwise surface as\n * an `UnknownFieldError` naming a field the caller never wrote in a `where`.\n */\nexport function softDeleteField(\n model: { $softDeletes?: SoftDeletesSetting },\n schema: ModelSchema,\n): string | undefined {\n const setting = model.$softDeletes;\n if (setting === undefined || setting === false || setting === null) {\n return undefined;\n }\n\n const field =\n setting === true ? \"deletedAt\" : (setting.field ?? \"deletedAt\");\n const column = schema.fields[field];\n\n if (column === undefined || !column.nullable || column.isList) {\n throw new UnsupportedQueryError(\n \"$softDeletes\",\n schema.name,\n \"softDeletes\",\n column === undefined\n ? `${schema.name} has no '${field}' field to soft-delete on. ` +\n `Set \\`static $softDeletes = { field: \"<column>\" }\\` to name a ` +\n `nullable DateTime column, or add \\`${field} DateTime?\\` to the model.`\n : `'${field}' must be a nullable scalar column to mark a row deleted, ` +\n `and on ${schema.name} it is not.`,\n );\n }\n\n return field;\n}\n\n/**\n * The scope policies for each (column, mode), made once so identity is stable\n * and the per-query cost is a `Map.get`.\n */\nconst scopes = new Map<string, ModelPolicy>();\n\nfunction scopePolicy(field: string, mode: \"hidden\" | \"only\"): ModelPolicy {\n const key = `${mode}:${field}`;\n let policy = scopes.get(key);\n if (policy !== undefined) return policy;\n\n const where =\n mode === \"hidden\" ? { [field]: null } : { [field]: { not: null } };\n\n policy = Object.freeze({\n // **Not on `upsert`.** An upsert's `where` compiles to an `on conflict`\n // target, which cannot carry a predicate — the policy machinery refuses a\n // scope there rather than drop it. For a tenant scope that refusal is right;\n // for soft deletes it would take `upsert` away from every flagged model, and\n // the trashed row really does still hold the unique key the conflict is on.\n // So an upsert sees trashed rows, which is what the database's own unique\n // constraint says too.\n scope: (context: { operation: string }) =>\n context.operation === \"upsert\" ? undefined : where,\n // Pass-throughs, for the reasons `softDeletes()` gives: creating rows is\n // unaffected, and writing the column is what soft deleting and restoring\n // *are* — this scope is the one that gets to say the write is intended.\n onCreate: (_context: unknown, data: any) => data,\n onUpdate: (_context: unknown, data: any) => data,\n }) as ModelPolicy;\n\n scopes.set(key, policy);\n return policy;\n}\n\n/**\n * The policy chain `$exec` applies for a model: its own `$policies` (or none,\n * under `asSystem`) with the soft-delete scope added when the model sets\n * `$softDeletes`.\n *\n * - `mode` undefined hides trashed rows, `\"with\"` adds no scope, `\"only\"`\n * inverts it.\n * - A `softDeletes()` policy on the **same column** is dropped from the chain\n * when the setting is present, so declaring both — the likely shape of a\n * migration from one to the other — neither applies the scope twice nor\n * keeps hiding rows inside a `withTrashed`.\n * - The scope goes **first**: it decides which rows exist at all, so a policy\n * after it only ever sees rows that do.\n */\nexport function softDeletePolicies(\n policies: readonly ModelPolicy[],\n field: string | undefined,\n mode: TrashedMode | undefined,\n): readonly ModelPolicy[] {\n if (field === undefined) return policies;\n\n const rest = policies.some((policy) => policyField(policy) === field)\n ? policies.filter((policy) => policyField(policy) !== field)\n : policies;\n\n if (mode === \"with\") return rest;\n return [scopePolicy(field, mode === \"only\" ? \"only\" : \"hidden\"), ...rest];\n}\n",
|
|
32
|
-
"import type { SQL, TransactionSQL } from \"bun\";\nimport type { DatabaseConnection } from \"../database/Connection\";\nimport { DatabaseManager } from \"../database/DatabaseManager\";\nimport { app } from \"../foundation/app\";\nimport { type BindContext, createBindContext } from \"./compile/fragment\";\nimport {\n currentConnectionName,\n currentTransaction,\n isSystemScope,\n runAsSystem,\n runWithTrashed,\n trashedMode,\n type TrashedMode,\n runAsUser,\n runOnConnection,\n withTransaction,\n} from \"./context\";\nimport {\n type FoldedRelation,\n type NestedWriteStep,\n type RelationExecutor,\n type RelationStrategy,\n attachRelations,\n} from \"./compile/plan-relations\";\nimport { READ_ARGS } from \"./compile/read\";\nimport { resolveStrategy } from \"./compile/strategy\";\nimport { matchUniqueKey } from \"./compile/unique\";\nimport { upsertAbsentConflictKey } from \"./compile/write\";\nimport { dialectFor, type SqlDialect } from \"./dialect\";\nimport {\n assertNoEncryptedFilters,\n decryptFolded,\n decryptRows,\n encryptWriteArgs,\n isEncryptionRaw,\n} from \"./encryption\";\nimport {\n isLenient,\n markLenient,\n parseTypedFolded,\n parseTypedRows,\n typedColumnsOf,\n validateTypedWriteArgs,\n type JsonColumnSpecs,\n type ScalarColumnSpecs,\n} from \"./typed-columns\";\nimport { clockCouldSkew, createProtocolSkewWarner } from \"./protocol-skew\";\nimport {\n LockOutsideTransactionError,\n MissingModelSchemaError,\n RecordNotFoundError,\n UnsupportedQueryError,\n UniqueConstraintError,\n ParameterLimitError,\n UnregisteredPolicyClassError,\n} from \"./errors\";\nimport {\n getOrCompile,\n type ExecOptions,\n type Operation,\n type QueryPlan,\n} from \"./plan\";\nimport {\n applyNestedPolicies,\n applyPolicies,\n applyRedaction,\n currentUser,\n isPreScoped,\n markOrmAuthored,\n markPreScoped,\n markRedactedAs,\n ormAuthoredFields,\n policiesFor,\n policyContext,\n redactedAs,\n NESTED_READ,\n type PolicyEntry,\n type PolicyContext,\n} from \"./policy\";\nimport {\n changedFields,\n provenanceOf,\n resnapshot,\n track,\n untracked,\n} from \"./provenance\";\nimport * as registry from \"./registry\";\nimport {\n softDeleteField,\n softDeletePolicies,\n type SoftDeletesSetting,\n} from \"./soft-deletes\";\nimport type { ModelSchema } from \"./schema\";\n\n/**\n * The base every generated model class extends.\n *\n * `$exec` is the framework's single choke point: it is the only place in the\n * ORM that touches the database, and the public operations on the generated\n * subclasses are one-line delegations to it. Nested relation reads and nested\n * writes recurse through it too. Everything cross-cutting hangs here — the plan\n * cache and constraint-error translation today, ambient transactions in\n * iteration 5, policies in iteration 6, plus slow-query logging and metrics\n * later. One operation that \"just does a quick insert directly\" silently\n * escapes all of it, which is why there is exactly one door.\n *\n * Framework internals take a `$` prefix so they cannot collide with anything an\n * application author adds to a model.\n */\n\n/**\n * Operations whose result is rows of this model (as opposed to a count or an\n * aggregate), and so the ones whose encrypted columns are decrypted.\n */\nconst RETURNS_ROWS = new Set<Operation>([\n \"findUnique\",\n \"findUniqueOrThrow\",\n \"findFirst\",\n \"findFirstOrThrow\",\n \"findMany\",\n \"create\",\n \"update\",\n \"upsert\",\n \"delete\",\n]);\n\n/**\n * The operations in `RETURNS_ROWS` that write. Their rows (and those of the\n * reads they make first, and of their includes) are parsed leniently: see\n * `markLenient`.\n */\nconst WRITES_RETURNING_ROWS = new Set<Operation>([\"create\", \"update\", \"upsert\", \"delete\"]);\n\n/** Operations Prisma raises on when nothing matched, rather than returning null. */\nconst ORTHROW = new Set([\n \"findFirstOrThrow\",\n \"findUniqueOrThrow\",\n // Prisma raises P2025 — \"No record was found for an update\" / \"...a delete\" —\n // rather than returning null, and the differential harness compares the fact\n // of throwing.\n \"update\",\n \"delete\",\n]);\n\n/**\n * `withTransaction` with the connection's configured warning threshold attached.\n *\n * Every transaction the ORM opens goes through here rather than calling\n * `withTransaction` directly, so `database.slowTransactionThreshold` is read in\n * one place instead of at each call site — and a call site added later cannot\n * quietly open a transaction that ignores the setting. `withTransaction` itself\n * takes the threshold as an argument on purpose; it knows nothing about the\n * container, and this is the seam where the two meet.\n *\n * The same argument now carries the connection's **name**: a pool cannot be\n * asked which one it is, and `withTransaction` has to know in order to tell a\n * nested transaction on the same connection (a savepoint) from one on another\n * (a refusal). Taking the whole connection rather than the manager is what\n * makes both come from the same object, so a named connection cannot end up\n * with the default's threshold.\n */\nfunction transact<T>(\n connection: DatabaseConnection,\n fn: (tx: TransactionSQL) => Promise<T>,\n): Promise<T> {\n return withTransaction(connection.sql, fn, {\n slowTransactionThreshold: connection.config.slowTransactionThreshold,\n connection: connection.name,\n });\n}\n\n/**\n * The classes `Model.on` has already built, keyed by the class it was called on\n * and then by connection name.\n *\n * `User.on(\"analytics\")` is a per-query call, so it can happen in a loop and in\n * a hot path; minting a class each time would allocate one per query and defeat\n * every identity comparison downstream — the policy-divergence guard's\n * `registered !== this` among them, which would then run `policiesFor` against\n * a class it had never seen before on every call.\n *\n * A `WeakMap` on the outside so a model class that goes out of scope takes its\n * bound variants with it, which matters for tests that define models inline.\n */\nconst boundToConnection = new WeakMap<object, Map<string, typeof Model>>();\n\nexport abstract class Model {\n /**\n * Protected, so `new UserModel()` is a type error.\n *\n * Not stylistic. The generated bases merge the row's columns into their\n * instance type via a same-named interface, which is what lets a method on a\n * subclass read `this.email` — and the cost of declaration merging is that\n * TypeScript does not check those properties are ever initialised. A directly\n * constructed instance would therefore type as carrying every column while\n * holding none.\n *\n * Closing the constructor removes that hazard rather than documenting it: the\n * only way to get an instance is `wrap`, which assigns a complete row. Every\n * other operation returns plain objects and never constructs one.\n */\n protected constructor() {}\n\n /** Assigned by the generated subclass from `app/models/generated/schema.ts`. */\n static $schema: ModelSchema;\n\n /**\n * Set to `true` by the generator on each base it emits, and by nothing else.\n *\n * `registerModels` has to tell a generated base from an application class\n * written over it, because when both are in one namespace the subclass is the\n * one that must own the name — electing the base *is* #316's leak. It used to\n * answer that by asking whether a class declared `$schema` itself, which is an\n * inference about how the generator happens to be written rather than a\n * statement by the generator, and a subclass that redeclared `static $schema`\n * read as a base because of it. This is the generator saying so.\n *\n * **`declare`, and it has to stay `declare`.** The property must not exist on\n * `Model` at runtime: `isGeneratedBase` reads `\"$generated\" in candidate` to\n * decide whether the artifacts in front of it carry the mark at all, and falls\n * back to the old inference for artifacts generated before this existed. A\n * `Model.$generated` of `undefined` would answer that question `true` for\n * every class, in every app, including the ones with no mark to read.\n * `registration.test.ts` pins it.\n *\n * **`?: true` and not `?: boolean`**, which is what makes a hand-written\n * `static $generated = false` the type error `isGeneratedBase` reads it as.\n * The cost is that the generator has to emit a non-widening initialiser —\n * `static readonly $generated = true`, since a mutable one widens to\n * `boolean` and every emitted class becomes a TS2417. That happened;\n * `tsconfig.generated.json` is the check that catches it now.\n */\n declare static $generated?: true;\n\n /**\n * The model's own policies, in the order they should apply.\n *\n * A list rather than the single `$policy` this replaced, because composition\n * is the normal case and the two ways of expressing it against one slot were\n * both bad. Spreading (`{ ...softDeletes(), ...mine }`) silently drops\n * whichever `scope` came first, and an intermediate base class per combination\n * means one throwaway class for every model a shared policy applies to — the\n * generated bases all differ, so a `TenantScoped` used on three models needed\n * three of them.\n *\n * Each level of the prototype chain contributes its own array and they\n * concatenate base first, so a shared model base can still impose a policy\n * that a subclass can only narrow. See `policiesFor`.\n *\n * Entries may be policy objects or classes; a class is instantiated once. The\n * generated `<Model>Policy` type gives an object literal here full contextual\n * typing, which a bare `$policies = [...]` does not get on its own.\n */\n static $policies?: readonly PolicyEntry[];\n\n /**\n * Make `skipIfUnchanged: true` the default for this model's `update` and\n * `updateMany` (#664): a row whose assigned columns already hold the values\n * being written is not written, so its `@updatedAt` keeps meaning \"last real\n * change\".\n *\n * export class AsyncJob extends AsyncJobModel {\n * static $skipNoopUpdates = true;\n * }\n *\n * A call can still opt out with `skipIfUnchanged: false`. Applies to the\n * calls an application makes, not to the updates the ORM issues itself for a\n * nested relation write — those keep their exact row counts.\n */\n static $skipNoopUpdates?: boolean;\n\n /**\n * Schemas for the model's `Json` columns (#995): each column is parsed on\n * every read and validated on every write.\n *\n * export class PageBrief extends PageBriefModel {\n * static $json = {\n * heroes: s.array(HeroSchema),\n * styles: { schema: s.array(StyleSchema), invalid: \"null\" },\n * };\n * }\n *\n * Read from the class registered under the model's name, so the generated\n * base and `Model.on(...)` variants parse the same columns. The row types\n * follow through `gemi.d.ts` (`JsonColumns`). See `orm/typed-columns.ts`.\n */\n static $json?: JsonColumnSpecs;\n\n /**\n * Schemas for the model's scalar (`String`) columns (#1001), the sibling of\n * `$json`: each column is parsed on every read and validated on every\n * write, so an id into a code-side catalogue reads as the catalogue's union.\n *\n * export class Website extends WebsiteModel {\n * static $columns = {\n * designStyle: { schema: s.enum(DESIGN_STYLE_IDS), invalid: \"null\" },\n * };\n * }\n *\n * `where` keeps the column's own filter. The row types follow through\n * `gemi.d.ts` (`ScalarColumns`). See `orm/typed-columns.ts`.\n */\n static $columns?: ScalarColumnSpecs;\n\n /**\n * The connection this class's operations run on, set only by `on` below.\n *\n * `undefined` — which is what every model an application writes has — means\n * *the ambient connection*, not *the default one*. The two differ inside\n * `DB.connection(\"analytics\").transaction(...)`, where an unqualified query\n * has to join the open transaction rather than quietly reach for the hot\n * path's pool.\n */\n static $connection?: string;\n\n /**\n * The same model, reading and writing on a named connection.\n *\n * const rows = await Subscription.on(\"analytics\").findMany({ where })\n *\n * **Per query, not per model**, which is the shape the problem actually has:\n * the same `Subscription` is read on the hot path during sign-in and swept by\n * the nightly audit. A `static $connection = \"analytics\"` on the class would\n * force one of those two to be wrong, so the choice lives at the call site\n * and every query that does not make it stays on the default connection.\n *\n * What it returns is the model class with the connection bound to it, so the\n * whole typed surface — all fifteen operations, `transaction`, `save` — is\n * there unchanged and narrows exactly as it does on the class itself. The\n * connection reaches nested `include` reads and nested writes as well, which\n * an argument on `findMany` could not have done: those recurse through the\n * *target* model's `$exec` by way of the registry, so it is carried in the\n * ambient scope rather than in anyone's parameter list.\n *\n * **A transaction cannot span connections.** Naming one inside a transaction\n * open on another raises `CrossConnectionTransactionError` rather than\n * running the statement outside the transaction, where it would survive the\n * rollback. See that error for why refusing is the only honest answer.\n *\n * An unknown name raises `UnknownConnectionError` at the query, not here:\n * `on` is a pure lookup and does not resolve the container, so a model bound\n * in a module's top-level scope cannot force the database open at import\n * time.\n */\n static on<T extends typeof Model>(this: T, connection: string): T {\n let byName = boundToConnection.get(this);\n if (byName === undefined) boundToConnection.set(this, (byName = new Map()));\n\n const cached = byName.get(connection);\n if (cached !== undefined) return cached as T;\n\n // A subclass rather than a Proxy. Both would forward the operations, but a\n // subclass *is* a class: `policiesFor` walks the prototype chain with\n // `Object.hasOwn`, the generated statics are inherited by the language\n // rather than by a trap, and `$exec`'s `this` needs no special handling to\n // stay bound to it.\n const bound = class extends (this as unknown as typeof Model) {\n static $connection = connection;\n };\n\n // Otherwise the class expression takes its name from the binding above and\n // every error that names the model says \"bound\". `UnregisteredPolicyClassError`\n // reads `this.name` in particular, and it is exactly the kind of message\n // that has to name the class the caller wrote.\n Object.defineProperty(bound, \"name\", {\n value: (this as { name: string }).name,\n configurable: true,\n });\n\n byName.set(connection, bound);\n return bound as unknown as T;\n }\n\n /**\n * Runs `fn` with policies suspended, for code that has no user and knows it:\n * a cron tick, a queue worker, a seed script, a migration.\n *\n * Deliberately a wrapper rather than a flag or a fallback. Under\n * deny-by-default the alternative to writing this is an error, which is the\n * point — unscoped access is a sentence someone typed, never what happens\n * when a user fails to turn up.\n *\n * await Model.asSystem(() => User.findMany({}))\n */\n static asSystem<T>(fn: () => Promise<T>): Promise<T> {\n return runAsSystem(fn);\n }\n\n /**\n * Runs `fn` with policies scoped to `user`, for code that acts on somebody's\n * behalf without a request to read them from — a queue job, a scheduled\n * report, a test.\n *\n * The narrow counterpart to `asSystem`, and deliberately the easier of the\n * two to reach for. A worker handling \"send the invoice for organisation 7\"\n * acts *as* a user; giving it only `asSystem` would suspend policies outright\n * and leave it hand-scoping every query, which is the unscoped-by-accident\n * outcome deny-by-default exists to prevent.\n *\n * await Model.asUser(owner, () => Invoice.findMany({}))\n */\n static asUser<T>(user: unknown, fn: () => Promise<T>): Promise<T> {\n return runAsUser(user, fn);\n }\n\n /**\n * Soft deletes as a model setting (#663): every read, `count`, aggregate,\n * update and delete on this model skips rows whose timestamp column is set —\n * including the nested reads another model makes of it (`include`, `_count`,\n * relation filters and orderings) under either relation strategy.\n *\n * export class PriceOffer extends PriceOfferModel {\n * static $softDeletes = true; // `deletedAt`\n * // static $softDeletes = { field: \"archivedAt\" };\n * }\n *\n * **Unlike the `softDeletes()` policy it survives `Model.asSystem`.** That\n * suspends authorization; it does not resurrect deleted rows. Opt out per\n * call with {@link withTrashed} / {@link onlyTrashed}, which keep every other\n * policy in force.\n *\n * `delete()` stays a hard delete — see `softDelete` in `soft-deletes.ts` for\n * the recipe that turns one into an update, which this setting scopes like\n * any other update. `upsert` is not scoped: its conflict target is a unique\n * key, and a trashed row still holds it.\n */\n static $softDeletes?: SoftDeletesSetting;\n\n /**\n * Set on the subclass `withTrashed()` / `onlyTrashed()` return. Not for\n * applications to write: the methods are the interface.\n */\n declare static $trashed?: TrashedMode;\n\n /**\n * Includes soft-deleted rows. Two spellings:\n *\n * await PriceOffer.withTrashed().findMany({ where }) // this query\n * await PriceOffer.withTrashed(() => // a block\n * Order.findMany({ include: { offer: true } }),\n * )\n *\n * The chain lifts the scope for the query it starts — the root model only.\n * The block lifts it for every query on this model inside `fn`, which is the\n * spelling that reaches a nested read *of* this model from another one.\n *\n * Only the soft-delete scope is lifted: tenant scopes and every other\n * `$policies` entry still apply, which is what `asSystem` could not offer.\n */\n static withTrashed<T extends typeof Model>(this: T): T;\n static withTrashed<R>(fn: () => Promise<R>): Promise<R>;\n static withTrashed(fn?: () => Promise<unknown>): unknown {\n return trashedView(this, \"with\", fn);\n }\n\n /** Reads soft-deleted rows only. Same two spellings as {@link withTrashed}. */\n static onlyTrashed<T extends typeof Model>(this: T): T;\n static onlyTrashed<R>(fn: () => Promise<R>): Promise<R>;\n static onlyTrashed(fn?: () => Promise<unknown>): unknown {\n return trashedView(this, \"only\", fn);\n }\n\n /**\n * Clears the timestamp on one soft-deleted row and returns it.\n *\n * Scoped to trashed rows, so a `where` naming a row that is not deleted is a\n * miss and raises `RecordNotFoundError` — the same answer `expire` gives for\n * a row that already is. Takes `delete`'s arguments: a unique `where` and an\n * optional projection.\n */\n static restore<C extends typeof Model & { delete(args: any): Promise<any> }>(\n this: C,\n args: Parameters<C[\"delete\"]>[0],\n ): ReturnType<C[\"delete\"]> {\n // Through a promise, so a model that does not soft-delete rejects like\n // every other failed operation rather than throwing before one exists.\n return Promise.resolve().then(() => {\n const field = requireSoftDeletes(this, \"restore\");\n return runWithTrashed(this.$modelSchema().name, \"only\", () =>\n this.$exec(\"update\", { ...(args as object), data: { [field]: null } }),\n );\n }) as ReturnType<C[\"delete\"]>;\n }\n\n /** {@link restore} for every trashed row matching `where`; returns the count. */\n static restoreMany<\n C extends typeof Model & { deleteMany(args?: any): Promise<any> },\n >(\n this: C,\n args?: Parameters<C[\"deleteMany\"]>[0],\n ): Promise<{ count: number }> {\n return Promise.resolve().then(() => {\n const field = requireSoftDeletes(this, \"restoreMany\");\n return runWithTrashed(this.$modelSchema().name, \"only\", () =>\n this.$exec(\"updateMany\", {\n ...(args as object | undefined),\n data: { [field]: null },\n }),\n );\n }) as Promise<{ count: number }>;\n }\n\n /**\n * Persists the changes made to a *tracked* row: `update` with only the columns\n * whose value differs from what was fetched.\n *\n * const user = await User.findUnique({ where: { id } }, { track: true })\n * user.name = \"new name\"\n * await User.save(user) // update \"User\" set \"name\" = ?, … where \"id\" = ?\n *\n * Most of Eloquent's write ergonomics while returns stay plain objects — no\n * proxies, no conditional return types, no signature that changes with a flag.\n * That is invariant 5's whole claim, and this is the thing that tests it.\n *\n * Goes through `$exec(\"update\", …)` rather than around it, so policies,\n * `@updatedAt`, the ambient transaction and the plan cache all apply exactly as\n * they do to a hand-written update. The changed-column *set* is the plan's\n * shape and the values are parameters, so two saves touching the same columns\n * share one plan.\n *\n * Returns `null` when nothing changed, having issued no statement — a save of\n * an untouched row should not stamp `@updatedAt`.\n *\n * Raises when handed an object with no provenance. See `untracked` for why\n * that is a loud failure rather than a fallback to writing everything.\n *\n * **It writes back to the connection the row was read on**, which is the one\n * place a connection cannot be resolved from the ambient scope: a row read on\n * `analytics` is an ordinary object that outlives the scope that produced it,\n * and by the time it is saved — three functions later, from code that never\n * named a connection — the scope is gone. So the connection is part of the\n * row's provenance, exactly as the model and the primary key are, and for the\n * same reason. Left to the ambient default, `save` compiled a correct\n * `update` and sent it to the wrong database, where the same id usually names\n * a real and different row.\n *\n * Naming a *different* connection explicitly — `User.on(\"default\").save(row)`\n * for a row read on `analytics` — is a contradiction rather than an\n * instruction, and raises. Copying a row between connections is a write in\n * its own right: say it with `update`, where the `where` and the `data` are\n * both visible.\n */\n static async save<T extends object>(row: T): Promise<unknown> {\n const schema = this.$modelSchema();\n const record = provenanceOf(row);\n\n if (!record) throw untracked(row, schema.name);\n\n if (record.model !== schema.name) {\n throw new UnsupportedQueryError(\n \"save\",\n schema.name,\n \"save\",\n `This row came from ${record.model}, not ${schema.name}. Save it ` +\n `through the model it was read from.`,\n );\n }\n\n if (\n this.$connection !== undefined &&\n this.$connection !== record.connection\n ) {\n throw new UnsupportedQueryError(\n \"save\",\n schema.name,\n \"save\",\n `This row was read on the \"${record.connection}\" connection and this ` +\n `save names \"${this.$connection}\". A save writes the row back where ` +\n `it came from, so the two cannot both be honoured. Drop the ` +\n `\\`on(\"${this.$connection}\")\\`, or write it as an explicit ` +\n `${schema.name}.on(\"${this.$connection}\").update({ where, data }) if ` +\n `copying it across connections is what you meant.`,\n );\n }\n\n // A row selected without its primary key has `key = { id: undefined }`, and\n // `matchUniqueKey` drops undefined members — so the update fails with\n // \"update needs a unique field\", pointing at a `where` the caller never\n // wrote. Named here instead, where the actual mistake is knowable: this can\n // only mean the select omitted the key.\n const missingKey = schema.primaryKey.filter(\n (name) => record.key[name] === undefined,\n );\n if (missingKey.length > 0) {\n throw new UnsupportedQueryError(\n \"save\",\n schema.name,\n \"save\",\n `This row was fetched without ${missingKey.join(\", \")}, so there is no ` +\n `way to identify which row to update. A tracked row needs its primary ` +\n `key: add ${missingKey.map((name) => `${name}: true`).join(\", \")} to ` +\n `the select, or drop the select to fetch every column.`,\n );\n }\n\n const changed = changedFields(row, schema);\n if (Object.keys(changed).length === 0) return null;\n\n // On the row's own connection, entered here rather than left to `$exec`:\n // `$exec` resolves the *ambient* name, and the whole point is that the row\n // outlived the scope that read it. Inside a transaction on another\n // connection this raises `CrossConnectionTransactionError` from `$exec`,\n // which is the correct answer — that update cannot join the transaction, so\n // it must not run at all.\n const updated = await runOnConnection(record.connection, () =>\n this.$exec(\"update\", {\n where: record.key,\n data: changed,\n }),\n );\n\n // Copy the *returned* row back over the caller's, not just the values sent.\n //\n // `@updatedAt` is stamped by the compiler and is therefore never in\n // `changed`, so without this the in-memory row keeps the timestamp it was\n // fetched with while the database holds a newer one — a caller reading\n // `user.updatedAt` after a successful save silently gets the old instant. The\n // same applies to anything else the database rewrote.\n //\n // Resnapshotting from the same source is what keeps the row and its snapshot\n // in agreement, so a second `save` is still a no-op.\n if (updated && typeof updated === \"object\" && !Array.isArray(updated)) {\n const fresh = updated as Record<string, unknown>;\n const target = row as Record<string, unknown>;\n const persisted: Record<string, unknown> = {};\n\n for (const name of Object.keys(fresh)) {\n if (!(name in schema.fields)) continue;\n target[name] = fresh[name];\n persisted[name] = fresh[name];\n }\n\n resnapshot(row, persisted);\n } else {\n resnapshot(row, changed);\n }\n\n return updated;\n }\n\n /**\n * Turns a **complete** row into an instance of this class, for code that wants\n * behaviour rather than data.\n *\n * const user = User.wrap(await User.findUniqueOrThrow({ where: { id } }))\n * user.displayName // a method on your subclass\n * await user.save()\n *\n * Explicit, never implicit, and that is the whole design. The moment queries\n * hydrate by default, the `select` conflict comes back: a method that reads\n * `this.email` on a row fetched as `select: { id: true }` is a runtime crash\n * the type system cannot see. Keeping `wrap` a call the author makes means\n * narrowing and behaviour never meet.\n *\n * **Completeness is required, and the requirement is not arbitrary.** The\n * generated signature takes the full scalar payload, so a `Pick` of it is a\n * compile error rather than a runtime surprise (there is a type test for\n * exactly that). It is the same constraint that makes `save()` work on the\n * result: a complete row is one this can snapshot in full, so an instance is\n * tracked without the caller asking. The type constraint and the save\n * capability are one constraint, not two.\n *\n * Note the instance is a *copy*: mutating it does not touch the row that was\n * passed in, and `save()` diffs against what `wrap` received.\n */\n static wrap(row: object): any {\n const schema = this.$modelSchema();\n const instance = new (this as unknown as new () => any)();\n\n Object.assign(instance, row);\n // Tracked on the instance, not the argument — `save()` on the instance has\n // to diff against the values it was constructed from.\n //\n // The connection is the argument's, when the argument has one. `wrap` runs\n // *after* the query's scope has closed, so the ambient name here is\n // whatever the caller happens to be in — usually the default — and a row\n // read on `analytics` would be wrapped into an instance whose `save()`\n // wrote to the hot path. Taken in order: an explicit `on`, then where the\n // row actually came from, then the ambient connection for a row that was\n // never tracked at all.\n track(\n instance,\n schema,\n this.$connection ??\n provenanceOf(row)?.connection ??\n currentConnectionName(),\n );\n\n return instance;\n }\n\n /**\n * Persists this instance's changes. The instance counterpart of the static, and\n * a one-line delegation to it so there is one implementation.\n */\n save(): Promise<unknown> {\n return (this.constructor as typeof Model).save(this);\n }\n\n static $modelSchema(): ModelSchema {\n const schema = this.$schema;\n if (!schema) throw new MissingModelSchemaError(this.name);\n return schema;\n }\n\n /**\n * Runs `fn` inside a transaction. Every ORM query in it — at any call depth,\n * through any number of services, including the nested reads an `include`\n * fans out into — joins it automatically.\n *\n * The callback takes **no argument**, and that is the whole feature. Handing\n * back a `tx` would put it in the signature of every function between here\n * and the query, which is precisely the threading Prisma's `$transaction`\n * forces and this exists to remove. If a raw query genuinely needs the\n * handle, `currentTransaction()` hands it over without putting it in anyone's\n * parameter list.\n *\n * Nesting is a savepoint: an inner failure rolls back to it and leaves the\n * outer transaction usable, so a caller that catches keeps going.\n *\n * await User.transaction(async () => {\n * const user = await User.create({ data: { email } })\n * await audit(user) // its queries are in the transaction too\n * })\n *\n * **KNOWN DIALECT ASYMMETRY — catching an error inside a transaction.**\n * The sentence above holds for a *nested* `Model.transaction`. It does not\n * hold for a bare statement: on Postgres any failed statement aborts the\n * whole transaction block, so catching it and carrying on loses everything.\n * SQLite does not care. Verified against Postgres 16 and SQLite:\n *\n * await Model.transaction(async () => {\n * try { await User.create({ data: { email } }) }\n * catch (e) { if (!(e instanceof UniqueConstraintError)) throw e }\n * await Audit.create({ ... }) // fine on SQLite; on Postgres this\n * }) // throws 'current transaction is\n * // aborted', and the whole transaction\n * // is lost\n *\n * That is a bug that passes in development on SQLite and takes out the\n * transaction in production on Postgres, with an error naming neither the\n * statement that failed nor the one that caused it.\n *\n * The fix is already here: wrap the fallible statement in a nested\n * `Model.transaction`, which makes it a savepoint, and rolling back to that\n * savepoint clears the aborted state. Works on both dialects.\n *\n * await Model.transaction(async () => {\n * try {\n * await Model.transaction(() => User.create({ data: { email } }))\n * } catch (e) { if (!(e instanceof UniqueConstraintError)) throw e }\n * await Audit.create({ ... }) // fine on both\n * })\n *\n * **One statement at a time.** Every query in scope runs on one reserved\n * connection, so `Promise.all` over several ORM calls inside the callback is\n * not safe here — the ordinary, encouraged thing everywhere else in a Bun\n * codebase. Await them in sequence. (`$exec` already runs its own nested\n * writes and relation reads sequentially for this reason.)\n *\n * **The connection is held for as long as the callback runs**, including\n * while it awaits things that are not queries. In development a transaction\n * still open after 2s warns — `database.slowTransactionThreshold` sets that\n * bound, or `false` switches it off. In production it just holds the\n * connection. Keep network and filesystem I/O outside.\n */\n // `async`, so that naming a connection this transaction cannot reach —\n // `Subscription.on(\"analytics\").transaction(...)` inside a transaction on the\n // hot path — *rejects* rather than throwing synchronously. The same reasoning\n // `DB.query` records: an API that does one sometimes and the other otherwise\n // is a footgun, and a `.catch()` would miss exactly this error.\n static async transaction<T>(fn: () => Promise<T>): Promise<T> {\n // `Subscription.on(\"analytics\").transaction(...)` opens on that connection,\n // and a bare `Model.transaction` opens on whatever is ambient — which is\n // the default connection unless something outside has already named one.\n // `withTransaction` refuses the mismatch; there is no second check here.\n const name = this.$connection ?? currentConnectionName();\n\n return transact(app(DatabaseManager).connection(name), () =>\n runOnConnection(name, () => fn()),\n );\n }\n\n /**\n * The choke point's outer half: which connection this operation runs on.\n *\n * Split from the body below so that the name is resolved and entered\n * **once**, around everything — the policy pass, the plan lookup, the nested\n * writes and every relation read that recurses back through here. The\n * alternative, resolving it inside, would have left each nested read to\n * rediscover it, and the one that did not would have run against the default\n * connection with no error to show for it.\n *\n * Recursive calls cost a comparison: the ambient name already matches, so\n * `runOnConnection` calls straight through without entering a second scope.\n *\n * `async` for the reason `transaction` is: an operation refused for naming a\n * connection the open transaction cannot reach has to reject like every other\n * failure `$exec` produces, rather than being the one that throws before the\n * promise exists.\n *\n * The cross-connection refusal is `runOnConnection`'s, not repeated here:\n * *entering* the connection is the only moment at which the scope still holds\n * both the open transaction and the name it belongs to, so that is where the\n * comparison has to live.\n */\n static async $exec(\n op: Operation,\n args: any = {},\n options?: ExecOptions,\n ): Promise<unknown> {\n return runOnConnection(this.$connection ?? currentConnectionName(), () =>\n this.$execute(op, args, options),\n );\n }\n\n private static async $execute(\n op: Operation,\n args: any = {},\n options?: ExecOptions,\n ): Promise<unknown> {\n const schema = this.$modelSchema();\n\n // Resolved per call, never captured at module scope: that is what keeps the\n // connection swappable in tests.\n //\n // Through `connection()` rather than off the manager directly, so that a\n // query on a named connection reads *that* pool's client and dialect. The\n // default connection is the manager itself, which is what keeps every\n // existing wrapper of it — the harnesses that Proxy `sql` to count\n // statements — looking at the object this executes through.\n const db = app(DatabaseManager).connection(currentConnectionName());\n const dialect = dialectFor(db.dialect);\n\n // The ambient-transaction hook, and the entire integration. It is one line\n // — and it covers every operation, every nested write and every relation\n // read — only because invariant 1 held: `$exec` is the single door. An\n // operation that acquired a private path to the database would show up\n // here as a statement silently running outside the transaction, committed\n // while its neighbours roll back.\n // `let`, because a multi-statement write opens a transaction of its own\n // further down and every statement after that point — including the\n // `executor.query` closure below, which captures this binding rather than\n // its value — has to run on the new handle rather than back on the pool.\n let conn = currentTransaction() ?? db.sql;\n\n // A row lock outlives its statement only inside a transaction; outside one\n // it is released as the row comes back, before the write it was meant to\n // guard. Refused on every dialect — including SQLite, where the lock\n // compiles to nothing — so a missing transaction fails in development\n // rather than first under load on Postgres. After `runOnConnection`, so a\n // transaction on another connection has already been refused as such.\n if (\n args?.lock !== undefined &&\n READ_ARGS[op]?.has(\"lock\") &&\n currentTransaction() === undefined\n ) {\n throw new LockOutsideTransactionError(schema.name, op);\n }\n\n // POLICIES, AND THE ORDER MATTERS MORE HERE THAN ANYWHERE ELSE IN THE ORM.\n //\n // Policies rewrite the argument tree, so they change the SQL. They must\n // therefore run *before* `getOrCompile`, which keys the plan cache on those\n // arguments. Reordered — compile first, scope after — two users with the\n // same query shape and different scopes would share one plan, and one of\n // them would run the other's SQL. That is a cross-tenant data leak produced\n // by a caching bug, and it would not look like one.\n //\n // A scope that injects a *value* keeps the same shape for every user, so\n // the plan is still shared and only the bound value differs. That is the\n // desired outcome, not a compromise, and `policy.plan-cache.test.ts` pins\n // both halves: same shape means one plan and different parameters, and a\n // scope whose shape varies by user means a different plan key.\n // `asSystem` suspends the whole hook, not just the no-user check: a script\n // that has said it is a script should not then be scoped to a user that\n // happens to be in the request store.\n const system = isSystemScope();\n\n // The registered class, looked up once: the divergence guard below needs it,\n // and so does the soft-delete setting when the caller queried the generated\n // base rather than the class that declares it.\n const registered = registry.has(schema.name)\n ? registry.get<unknown>(schema.name)\n : undefined;\n\n // `$softDeletes` (#663) is applied **under `asSystem` too** — it is a fact\n // about the data, not an authorization rule. Read off the queried class\n // when it says anything, and off the registered one otherwise, so querying\n // `PriceOfferModel` where `PriceOffer` owns the name still hides deleted\n // rows: the safe direction for the same split the divergence guard covers.\n const softField = softDeleteFieldOf(this, schema, registered);\n const ownPolicies = system ? [] : policiesFor(this);\n const policies = softDeletePolicies(\n ownPolicies,\n softField,\n (this as { $trashed?: TrashedMode }).$trashed ?? trashedMode(schema.name),\n );\n let policy: PolicyContext | undefined;\n let effective = args;\n\n // POLICY-DIVERGENCE GUARD.\n //\n // A nested relation read resolves its target through the registry, so it\n // runs whatever is registered under this model's name — not necessarily the\n // class the caller queried. When those two disagree about *policies*, the\n // same policy applies to some queries and not others, silently. Both\n // directions are reachable and both are the same bug:\n //\n // policied class not registered -> root scoped, nested reads unscoped\n // policied class registered, but -> nested reads scoped, a direct query\n // the caller queries the base through the base unscoped\n //\n // The second is the one this check sat inside `policies.length > 0` and\n // therefore missed: querying `AccountModel` when `Account` owns the name\n // finds no policies on `AccountModel`, so the old placement never looked.\n // `AccountModel` and `Account` come out of the same barrel with near\n // identical names, so it needs no include and no mistake worth calling one.\n //\n // Keyed on the *divergence*, not on either class having policies. The\n // comparison is of the resolved policy chain rather than class identity: a\n // plain subclass of a registered, policied class inherits the same policy\n // objects in the same order, so nothing diverges and there is nothing to\n // refuse — checking identity rejected `class AdminUser extends User {}`, a\n // typed view, for policies it had not written.\n //\n // `!system` is load-bearing. Under `asSystem` policies are suspended by\n // design, so a seed script querying the generated base directly is correct\n // and must not raise.\n //\n // Cost on the common path: one `Map.get` and one reference compare, for a\n // model where nothing is registered under a different class.\n //\n // `inheritsPoliciesFrom` keeps that true for `Model.on(name)`, whose bound\n // subclass is never the registered class and so failed the reference\n // compare on *every* query — leaving each one to resolve the registered\n // chain and walk it twice to reach the same conclusion. A direct subclass\n // that declares no policies of its own has, by construction, the chain its\n // parent has: there is nothing to compare.\n if (!system) {\n if (\n registered !== undefined &&\n registered !== this &&\n !inheritsPoliciesFrom(this, registered)\n ) {\n const theirs = policiesFor(registered);\n const diverges =\n ownPolicies.length !== theirs.length ||\n ownPolicies.some((entry, index) => entry !== theirs[index]);\n\n if (diverges) {\n throw new UnregisteredPolicyClassError(\n schema.name,\n (registered as { name?: string }).name ?? String(registered),\n this.name,\n ownPolicies.length > 0 ? \"queried\" : \"registered\",\n );\n }\n }\n }\n\n // NESTED policies, applied to the argument tree before the plan key.\n //\n // A nested read under the batched strategy would acquire its own policies by\n // recursing through the child's `$exec` — but a lateral join has no such call,\n // so the child's policies would never be consulted and the subquery would be\n // unscoped. Applying them here, on the args, keeps the compiler pure and makes\n // the scope part of whatever SQL a strategy chooses to emit. See\n // `applyNestedPolicies` and `plans/orm/09-lateral-strategy.md`.\n //\n // `preScoped` is how the double application is avoided: the relation executor\n // marks its recursive calls, so a child whose args arrived already scoped does\n // not scope them again. Without it a batched include would `AND` the same\n // predicate twice — the same rows, but different SQL and a different plan key.\n const preScoped = isPreScoped(options);\n\n //\n // **Under `asSystem` too, but carrying only the soft-delete scopes.** The\n // walk is how a nested read gets its target's scope — and under the batched\n // strategy the child's own `$exec` is marked pre-scoped and skips it — so\n // skipping the walk would leave a deleted row reachable through any\n // `include`. The walk is told `system: false` because it is handed only\n // what should apply; `asSystem` has already removed the rest.\n if (!preScoped) {\n effective = applyNestedPolicies(\n schema,\n effective,\n currentUser(),\n false,\n (model) => {\n if (!registry.has(model)) return undefined;\n const target = registry.get<typeof Model>(model);\n const targetSchema = target.$schema;\n if (!targetSchema) return undefined;\n return {\n policies: softDeletePolicies(\n system ? [] : policiesFor(target),\n softDeleteField(target, targetSchema),\n trashedMode(targetSchema.name),\n ),\n schema: targetSchema,\n };\n },\n );\n }\n\n // `upsert` whose `create` does not set the conflict key, which used to\n // raise — and which is decided **before** policies are applied, on purpose.\n //\n // The last of iteration 4's three \"not before iteration 5\" items. That note:\n // \"Prisma means find-then-write there; expressing that takes a read and a\n // write inside one transaction, which is iteration 5's.\"\n //\n // Checked against a generated Prisma 6 client rather than reasoned about,\n // because the semantics are surprising: `upsert({ where: { publicId: \"X\" },\n // create: { email } })` inserts a row whose `publicId` is **generated**, not\n // \"X\". The `where` selects; it does not contribute to the insert.\n //\n // **`on conflict` is kept wherever it works.** It is one atomic statement,\n // and read-then-write is not — two callers can both miss and both insert.\n // Prisma's upsert has that race and this inherits it, but only on calls that\n // previously raised: nothing that worked becomes racy.\n //\n // **Before policies, and that is what lets a scoped model upsert at all.**\n // `assertScopable` refuses to put a scope on an `upsert`, because its where\n // becomes an `on conflict` target and a target cannot carry a predicate.\n // That reason is exactly true of the `on conflict` path and false of this\n // one, which is three ordinary statements. Deciding here means the three run\n // as `findFirst`, `create` and `update`, each scoped normally by its own\n // `$exec` — so this branch is *not* marked pre-scoped, and a policied model\n // gets a working upsert instead of a refusal whose justification expired.\n //\n // A policy that branches on `context.operation` therefore sees the three it\n // actually runs rather than the one the caller named. That is the honest\n // reading: the operation really is three statements here.\n if (op === \"upsert\" && !preScoped && findThenWrite(schema, args, op)) {\n const { where, create, update, ...projection } = args;\n\n // Marked ORM-issued so a `$skipNoopUpdates` model's default does not\n // reach the `update` half: `upsert` takes no `skipIfUnchanged`, and its\n // one-statement `on conflict` form could not honour one.\n const inner = markLenient(markOrmIssued({ ...options })) as ExecOptions;\n\n return transact(db, async () => {\n const found = await this.$exec(\"findFirst\", { where }, inner);\n\n return found === null\n ? await this.$exec(\"create\", { data: create, ...projection }, inner)\n : await this.$exec(\n \"update\",\n { where, data: update, ...projection },\n inner,\n );\n });\n }\n\n if (policies.length > 0) {\n // Deny-by-default lives on the context's `user` accessor, not here: a\n // policy that never consults the user — a soft-delete scope, say — has\n // nothing to deny and must keep working with no request in sight. See\n // `policyContext`.\n //\n // `redactedAs` is the one thing that can make `context.operation` differ\n // from `op`, and it exists to *remove* a difference the caller can see: a\n // `delete` that has to read before it writes runs its pre-read as a\n // `findFirst` and hands that row back, so without this a `redact` keyed on\n // `\"delete\"` stopped firing the moment the call also carried an `include`\n // (#366). The row is the delete's return value; it is redacted as one.\n //\n // **Only on a pre-scoped call, which is what keeps it a redaction\n // concern.** `applyPolicies` below is skipped when `preScoped`, so on the\n // one call that sets this marker the context reaches nothing but\n // `applyRedaction`. Reading the marker unconditionally would leave a\n // shape — a future non-pre-scoped caller — where a `before` or a `scope`\n // could be handed an operation the statement is not, and `SCOPABLE` is\n // keyed on exactly that. The guard does not make that shape\n // unconstructible — `markRedactedAs(options, \"delete\")` on its own is\n // still a value anyone can build — it makes it *unread*, so the\n // consequence is absent rather than the shape. That is the whole of what\n // is claimed, and it is enough: the marker changes nothing on any call\n // that policies still rewrite.\n policy = policyContext(\n schema.name,\n (preScoped ? redactedAs(options) : undefined) ?? op,\n currentUser(),\n system,\n );\n\n // **The context is built even when pre-scoped; only the rewrite is\n // skipped.** `preScoped` means \"the scope is already in these args\" — not\n // \"this model has no policies\". Guarding the whole block on it left\n // `policy` undefined for every nested relation read, and `policy` is what\n // `applyRedaction` below is keyed on. So a `redact` protected a root query\n // and was skipped inside every `include`: scoped one way, unscoped the\n // other, which is the failure iteration 6 exists to prevent.\n //\n // Only `applyPolicies` is idempotency-sensitive. Re-running it would `AND`\n // the same predicate twice; re-running `redact` on an already-redacted row\n // is a no-op.\n if (!preScoped) {\n effective = applyPolicies(\n policies,\n policy,\n effective,\n ormAuthoredFields(options),\n );\n }\n }\n\n // Encrypted columns (#844), refused as a filter, sort or grouping anywhere\n // in the argument tree — after policies, so a scope cannot slip one in\n // either. The raw mode is `encryption:rotate`'s, comparing envelopes.\n const raw = isEncryptionRaw(options);\n if (!raw) assertNoEncryptedFilters(schema, op, effective);\n\n // Which strategy plans the include tree. Named per call or chosen by\n // `defaultStrategy`, and either way it reaches the plan key — two strategies\n // emit different SQL for the same arguments, so sharing a plan between them\n // would run one request's statement for the other's.\n const strategy = resolveStrategy(options?.strategy, dialect, {\n model: schema.name,\n operation: op,\n });\n\n // `createMany` past the driver's parameter ceiling, which used to raise.\n //\n // Iteration 4 refused to chunk and said why: \"it would make this several\n // statements, which cannot be made atomic until transactions land.\" They\n // landed in iteration 5. So the split happens here, inside one transaction,\n // and the caller gets the same `{ count }` a single statement would have\n // returned.\n //\n // **Only on the call that would otherwise have failed.** The ceiling is\n // checked in `render`, so the ordinary path pays nothing for this — it is a\n // `catch`, not a size check on every write. A `createMany` small enough to\n // compile never enters it.\n if (op === \"createMany\" && Array.isArray(effective?.data)) {\n const chunks = chunkedCreateMany(\n schema,\n effective,\n dialect,\n strategy,\n op,\n );\n\n if (chunks !== null) {\n return transact(db, async () => {\n let count = 0;\n for (const data of chunks) {\n const written = (await this.$exec(\n \"createMany\",\n { ...effective, data },\n markPreScoped({ strategy: options?.strategy }) as never,\n )) as { count: number };\n count += written.count;\n }\n return { count };\n });\n }\n }\n\n // The model-level default for `skipIfUnchanged` (#664), resolved into the\n // arguments so it reaches the plan key like the per-call spelling does.\n // Not for the ORM's own nested-write updates: a `connect` that finds the\n // foreign key already pointing at its target must still count that row.\n if (\n (op === \"update\" || op === \"updateMany\") &&\n this.$skipNoopUpdates === true &&\n effective?.skipIfUnchanged === undefined &&\n !isOrmIssued(options)\n ) {\n effective = { ...effective, skipIfUnchanged: true };\n }\n\n // This model's typed columns (`$json` #995, `$columns` #1001), validated\n // and replaced by their parsed values. Same place and reasons as\n // encryption: after the `createMany` split, and nested writes are\n // validated by their own model. Before encryption, so a typed `String`\n // column that is also encrypted is validated as plaintext.\n const typedColumns = typedColumnsOf(schema, this);\n if (!raw) effective = validateTypedWriteArgs(typedColumns, schema.name, op, effective);\n const lenient = WRITES_RETURNING_ROWS.has(op) || isLenient(options);\n\n // This model's encrypted columns, encrypted. After the `createMany` split\n // above — each chunk re-enters `$exec` and is encrypted there, so doing it\n // first would encrypt twice — and before the plan, though only the bound\n // values change, never the plan's shape. Nested writes into other models\n // are encrypted by those models' own `$exec`.\n if (!raw) effective = encryptWriteArgs(schema, op, effective);\n\n const plan = getOrCompile(schema, op, effective, dialect, strategy);\n\n const executor: RelationExecutor = {\n // `markPreScoped`: this model's policies were already applied to\n // `relationArgs` by the parent's nested walk, so re-applying them here\n // would `AND` the same predicate twice — same rows, different SQL,\n // different plan key. The marker is a module-private Symbol and is not\n // exported, so it cannot become a way for an application to skip policies.\n // The strategy propagates too. Without it a nested `$exec` fell back to\n // `defaultStrategy`, so a query explicitly asking for `batched` got the\n // *default* for every level below the root — on Postgres that meant the\n // grandchild folded anyway and the statement count was one lower than the\n // caller asked for. Found by the query-count test, which is the only thing\n // that could have found it: the results were identical either way.\n exec: (model, operation, relationArgs, preScoped, ormAuthored) => {\n const marked = markOrmIssued(\n preScoped\n ? markPreScoped({ strategy: options?.strategy })\n : { strategy: options?.strategy },\n );\n // A write's includes are read after it was saved: see `markLenient`.\n const base = lenient ? markLenient(marked) : marked;\n return registry\n .get<typeof Model>(model)\n .$exec(\n operation as Operation,\n relationArgs,\n (ormAuthored && ormAuthored.length > 0\n ? markOrmAuthored(base, ormAuthored)\n : base) as never,\n );\n },\n // The one query with no model behind it — the implicit m-n join table —\n // resolves its connection here rather than reaching for the pool, so it\n // joins the transaction like everything else.\n query: (text, values) => conn.unsafe(text, values),\n };\n\n // One context per call, holding the instant every `now()` and `@updatedAt`\n // on this operation shares, plus whatever the `before` steps resolve.\n const context = createBindContext();\n\n // `delete` with an `include` on a **cascading** relation, which returned the\n // children empty until now.\n //\n // The relation reads run after the delete statement, so where the schema\n // declares `onDelete: Cascade` the database has already removed the children\n // by the time they are read. Prisma runs the whole thing in a transaction and\n // returns them as they were. `compileDelete` recorded this as \"not fixable at\n // this layer — the fix is to read the relations before the delete inside one\n // transaction, which is iteration 5's to provide\".\n //\n // Iteration 5 provided it. Read first, delete second, return what was read:\n //\n // - **A transaction, so the pair is atomic.** Without one, a delete that\n // fails after the read would leave the caller holding a row that still\n // exists. Nested inside a caller's transaction it is a savepoint, which is\n // what `withTransaction` already does.\n // - **`markPreScoped` on both**, because `effective` has been through this\n // model's policies once already; re-applying them would `AND` the same\n // predicate twice — same rows, different plan key.\n // - **The read is scoped as the delete was**, including its nested policies.\n // `effective` was rewritten by `applyPolicies` and `applyNestedPolicies`\n // under operation `\"delete\"`, and `markPreScoped` stops the pre-read\n // redoing either — so the `where` the `findFirst` runs is the delete's,\n // predicate for predicate.\n // - **`markRedactedAs`, so the row is redacted as the delete it belongs\n // to.** This bullet used to claim `context.operation` was already\n // `\"delete\"` here. It was not, and the row it was most wrong about was the\n // root one — the one returned. The pre-read is a `findFirst`, so\n // `policyContext` was built with `\"findFirst\"` and a `redact` keyed on\n // `\"delete\"` silently stopped firing as soon as the same call carried an\n // `include` (#366). The `delete` statement below *does* run under\n // `\"delete\"`, and its row is thrown away, so nothing observable came of\n // that half.\n //\n // The marker covers the returned row and nothing else. Nested reads are\n // *scoped* as `findMany` on both strategies — `NESTED_READ` in `policy.ts`\n // is a constant on purpose, because a read of another model is a read\n // whatever statement encloses it — and the marker does not reach them: the\n // relation executor rebuilds its options from `{ strategy }` rather than\n // forwarding these.\n //\n // Which name a nested row is *redacted* as is a second mechanism, and it\n // agrees with the first since #388. Both strategies answer `NESTED_READ`:\n // a **batched** child runs its own `$exec` under it, and a **folded**\n // (lateral, the Postgres default) child is handed the same constant by\n // `redactFolded` below, which redacts it on the parent's behalf because\n // its rows never enter its own `$exec`.\n //\n // Until #388 the folded path built its context from the enclosing\n // `$exec`'s `op` — on this call the pre-read, a `findFirst` — so the same\n // query over the same rows reported `findMany` on SQLite and `findFirst`\n // on Postgres. Neither value was ever the write, which is the part #366 is\n // about and the only part `delete-redact-operation.test.ts` pins under the\n // default strategy; `nested-redact-strategy.test.ts` pins the agreement.\n //\n // Only when there is something to read. A plain `delete` still compiles to\n // one statement and opens no transaction.\n //\n // `plan.counts` is here for the same hazard in its quietest form, and the\n // two dialects disagree about it. A `_count` compiles to a correlated\n // subquery inside the `RETURNING`, and where the schema cascades:\n //\n // postgres delete … returning (select count(*) from ch …) -> 3\n // sqlite delete … returning (select count(*) from ch …) -> 0\n //\n // Measured through Bun against a real `on delete cascade` on both. Postgres\n // evaluates the subquery against the pre-statement snapshot, which is what\n // Prisma returns; SQLite evaluates it after the cascade has run, so the\n // count is 0 — a *number*, so nothing looks missing and no error is raised.\n //\n // Reading first answers it the same way it already answers the `include`\n // case, and on both dialects rather than one. A count is not a relation\n // plan, so `relations` stays empty for an `include: { _count: … }` on its\n // own — hence the separate flag rather than a wider check.\n if (op === \"delete\" && (plan.relations !== undefined || plan.counts)) {\n // **Everything but the `where`, rather than the operands named one by\n // one.** The row this reads is the row the caller gets back — `return\n // before`, below — so an operand left out here is silently un-narrowed,\n // and nothing downstream will notice. That is #364: this rebuilt the\n // projection as `select` *or* `include`, `omit` was not among the names,\n // and a `delete` that asked to drop a column got it back as soon as the\n // same call also carried an `include`. A `delete` with no relation to read\n // never reaches this branch and projects through `resolveSelection`, which\n // had honoured `omit` all along — one operation, two paths, two answers.\n //\n // **Do not turn this back into named arms.** The rest is what makes the\n // next projection operand — Prisma's `relationLoadStrategy`, a `distinct`\n // on a write, whatever it turns out to be — arrive here for free instead\n // of arriving as the same bug with a different column name. The `upsert`\n // find-then-write branch a few hundred lines up spreads for the same\n // reason and was never affected by #364.\n //\n // Bounded, not hopeful. `assertArgs` (`compile/write.ts`) rejects any\n // operand outside `WRITE_ARGS.delete` — `where`, `select`, `include`,\n // `omit` — and the plan above is already compiled, so the rest holds\n // projection operands and nothing else. That set is a strict subset of\n // `findFirst`'s, so every one of them is a legal read operand. `omit` and\n // `select` cannot both be in it: `resolveSelection` refuses that pair, and\n // a warm plan cannot smuggle it past, since both are in `LITERAL_KEYS`\n // (`plan.ts`) and so key separately. An `undefined` operand is dropped from\n // the plan key too, so carrying one costs no second cache entry.\n const { where, ...projection } = effective;\n\n // The pool, not `conn`: when a transaction is already open `withTransaction`\n // savepoints against the ambient handle and ignores this argument, and\n // passing a transaction handle here would read as though we begin on it.\n return transact(db, async () => {\n const before = await this.$exec(\n \"findFirst\",\n { where, ...projection },\n // `op` rather than the literal `\"delete\"`: the branch is guarded on\n // it, so they are the same string, and taking it from the variable\n // keeps the two from drifting if the guard ever admits a second\n // operation that has to read before it writes.\n markLenient(\n markRedactedAs(markPreScoped({ strategy: options?.strategy }), op),\n ) as never,\n );\n\n // `findFirst` shapes a miss to `null`; the caller asked for a delete, so\n // the error has to name that rather than the read this used underneath.\n if (before === null) throw new RecordNotFoundError(schema.name, op);\n\n await this.$exec(\n \"delete\",\n { where },\n markPreScoped({ strategy: options?.strategy }) as never,\n );\n\n return before;\n });\n }\n\n // A write with a nested `create` / `connect` runs more than one statement,\n // and those statements are one unit: the parent row and the children it was\n // asked for either all land or none do.\n //\n // This used to be left to the caller — \"atomic exactly when the caller\n // wrapped the call in `Model.transaction`, *not* implicitly\" — on the\n // reasoning that `$exec` cannot know whether it is one step of a larger unit\n // and that opening one per call would put a `BEGIN` around every query in\n // the framework. The second half of that is right and is why the condition\n // below is what it is; the first half does not survive contact with\n // policies. A nested write step runs the *child's* `$exec`, so the child's\n // policies are consulted mid-sequence, after the parent row is already\n // written. A child that denies therefore left a half-written parent behind,\n // and \"your policy stopped the write\" and \"your policy stopped half the\n // write\" are not the same promise.\n //\n // So: implicit, but only for the calls that are actually multi-statement.\n // A plain `create` still compiles to one statement and opens nothing, which\n // is what keeps the `BEGIN`-around-everything objection answered — and\n // inside a caller's own transaction `withTransaction` takes a savepoint\n // rather than nesting a second one.\n const finish = async (): Promise<unknown> => {\n // Re-resolved rather than reused: if the branch below opened a\n // transaction, every statement from here on belongs to it. Outside one\n // this is the same handle it already was.\n conn = currentTransaction() ?? conn;\n\n await runSteps(plan.before, effective, context, executor, []);\n\n // `unsafe` despite the name. Bun's tagged template cannot express a query\n // whose *shape* is dynamic, which every ORM query is. Safety here does not\n // come from the template syntax: it comes from the compiler's two rules —\n // identifiers only ever come from the generated schema, and every value is\n // a bound parameter. Do not \"fix\" this into a tagged template.\n const rows = await execute(\n conn,\n dialect,\n schema,\n op,\n plan.text,\n plan.bind(effective, context),\n );\n\n const result = this.$shape(plan, rows as unknown[]);\n\n // This model's encrypted columns, decrypted — before anything else reads\n // the rows, so a policy's `redact`, `track`'s snapshot and the caller all\n // see the plaintext. A value that does not decrypt throws.\n if (!raw && RETURNS_ROWS.has(op)) decryptRows(schema, rowsOf(result));\n\n // Then its typed columns (#995, #1001), parsed, so a policy's `redact`\n // and the caller see the schema's values.\n if (!raw && RETURNS_ROWS.has(op)) parseTypedRows(typedColumns, schema.name, rowsOf(result), lenient);\n\n // `skipIfUnchanged` (#664): an `update` that matched its row but changed\n // nothing wrote nothing, so `returning` came back empty. The caller still\n // gets the row, read the way the `delete` pre-read reads one — the same\n // scoped `where`, the same projection, redacted as the `update`. Only a\n // row that does not exist at all is still `RecordNotFoundError`.\n if (result === null && op === \"update\" && effective?.skipIfUnchanged === true) {\n const {\n data: _data,\n skipIfUnchanged: _skip,\n where,\n ...projection\n } = effective;\n const current = await this.$exec(\n \"findFirst\",\n { where, ...projection },\n markLenient(\n markRedactedAs(\n markPreScoped({ strategy: options?.strategy, track: options?.track }),\n op,\n ),\n ) as never,\n );\n if (current === null) throw new RecordNotFoundError(schema.name, op);\n return current;\n }\n\n // The plan shapes a single-row operation to `null` when nothing matched;\n // turning that into an error belongs here rather than in the plan, because\n // this is where the model's name is in scope for the message.\n if (result === null && ORTHROW.has(op)) {\n throw new RecordNotFoundError(schema.name, op);\n }\n\n // Rows that could not exist until this one did: the far side of a relation\n // whose foreign key lives on the child. Run before relations are attached,\n // so an `include` on the same call sees what was just written.\n await runSteps(plan.after, effective, context, executor, rowsOf(result));\n\n // ...and a `_count` on the same call has to be recomputed once they have,\n // for the same reason `include` is attached after them rather than before.\n //\n // A count is a correlated subquery inside the write's own `RETURNING`, so\n // it is evaluated at the instant the parent row is inserted — before any\n // `after` step has written a child. That produced a single response\n // contradicting itself:\n //\n // User.create({ data: { …, accounts: { create: [a, b] } },\n // include: { accounts: true, _count: { … } } })\n //\n // accounts.length 2 attached after the steps\n // _count 0 projected before them\n //\n // Both keys describe the same relation on the same row. The row itself was\n // never wrong — reading it back gives 2 — so this is the projection being\n // frozen, which is the mirror of the `delete` case above: there the count\n // is taken too late, here too early.\n //\n // **Only when there is something to be wrong about.** A write with no\n // `after` steps keeps the projected value and costs nothing extra; one\n // with both pays a single read. `plan.counts` is what makes that condition\n // cheap enough to ask on every write.\n //\n // **Between `runSteps` and the `hidden` deletion, and that is\n // load-bearing.** `select: { email, _count: … }` never asks for the\n // primary key, so the key the recount reads the row by is on it only\n // because the plan added it for the nested write and has not stripped it\n // yet. Move this after the strip and the recount loses its identifier;\n // move it before `runSteps` and there is nothing new to count.\n if (plan.counts && plan.after !== undefined) {\n await recountAfterSteps(\n schema,\n this as unknown as typeof Model,\n effective,\n rowsOf(result),\n options,\n );\n }\n\n // Relations are loaded after the root rows are shaped, one query per node\n // in the include tree. Each of those queries is `$exec` on the *related\n // model's own class*, recursively — not a private helper — so a nested read\n // is subject to everything a top-level read is.\n //\n // The planner is handed the database rather than reaching for it: that is\n // what keeps `compile/` free of a runtime import, and it is why the one\n // query with no model behind it — the implicit m-n join table — still runs\n // on the connection this call resolved.\n if (plan.relations !== undefined) {\n await attachRelations(\n plan.relations,\n plan.hidden,\n result,\n effective,\n executor,\n );\n } else if (plan.hidden !== undefined && plan.hidden.length > 0) {\n // A write can hide a key column without having any relation to attach:\n // a nested `after` step needs the parent's key returned, but the caller's\n // `select` never asked for it.\n for (const row of rowsOf(result)) {\n for (const key of plan.hidden) delete row[key];\n }\n }\n\n // A **folded** relation's rows never entered the child's `$exec`, so nothing\n // has run the child's `redact` over them. The comment below — \"a related row\n // was shaped by its own model's `$exec`\" — is true of the batched strategy\n // and false of the lateral one, which is precisely the kind of assumption\n // iteration 9 had to revisit for `scope`.\n //\n // `scope` survived the fold because policies rewrite the *argument tree*\n // before planning, and a scoped `where` lands inside the subquery. `redact`\n // cannot: it is a row transform in the shaping stage, with no argument to\n // rewrite. So the parent runs it on the child's behalf, which is the only\n // place that can.\n //\n // **`NESTED_READ`, not `op` — #388.** Running it here is a fact about where\n // the rows were shaped, not about what they are. The child is a read of\n // another model whatever statement encloses it, which is the whole reason\n // `applyNestedPolicies` scopes every nested node under the same constant,\n // and its docblock argues that at length. Handing the enclosing `op` down\n // made the *same* relation read, over the same rows, tell the child's\n // `redact` a different `context.operation` depending on which strategy\n // planned it: `findMany` batched, `findFirst` folded. A policy written as\n // `context.operation === \"findMany\"` therefore protected a child on SQLite\n // and leaked it on Postgres, for identical application code.\n // The same for decryption, and unconditionally: a folded child's rows\n // never entered its own `$exec`, so nothing has decrypted them.\n if (plan.relations !== undefined && !raw) {\n const parents = rowsOf(result);\n for (const relation of plan.relations) {\n if (relation.root === undefined) continue;\n decryptFolded(\n { as: relation.as, model: relation.model, folded: relation.root.folded },\n parents,\n );\n parseTypedFolded(\n { as: relation.as, model: relation.model, folded: relation.root.folded },\n parents,\n lenient,\n );\n }\n }\n\n if (plan.relations !== undefined && !system) {\n for (const relation of plan.relations) {\n if (relation.root === undefined) continue;\n redactFolded(\n {\n as: relation.as,\n model: relation.model,\n folded: relation.root.folded,\n },\n result,\n NESTED_READ,\n system,\n );\n }\n }\n\n // Redaction last, on the shaped result. After relations, not before: a\n // related row was shaped by its own model's `$exec` and has already been\n // through its own policy's `redact` — this one only owns its own rows.\n if (policy) applyRedaction(policies, policy, result);\n\n // Provenance, after redaction so a redacted field is not snapshotted as its\n // original value and then written back by `save`.\n //\n // Here rather than inside `$shape`, which is where the plan sketched it, for\n // one reason: `$shape` is the seam an `ActiveRecordModel` overrides to\n // return instances, and tracking there would make every such override\n // responsible for reimplementing it. Doing it at the choke point means an\n // override gets provenance for free — which is the same argument that put\n // everything else in `$exec`.\n if (options?.track === true) {\n for (const row of rowsOf(result)) track(row, schema);\n }\n\n return result;\n };\n\n const atomic =\n (plan.before !== undefined && plan.before.length > 0) ||\n (plan.after !== undefined && plan.after.length > 0);\n\n return atomic ? transact(db, finish) : finish();\n }\n\n /**\n * A static, not a module-level function, so subclassing is the extension\n * mechanism: a future `ActiveRecordModel` overrides this to build instances,\n * and every model extending it gets that with no change to the operations. It\n * is also where iteration 8 populates row provenance.\n */\n static $shape(plan: QueryPlan, rows: unknown[]): unknown {\n return plan.shape(rows);\n }\n}\n\n/**\n * Whether `queried` can only have the policies `registered` has.\n *\n * True for a direct subclass that declares none of its own — which is what\n * `Model.on(name)` builds, and also what `class AdminUser extends User {}` is.\n * `policiesFor` walks the prototype chain and takes each level's own\n * `$policies`; a level that declares none contributes nothing, so the walk from\n * here and the walk from the parent visit the same levels in the same order and\n * cannot disagree.\n *\n * Structural rather than a flag on the classes `on` mints, so the typed-view\n * subclass the divergence guard already argues should be allowed gets the same\n * short-circuit rather than paying for a second resolution of the chain.\n *\n * `$policy` — the removed name — is deliberately not checked: `policiesFor` has\n * already walked this class by the time this is called, and it raises on that\n * name at any level, so a class carrying it never reaches here.\n */\nfunction inheritsPoliciesFrom(queried: unknown, registered: unknown): boolean {\n return (\n Object.getPrototypeOf(queried) === registered &&\n !Object.hasOwn(queried as object, \"$policies\")\n );\n}\n\n/**\n * The subclasses `withTrashed()` / `onlyTrashed()` return, per class and mode,\n * so `User.withTrashed()` is the same class every time — like `Model.on`'s.\n */\nconst trashedViews = new WeakMap<object, Map<TrashedMode, unknown>>();\n\n/**\n * `withTrashed` / `onlyTrashed`, both spellings.\n *\n * The chain is a bound subclass for the reasons `Model.on` gives for being\n * one — the generated statics are inherited, `$exec`'s `this` stays the\n * subclass, and a subclass that declares no `$policies` is recognised by the\n * divergence guard as carrying its parent's. The block is an ambient scope\n * keyed by model name, because it has to reach reads of this model that start\n * from another one.\n */\nfunction trashedView(\n model: typeof Model,\n mode: TrashedMode,\n fn: (() => Promise<unknown>) | undefined,\n): unknown {\n // Refused in both spellings: lifting a scope the model does not have is a\n // misunderstanding, and silently doing nothing would let it stand. The block\n // rejects rather than throws, like the operations it wraps; the chain has no\n // promise to reject, so it throws where it is written.\n const method = mode === \"with\" ? \"withTrashed\" : \"onlyTrashed\";\n\n if (fn !== undefined) {\n return Promise.resolve().then(() => {\n requireSoftDeletes(model, method);\n return runWithTrashed(model.$modelSchema().name, mode, fn);\n });\n }\n\n requireSoftDeletes(model, method);\n\n let byMode = trashedViews.get(model);\n if (byMode === undefined) trashedViews.set(model, (byMode = new Map()));\n\n const cached = byMode.get(mode);\n if (cached !== undefined) return cached;\n\n const bound = class extends model {\n static $trashed = mode;\n };\n Object.defineProperty(bound, \"name\", {\n value: (model as { name: string }).name,\n configurable: true,\n });\n\n byMode.set(mode, bound);\n return bound;\n}\n\n/**\n * The column `$softDeletes` names for a query on `model`: read off the queried\n * class when it says anything, and off the registered one otherwise — so a\n * query through the generated base still hides deleted rows when the\n * application's subclass owns the name.\n */\nfunction softDeleteFieldOf(\n model: unknown,\n schema: ModelSchema,\n registered: unknown,\n): string | undefined {\n const own = (model as { $softDeletes?: SoftDeletesSetting }).$softDeletes;\n return softDeleteField(\n (own !== undefined || registered === undefined ? model : registered) as {\n $softDeletes?: SoftDeletesSetting;\n },\n schema,\n );\n}\n\n/** The model's soft-delete column, or a refusal naming the method that needed one. */\nfunction requireSoftDeletes(model: typeof Model, method: string): string {\n const schema = model.$modelSchema();\n const field = softDeleteFieldOf(\n model,\n schema,\n registry.has(schema.name) ? registry.get<unknown>(schema.name) : undefined,\n );\n\n if (field === undefined) {\n throw new UnsupportedQueryError(\n method,\n schema.name,\n method,\n `${schema.name} does not soft-delete. Set \\`static $softDeletes = true\\` ` +\n `on the model class (or \\`{ field: \"<column>\" }\\`) to use ${method}.`,\n );\n }\n\n return field;\n}\n\nasync function runSteps(\n steps: NestedWriteStep[] | undefined,\n args: any,\n context: BindContext,\n executor: RelationExecutor,\n rows: readonly Record<string, unknown>[],\n): Promise<void> {\n if (steps === undefined) return;\n // Sequentially, for the same reason relations load sequentially: inside an\n // ambient transaction every statement runs on one reserved connection, where\n // concurrent statements are not safe.\n for (const step of steps) {\n await step.run(args, context, executor, rows);\n }\n}\n\n/**\n * The skew warning, gated on this process's **zone** — resolved once, here.\n *\n * Reading the clock per call cost a `Date` allocation on the one path every\n * query takes — ~60ns, against under a nanosecond for the closed-over boolean\n * that replaces it — and the latch inside only ever closes on a *firing*, so\n * the deployment that is configured correctly and never warns paid it forever.\n *\n * `clockCouldSkew()` asks the question whose answer cannot change under a\n * running process: not \"is the offset zero today\", which is also true of\n * `Europe/London` every winter, but \"is this zone ever off UTC at all\". A UTC\n * process never enters the check; anything else stops entering once it has said\n * its piece, and reads the clock only until then — see `protocol-skew.ts`,\n * which owns both halves so that both can be tested from a UTC machine.\n */\nconst warnProtocolSkewOnce = createProtocolSkewWarner(clockCouldSkew(), () =>\n new Date().getTimezoneOffset(),\n);\n\n/**\n * Runs the statement and translates the failures that have a typed home.\n *\n * A unique violation is the one every application branches on, and every driver\n * reports it differently — SQLite as a message with a code, Postgres as a\n * SQLSTATE with a constraint name. Asking the dialect keeps that difference\n * behind the same seam as everything else, and turning it into an error that\n * names *fields* rather than columns is what makes it useful to a caller that\n * has never seen the database's names.\n */\nasync function execute(\n conn: Pick<SQL, \"unsafe\">,\n dialect: SqlDialect,\n schema: ModelSchema,\n op: Operation,\n text: string,\n values: unknown[],\n): Promise<unknown> {\n // Said once per process, and only for the configuration that silently returns\n // the wrong instant — see `protocol-skew.ts`. Printing is left here because\n // this is the layer allowed to talk to the operator; deciding is not, because\n // nothing that needs a database can be tested in the one configuration CI\n // runs.\n const warning = warnProtocolSkewOnce(dialect.name, schema, text, values);\n if (warning) console.warn(warning);\n\n try {\n return await conn.unsafe(text, values);\n } catch (error) {\n const violation = dialect.constraintViolation(error);\n if (!violation) throw error;\n\n throw new UniqueConstraintError(\n schema.name,\n op,\n fieldsForColumns(schema, violation.columns),\n violation.constraint,\n { cause: error },\n );\n }\n}\n\n/**\n * Driver column names back to Prisma field names, so the error reads in the\n * caller's vocabulary. A column with no matching field is reported as-is rather\n * than dropped: it is still the truest thing we know about the failure.\n */\nfunction fieldsForColumns(\n schema: ModelSchema,\n columns: readonly string[],\n): string[] {\n return columns.map((column) => {\n for (const field of Object.values(schema.fields)) {\n if (field.column === column) return field.name;\n }\n return column;\n });\n}\n\n/**\n * Re-reads the `_count` for rows whose children were written by an `after` step.\n *\n * One read per row rather than one for all of them, and that is not a\n * concession: every write that can carry both a `_count` and an `after` step is\n * a single-row operation — `create`, `update`, `upsert`. `createMany` takes no\n * `include` at all. So the loop runs once, and writing it as a loop keeps a\n * compound primary key expressible without an `in` list over tuples.\n *\n * **Pre-scoped, deliberately.** `effective` has already been through this\n * model's policies and `applyNestedPolicies` has already scoped the `_count`\n * node, so re-applying them would `AND` the same predicate twice — the same\n * rows, a different plan key. This is the same reasoning `delete`'s read-first\n * path uses, a few hundred lines up.\n */\nasync function recountAfterSteps(\n schema: ModelSchema,\n model: typeof Model,\n effective: any,\n rows: Record<string, unknown>[],\n options: unknown,\n): Promise<void> {\n const node = effective?.include?._count ?? effective?.select?._count;\n if (node === undefined || rows.length === 0) return;\n\n for (const row of rows) {\n // **Every component present, or nothing.** What the plan guarantees is on\n // the row is the *link* field — `planForeignSide` pushes `link.parentField`\n // into `keyFields`, which is the column the relation `references`, and that\n // is the primary key only by convention. Declare a relation\n // `references: [publicId]`, ask for `select: { email, _count }`, and `id` is\n // simply not there.\n //\n // The failure that would produce is the bad kind. `compileWhere` drops\n // `undefined` keys, so a `where` built entirely from missing components\n // compiles to **no predicate at all**:\n //\n // findFirst({ where: { id: undefined } }) -> select … from \"User\" limit ?\n //\n // — an arbitrary row, whose count is a plausible number rather than an\n // error. So an incomplete key means the projected value stands, which is\n // the same answer this already gives for a missing row: stale, not\n // invented. Nothing here can be salvaged by guessing.\n const where: Record<string, unknown> = {};\n let identified = schema.primaryKey.length > 0;\n for (const field of schema.primaryKey) {\n const value = row[field];\n if (value === undefined) {\n identified = false;\n break;\n }\n where[field] = value;\n }\n if (!identified) continue;\n\n const fresh = (await (model as any).$exec(\n \"findFirst\",\n { where, select: { _count: node } },\n markPreScoped({ strategy: (options as any)?.strategy }),\n )) as Record<string, unknown> | null;\n\n // `null` only if the row vanished between the write and this read, which\n // inside the write's own transaction it cannot. Leaving the projected value\n // alone is still the right fallback: it is stale, not invented.\n if (fresh && fresh._count !== undefined) row._count = fresh._count;\n }\n}\n\nfunction rowsOf(result: unknown): Record<string, unknown>[] {\n if (Array.isArray(result)) return result as Record<string, unknown>[];\n if (result === null || result === undefined) return [];\n if (typeof result !== \"object\") return [];\n return [result as Record<string, unknown>];\n}\n\n/**\n * Splits a `createMany` that would exceed the driver's parameter ceiling, or\n * returns `null` when it fits.\n *\n * The ceiling is enforced in `render`, so the only way to learn that a call is\n * too large is to try compiling it. That is deliberate rather than lazy: a size\n * check ahead of every write would cost every write, and the plan cache means\n * the compile is paid once per shape anyway.\n *\n * The chunk size comes from **binding one row**, not from dividing the reported\n * total. Division looks equivalent and is not: `required` includes whatever the\n * statement binds besides the rows, so on a shape with any fixed overhead it\n * understates the per-row cost and produces a chunk that is still too large.\n * Binding a single row asks the compiler the question directly.\n */\nfunction chunkedCreateMany(\n schema: ModelSchema,\n args: any,\n dialect: SqlDialect,\n strategy: RelationStrategy,\n op: Operation,\n): unknown[][] | null {\n const rows = args.data as unknown[];\n if (rows.length < 2) return null;\n\n try {\n getOrCompile(schema, op, args, dialect, strategy);\n return null;\n } catch (error) {\n if (!(error instanceof ParameterLimitError)) throw error;\n\n const single = { ...args, data: [rows[0]] };\n const perRow = getOrCompile(schema, op, single, dialect, strategy).bind(\n single,\n createBindContext(),\n ).length;\n\n // One row on its own over the ceiling is not a chunking problem — no split\n // can help, and the original error says the useful thing.\n if (perRow === 0 || perRow > error.limit) throw error;\n\n const size = Math.floor(error.limit / perRow);\n const chunks: unknown[][] = [];\n for (let at = 0; at < rows.length; at += size) {\n chunks.push(rows.slice(at, at + size));\n }\n return chunks;\n }\n}\n\n/**\n * Whether an `upsert` has to become a read and a write.\n *\n * True exactly when `create` leaves part of the conflict key unset, which is the\n * case `on conflict` cannot express — the insert could never collide on the\n * target, so the update branch would be unreachable.\n *\n * A `where` that names no unique key, or names several, is not this function's\n * to report: it returns false and lets the ordinary path raise the error it\n * already has for that, with the message it already has.\n */\nfunction findThenWrite(schema: ModelSchema, args: any, op: Operation): boolean {\n try {\n const key = matchUniqueKey(schema, args?.where, {\n model: schema.name,\n operation: op,\n argument: \"where\",\n });\n return upsertAbsentConflictKey(schema, args, key).length > 0;\n } catch {\n return false;\n }\n}\n\n/**\n * Runs a folded relation's own `redact` over the rows the strategy inlined, and\n * then its descendants' over theirs.\n *\n * Only for a plan carrying `root` — a batched child came back through its own\n * `$exec` and has already redacted itself, and doing it twice is harmless but\n * pointless. Only outside `asSystem`, like every other policy.\n *\n * **Recursive, because the fold is.** A lateral node folds its whole subtree into\n * one statement, so a grandchild's rows never enter its model's `$exec` either —\n * and stopping at depth 1 would leave exactly the rows nobody thinks to check\n * unredacted. `RootContribution.folded` is the shape of what was folded, which is\n * the only thing that makes the walk possible.\n *\n * The child's policies are resolved through the registry by name, so this obeys\n * the same rule every nested read does: whatever is registered under that name\n * is the class whose policies apply.\n */\nfunction redactFolded(\n relation: { as: string; model: string; folded?: readonly FoldedRelation[] },\n result: unknown,\n op: Operation,\n system: boolean,\n): void {\n const target = registry.has(relation.model)\n ? registry.get<unknown>(relation.model)\n : undefined;\n const policies = target ? policiesFor(target) : [];\n const nested = relation.folded ?? [];\n\n if (policies.length === 0 && nested.length === 0) return;\n\n const context =\n policies.length > 0\n ? policyContext(\n (target as { $schema?: { name?: string } }).$schema?.name ??\n relation.model,\n op,\n currentUser(),\n system,\n )\n : undefined;\n\n // Collected whether or not *this* level redacts anything: an unpolicied model\n // in the middle of the tree must not hide a policied one below it.\n const children: Record<string, unknown>[] = [];\n\n for (const parent of rowsOf(result)) {\n const rows = parent?.[relation.as];\n if (rows === undefined || rows === null) continue;\n if (context) applyRedaction(policies, context, rows);\n if (nested.length > 0) children.push(...rowsOf(rows));\n }\n\n for (const child of nested) redactFolded(child, children, op, system);\n}\n\n/**\n * Marks an `$exec` call as issued by the ORM itself — a nested write step or a\n * relation read — rather than by the application. A module-private `Symbol`,\n * like `PRE_SCOPED` in `policy.ts`, so it cannot be set from outside. Read only\n * by the `$skipNoopUpdates` default (#664).\n */\nconst ORM_ISSUED = Symbol(\"gemi.orm.issuedByTheOrm\");\n\nfunction markOrmIssued(options: object): object {\n return { ...options, [ORM_ISSUED]: true };\n}\n\nfunction isOrmIssued(options: unknown): boolean {\n return (\n typeof options === \"object\" &&\n options !== null &&\n (options as Record<symbol, unknown>)[ORM_ISSUED] === true\n );\n}\n",
|
|
32
|
+
"import type { SQL, TransactionSQL } from \"bun\";\nimport type { DatabaseConnection } from \"../database/Connection\";\nimport { DatabaseManager } from \"../database/DatabaseManager\";\nimport { app } from \"../foundation/app\";\nimport { type BindContext, createBindContext } from \"./compile/fragment\";\nimport {\n currentConnectionName,\n currentSettings,\n currentTransaction,\n isSystemScope,\n runAsSystem,\n runWithTrashed,\n trashedMode,\n type TrashedMode,\n runAsUser,\n runOnConnection,\n withTransaction,\n} from \"./context\";\nimport {\n type FoldedRelation,\n type NestedWriteStep,\n type RelationExecutor,\n type RelationStrategy,\n attachRelations,\n} from \"./compile/plan-relations\";\nimport { READ_ARGS } from \"./compile/read\";\nimport { resolveStrategy } from \"./compile/strategy\";\nimport { matchUniqueKey } from \"./compile/unique\";\nimport { upsertAbsentConflictKey } from \"./compile/write\";\nimport { dialectFor, type SqlDialect } from \"./dialect\";\nimport {\n assertNoEncryptedFilters,\n decryptFolded,\n decryptRows,\n encryptWriteArgs,\n isEncryptionRaw,\n} from \"./encryption\";\nimport {\n isLenient,\n markLenient,\n parseTypedFolded,\n parseTypedRows,\n typedColumnsOf,\n validateTypedWriteArgs,\n type JsonColumnSpecs,\n type ScalarColumnSpecs,\n} from \"./typed-columns\";\nimport { clockCouldSkew, createProtocolSkewWarner } from \"./protocol-skew\";\nimport {\n LockOutsideTransactionError,\n MissingModelSchemaError,\n RecordNotFoundError,\n UnsupportedQueryError,\n UniqueConstraintError,\n ParameterLimitError,\n UnregisteredPolicyClassError,\n} from \"./errors\";\nimport {\n getOrCompile,\n type ExecOptions,\n type Operation,\n type QueryPlan,\n} from \"./plan\";\nimport {\n applyNestedPolicies,\n applyPolicies,\n applyRedaction,\n currentUser,\n isPreScoped,\n markOrmAuthored,\n markPreScoped,\n markRedactedAs,\n ormAuthoredFields,\n policiesFor,\n policyContext,\n redactedAs,\n NESTED_READ,\n type PolicyEntry,\n type PolicyContext,\n} from \"./policy\";\nimport {\n changedFields,\n provenanceOf,\n resnapshot,\n track,\n untracked,\n} from \"./provenance\";\nimport * as registry from \"./registry\";\nimport {\n softDeleteField,\n softDeletePolicies,\n type SoftDeletesSetting,\n} from \"./soft-deletes\";\nimport type { ModelSchema } from \"./schema\";\n\n/**\n * The base every generated model class extends.\n *\n * `$exec` is the framework's single choke point: it is the only place in the\n * ORM that touches the database, and the public operations on the generated\n * subclasses are one-line delegations to it. Nested relation reads and nested\n * writes recurse through it too. Everything cross-cutting hangs here — the plan\n * cache and constraint-error translation today, ambient transactions in\n * iteration 5, policies in iteration 6, plus slow-query logging and metrics\n * later. One operation that \"just does a quick insert directly\" silently\n * escapes all of it, which is why there is exactly one door.\n *\n * Framework internals take a `$` prefix so they cannot collide with anything an\n * application author adds to a model.\n */\n\n/**\n * Operations whose result is rows of this model (as opposed to a count or an\n * aggregate), and so the ones whose encrypted columns are decrypted.\n */\nconst RETURNS_ROWS = new Set<Operation>([\n \"findUnique\",\n \"findUniqueOrThrow\",\n \"findFirst\",\n \"findFirstOrThrow\",\n \"findMany\",\n \"create\",\n \"update\",\n \"upsert\",\n \"delete\",\n]);\n\n/**\n * The operations in `RETURNS_ROWS` that write. Their rows (and those of the\n * reads they make first, and of their includes) are parsed leniently: see\n * `markLenient`.\n */\nconst WRITES_RETURNING_ROWS = new Set<Operation>([\"create\", \"update\", \"upsert\", \"delete\"]);\n\n/** Operations Prisma raises on when nothing matched, rather than returning null. */\nconst ORTHROW = new Set([\n \"findFirstOrThrow\",\n \"findUniqueOrThrow\",\n // Prisma raises P2025 — \"No record was found for an update\" / \"...a delete\" —\n // rather than returning null, and the differential harness compares the fact\n // of throwing.\n \"update\",\n \"delete\",\n]);\n\n/**\n * `withTransaction` with the connection's configured warning threshold attached.\n *\n * Every transaction the ORM opens goes through here rather than calling\n * `withTransaction` directly, so `database.slowTransactionThreshold` is read in\n * one place instead of at each call site — and a call site added later cannot\n * quietly open a transaction that ignores the setting. `withTransaction` itself\n * takes the threshold as an argument on purpose; it knows nothing about the\n * container, and this is the seam where the two meet.\n *\n * The same argument now carries the connection's **name**: a pool cannot be\n * asked which one it is, and `withTransaction` has to know in order to tell a\n * nested transaction on the same connection (a savepoint) from one on another\n * (a refusal). Taking the whole connection rather than the manager is what\n * makes both come from the same object, so a named connection cannot end up\n * with the default's threshold.\n */\nfunction transact<T>(\n connection: DatabaseConnection,\n fn: (tx: TransactionSQL) => Promise<T>,\n): Promise<T> {\n return withTransaction(connection.sql, fn, {\n slowTransactionThreshold: connection.config.slowTransactionThreshold,\n connection: connection.name,\n });\n}\n\n/**\n * The classes `Model.on` has already built, keyed by the class it was called on\n * and then by connection name.\n *\n * `User.on(\"analytics\")` is a per-query call, so it can happen in a loop and in\n * a hot path; minting a class each time would allocate one per query and defeat\n * every identity comparison downstream — the policy-divergence guard's\n * `registered !== this` among them, which would then run `policiesFor` against\n * a class it had never seen before on every call.\n *\n * A `WeakMap` on the outside so a model class that goes out of scope takes its\n * bound variants with it, which matters for tests that define models inline.\n */\nconst boundToConnection = new WeakMap<object, Map<string, typeof Model>>();\n\nexport abstract class Model {\n /**\n * Protected, so `new UserModel()` is a type error.\n *\n * Not stylistic. The generated bases merge the row's columns into their\n * instance type via a same-named interface, which is what lets a method on a\n * subclass read `this.email` — and the cost of declaration merging is that\n * TypeScript does not check those properties are ever initialised. A directly\n * constructed instance would therefore type as carrying every column while\n * holding none.\n *\n * Closing the constructor removes that hazard rather than documenting it: the\n * only way to get an instance is `wrap`, which assigns a complete row. Every\n * other operation returns plain objects and never constructs one.\n */\n protected constructor() {}\n\n /** Assigned by the generated subclass from `app/models/generated/schema.ts`. */\n static $schema: ModelSchema;\n\n /**\n * Set to `true` by the generator on each base it emits, and by nothing else.\n *\n * `registerModels` has to tell a generated base from an application class\n * written over it, because when both are in one namespace the subclass is the\n * one that must own the name — electing the base *is* #316's leak. It used to\n * answer that by asking whether a class declared `$schema` itself, which is an\n * inference about how the generator happens to be written rather than a\n * statement by the generator, and a subclass that redeclared `static $schema`\n * read as a base because of it. This is the generator saying so.\n *\n * **`declare`, and it has to stay `declare`.** The property must not exist on\n * `Model` at runtime: `isGeneratedBase` reads `\"$generated\" in candidate` to\n * decide whether the artifacts in front of it carry the mark at all, and falls\n * back to the old inference for artifacts generated before this existed. A\n * `Model.$generated` of `undefined` would answer that question `true` for\n * every class, in every app, including the ones with no mark to read.\n * `registration.test.ts` pins it.\n *\n * **`?: true` and not `?: boolean`**, which is what makes a hand-written\n * `static $generated = false` the type error `isGeneratedBase` reads it as.\n * The cost is that the generator has to emit a non-widening initialiser —\n * `static readonly $generated = true`, since a mutable one widens to\n * `boolean` and every emitted class becomes a TS2417. That happened;\n * `tsconfig.generated.json` is the check that catches it now.\n */\n declare static $generated?: true;\n\n /**\n * The model's own policies, in the order they should apply.\n *\n * A list rather than the single `$policy` this replaced, because composition\n * is the normal case and the two ways of expressing it against one slot were\n * both bad. Spreading (`{ ...softDeletes(), ...mine }`) silently drops\n * whichever `scope` came first, and an intermediate base class per combination\n * means one throwaway class for every model a shared policy applies to — the\n * generated bases all differ, so a `TenantScoped` used on three models needed\n * three of them.\n *\n * Each level of the prototype chain contributes its own array and they\n * concatenate base first, so a shared model base can still impose a policy\n * that a subclass can only narrow. See `policiesFor`.\n *\n * Entries may be policy objects or classes; a class is instantiated once. The\n * generated `<Model>Policy` type gives an object literal here full contextual\n * typing, which a bare `$policies = [...]` does not get on its own.\n */\n static $policies?: readonly PolicyEntry[];\n\n /**\n * Make `skipIfUnchanged: true` the default for this model's `update` and\n * `updateMany` (#664): a row whose assigned columns already hold the values\n * being written is not written, so its `@updatedAt` keeps meaning \"last real\n * change\".\n *\n * export class AsyncJob extends AsyncJobModel {\n * static $skipNoopUpdates = true;\n * }\n *\n * A call can still opt out with `skipIfUnchanged: false`. Applies to the\n * calls an application makes, not to the updates the ORM issues itself for a\n * nested relation write — those keep their exact row counts.\n */\n static $skipNoopUpdates?: boolean;\n\n /**\n * Schemas for the model's `Json` columns (#995): each column is parsed on\n * every read and validated on every write.\n *\n * export class PageBrief extends PageBriefModel {\n * static $json = {\n * heroes: s.array(HeroSchema),\n * styles: { schema: s.array(StyleSchema), invalid: \"null\" },\n * };\n * }\n *\n * Read from the class registered under the model's name, so the generated\n * base and `Model.on(...)` variants parse the same columns. The row types\n * follow through `gemi.d.ts` (`JsonColumns`). See `orm/typed-columns.ts`.\n */\n static $json?: JsonColumnSpecs;\n\n /**\n * Schemas for the model's scalar (`String`) columns (#1001), the sibling of\n * `$json`: each column is parsed on every read and validated on every\n * write, so an id into a code-side catalogue reads as the catalogue's union.\n *\n * export class Website extends WebsiteModel {\n * static $columns = {\n * designStyle: { schema: s.enum(DESIGN_STYLE_IDS), invalid: \"null\" },\n * };\n * }\n *\n * `where` keeps the column's own filter. The row types follow through\n * `gemi.d.ts` (`ScalarColumns`). See `orm/typed-columns.ts`.\n */\n static $columns?: ScalarColumnSpecs;\n\n /**\n * The connection this class's operations run on, set only by `on` below.\n *\n * `undefined` — which is what every model an application writes has — means\n * *the ambient connection*, not *the default one*. The two differ inside\n * `DB.connection(\"analytics\").transaction(...)`, where an unqualified query\n * has to join the open transaction rather than quietly reach for the hot\n * path's pool.\n */\n static $connection?: string;\n\n /**\n * The same model, reading and writing on a named connection.\n *\n * const rows = await Subscription.on(\"analytics\").findMany({ where })\n *\n * **Per query, not per model**, which is the shape the problem actually has:\n * the same `Subscription` is read on the hot path during sign-in and swept by\n * the nightly audit. A `static $connection = \"analytics\"` on the class would\n * force one of those two to be wrong, so the choice lives at the call site\n * and every query that does not make it stays on the default connection.\n *\n * What it returns is the model class with the connection bound to it, so the\n * whole typed surface — all fifteen operations, `transaction`, `save` — is\n * there unchanged and narrows exactly as it does on the class itself. The\n * connection reaches nested `include` reads and nested writes as well, which\n * an argument on `findMany` could not have done: those recurse through the\n * *target* model's `$exec` by way of the registry, so it is carried in the\n * ambient scope rather than in anyone's parameter list.\n *\n * **A transaction cannot span connections.** Naming one inside a transaction\n * open on another raises `CrossConnectionTransactionError` rather than\n * running the statement outside the transaction, where it would survive the\n * rollback. See that error for why refusing is the only honest answer.\n *\n * An unknown name raises `UnknownConnectionError` at the query, not here:\n * `on` is a pure lookup and does not resolve the container, so a model bound\n * in a module's top-level scope cannot force the database open at import\n * time.\n */\n static on<T extends typeof Model>(this: T, connection: string): T {\n let byName = boundToConnection.get(this);\n if (byName === undefined) boundToConnection.set(this, (byName = new Map()));\n\n const cached = byName.get(connection);\n if (cached !== undefined) return cached as T;\n\n // A subclass rather than a Proxy. Both would forward the operations, but a\n // subclass *is* a class: `policiesFor` walks the prototype chain with\n // `Object.hasOwn`, the generated statics are inherited by the language\n // rather than by a trap, and `$exec`'s `this` needs no special handling to\n // stay bound to it.\n const bound = class extends (this as unknown as typeof Model) {\n static $connection = connection;\n };\n\n // Otherwise the class expression takes its name from the binding above and\n // every error that names the model says \"bound\". `UnregisteredPolicyClassError`\n // reads `this.name` in particular, and it is exactly the kind of message\n // that has to name the class the caller wrote.\n Object.defineProperty(bound, \"name\", {\n value: (this as { name: string }).name,\n configurable: true,\n });\n\n byName.set(connection, bound);\n return bound as unknown as T;\n }\n\n /**\n * Runs `fn` with policies suspended, for code that has no user and knows it:\n * a cron tick, a queue worker, a seed script, a migration.\n *\n * Deliberately a wrapper rather than a flag or a fallback. Under\n * deny-by-default the alternative to writing this is an error, which is the\n * point — unscoped access is a sentence someone typed, never what happens\n * when a user fails to turn up.\n *\n * await Model.asSystem(() => User.findMany({}))\n */\n static asSystem<T>(fn: () => Promise<T>): Promise<T> {\n return runAsSystem(fn);\n }\n\n /**\n * Runs `fn` with policies scoped to `user`, for code that acts on somebody's\n * behalf without a request to read them from — a queue job, a scheduled\n * report, a test.\n *\n * The narrow counterpart to `asSystem`, and deliberately the easier of the\n * two to reach for. A worker handling \"send the invoice for organisation 7\"\n * acts *as* a user; giving it only `asSystem` would suspend policies outright\n * and leave it hand-scoping every query, which is the unscoped-by-accident\n * outcome deny-by-default exists to prevent.\n *\n * await Model.asUser(owner, () => Invoice.findMany({}))\n */\n static asUser<T>(user: unknown, fn: () => Promise<T>): Promise<T> {\n return runAsUser(user, fn);\n }\n\n /**\n * Soft deletes as a model setting (#663): every read, `count`, aggregate,\n * update and delete on this model skips rows whose timestamp column is set —\n * including the nested reads another model makes of it (`include`, `_count`,\n * relation filters and orderings) under either relation strategy.\n *\n * export class PriceOffer extends PriceOfferModel {\n * static $softDeletes = true; // `deletedAt`\n * // static $softDeletes = { field: \"archivedAt\" };\n * }\n *\n * **Unlike the `softDeletes()` policy it survives `Model.asSystem`.** That\n * suspends authorization; it does not resurrect deleted rows. Opt out per\n * call with {@link withTrashed} / {@link onlyTrashed}, which keep every other\n * policy in force.\n *\n * `delete()` stays a hard delete — see `softDelete` in `soft-deletes.ts` for\n * the recipe that turns one into an update, which this setting scopes like\n * any other update. `upsert` is not scoped: its conflict target is a unique\n * key, and a trashed row still holds it.\n */\n static $softDeletes?: SoftDeletesSetting;\n\n /**\n * Set on the subclass `withTrashed()` / `onlyTrashed()` return. Not for\n * applications to write: the methods are the interface.\n */\n declare static $trashed?: TrashedMode;\n\n /**\n * Includes soft-deleted rows. Two spellings:\n *\n * await PriceOffer.withTrashed().findMany({ where }) // this query\n * await PriceOffer.withTrashed(() => // a block\n * Order.findMany({ include: { offer: true } }),\n * )\n *\n * The chain lifts the scope for the query it starts — the root model only.\n * The block lifts it for every query on this model inside `fn`, which is the\n * spelling that reaches a nested read *of* this model from another one.\n *\n * Only the soft-delete scope is lifted: tenant scopes and every other\n * `$policies` entry still apply, which is what `asSystem` could not offer.\n */\n static withTrashed<T extends typeof Model>(this: T): T;\n static withTrashed<R>(fn: () => Promise<R>): Promise<R>;\n static withTrashed(fn?: () => Promise<unknown>): unknown {\n return trashedView(this, \"with\", fn);\n }\n\n /** Reads soft-deleted rows only. Same two spellings as {@link withTrashed}. */\n static onlyTrashed<T extends typeof Model>(this: T): T;\n static onlyTrashed<R>(fn: () => Promise<R>): Promise<R>;\n static onlyTrashed(fn?: () => Promise<unknown>): unknown {\n return trashedView(this, \"only\", fn);\n }\n\n /**\n * Clears the timestamp on one soft-deleted row and returns it.\n *\n * Scoped to trashed rows, so a `where` naming a row that is not deleted is a\n * miss and raises `RecordNotFoundError` — the same answer `expire` gives for\n * a row that already is. Takes `delete`'s arguments: a unique `where` and an\n * optional projection.\n */\n static restore<C extends typeof Model & { delete(args: any): Promise<any> }>(\n this: C,\n args: Parameters<C[\"delete\"]>[0],\n ): ReturnType<C[\"delete\"]> {\n // Through a promise, so a model that does not soft-delete rejects like\n // every other failed operation rather than throwing before one exists.\n return Promise.resolve().then(() => {\n const field = requireSoftDeletes(this, \"restore\");\n return runWithTrashed(this.$modelSchema().name, \"only\", () =>\n this.$exec(\"update\", { ...(args as object), data: { [field]: null } }),\n );\n }) as ReturnType<C[\"delete\"]>;\n }\n\n /** {@link restore} for every trashed row matching `where`; returns the count. */\n static restoreMany<\n C extends typeof Model & { deleteMany(args?: any): Promise<any> },\n >(\n this: C,\n args?: Parameters<C[\"deleteMany\"]>[0],\n ): Promise<{ count: number }> {\n return Promise.resolve().then(() => {\n const field = requireSoftDeletes(this, \"restoreMany\");\n return runWithTrashed(this.$modelSchema().name, \"only\", () =>\n this.$exec(\"updateMany\", {\n ...(args as object | undefined),\n data: { [field]: null },\n }),\n );\n }) as Promise<{ count: number }>;\n }\n\n /**\n * Persists the changes made to a *tracked* row: `update` with only the columns\n * whose value differs from what was fetched.\n *\n * const user = await User.findUnique({ where: { id } }, { track: true })\n * user.name = \"new name\"\n * await User.save(user) // update \"User\" set \"name\" = ?, … where \"id\" = ?\n *\n * Most of Eloquent's write ergonomics while returns stay plain objects — no\n * proxies, no conditional return types, no signature that changes with a flag.\n * That is invariant 5's whole claim, and this is the thing that tests it.\n *\n * Goes through `$exec(\"update\", …)` rather than around it, so policies,\n * `@updatedAt`, the ambient transaction and the plan cache all apply exactly as\n * they do to a hand-written update. The changed-column *set* is the plan's\n * shape and the values are parameters, so two saves touching the same columns\n * share one plan.\n *\n * Returns `null` when nothing changed, having issued no statement — a save of\n * an untouched row should not stamp `@updatedAt`.\n *\n * Raises when handed an object with no provenance. See `untracked` for why\n * that is a loud failure rather than a fallback to writing everything.\n *\n * **It writes back to the connection the row was read on**, which is the one\n * place a connection cannot be resolved from the ambient scope: a row read on\n * `analytics` is an ordinary object that outlives the scope that produced it,\n * and by the time it is saved — three functions later, from code that never\n * named a connection — the scope is gone. So the connection is part of the\n * row's provenance, exactly as the model and the primary key are, and for the\n * same reason. Left to the ambient default, `save` compiled a correct\n * `update` and sent it to the wrong database, where the same id usually names\n * a real and different row.\n *\n * Naming a *different* connection explicitly — `User.on(\"default\").save(row)`\n * for a row read on `analytics` — is a contradiction rather than an\n * instruction, and raises. Copying a row between connections is a write in\n * its own right: say it with `update`, where the `where` and the `data` are\n * both visible.\n */\n static async save<T extends object>(row: T): Promise<unknown> {\n const schema = this.$modelSchema();\n const record = provenanceOf(row);\n\n if (!record) throw untracked(row, schema.name);\n\n if (record.model !== schema.name) {\n throw new UnsupportedQueryError(\n \"save\",\n schema.name,\n \"save\",\n `This row came from ${record.model}, not ${schema.name}. Save it ` +\n `through the model it was read from.`,\n );\n }\n\n if (\n this.$connection !== undefined &&\n this.$connection !== record.connection\n ) {\n throw new UnsupportedQueryError(\n \"save\",\n schema.name,\n \"save\",\n `This row was read on the \"${record.connection}\" connection and this ` +\n `save names \"${this.$connection}\". A save writes the row back where ` +\n `it came from, so the two cannot both be honoured. Drop the ` +\n `\\`on(\"${this.$connection}\")\\`, or write it as an explicit ` +\n `${schema.name}.on(\"${this.$connection}\").update({ where, data }) if ` +\n `copying it across connections is what you meant.`,\n );\n }\n\n // A row selected without its primary key has `key = { id: undefined }`, and\n // `matchUniqueKey` drops undefined members — so the update fails with\n // \"update needs a unique field\", pointing at a `where` the caller never\n // wrote. Named here instead, where the actual mistake is knowable: this can\n // only mean the select omitted the key.\n const missingKey = schema.primaryKey.filter(\n (name) => record.key[name] === undefined,\n );\n if (missingKey.length > 0) {\n throw new UnsupportedQueryError(\n \"save\",\n schema.name,\n \"save\",\n `This row was fetched without ${missingKey.join(\", \")}, so there is no ` +\n `way to identify which row to update. A tracked row needs its primary ` +\n `key: add ${missingKey.map((name) => `${name}: true`).join(\", \")} to ` +\n `the select, or drop the select to fetch every column.`,\n );\n }\n\n const changed = changedFields(row, schema);\n if (Object.keys(changed).length === 0) return null;\n\n // On the row's own connection, entered here rather than left to `$exec`:\n // `$exec` resolves the *ambient* name, and the whole point is that the row\n // outlived the scope that read it. Inside a transaction on another\n // connection this raises `CrossConnectionTransactionError` from `$exec`,\n // which is the correct answer — that update cannot join the transaction, so\n // it must not run at all.\n const updated = await runOnConnection(record.connection, () =>\n this.$exec(\"update\", {\n where: record.key,\n data: changed,\n }),\n );\n\n // Copy the *returned* row back over the caller's, not just the values sent.\n //\n // `@updatedAt` is stamped by the compiler and is therefore never in\n // `changed`, so without this the in-memory row keeps the timestamp it was\n // fetched with while the database holds a newer one — a caller reading\n // `user.updatedAt` after a successful save silently gets the old instant. The\n // same applies to anything else the database rewrote.\n //\n // Resnapshotting from the same source is what keeps the row and its snapshot\n // in agreement, so a second `save` is still a no-op.\n if (updated && typeof updated === \"object\" && !Array.isArray(updated)) {\n const fresh = updated as Record<string, unknown>;\n const target = row as Record<string, unknown>;\n const persisted: Record<string, unknown> = {};\n\n for (const name of Object.keys(fresh)) {\n if (!(name in schema.fields)) continue;\n target[name] = fresh[name];\n persisted[name] = fresh[name];\n }\n\n resnapshot(row, persisted);\n } else {\n resnapshot(row, changed);\n }\n\n return updated;\n }\n\n /**\n * Turns a **complete** row into an instance of this class, for code that wants\n * behaviour rather than data.\n *\n * const user = User.wrap(await User.findUniqueOrThrow({ where: { id } }))\n * user.displayName // a method on your subclass\n * await user.save()\n *\n * Explicit, never implicit, and that is the whole design. The moment queries\n * hydrate by default, the `select` conflict comes back: a method that reads\n * `this.email` on a row fetched as `select: { id: true }` is a runtime crash\n * the type system cannot see. Keeping `wrap` a call the author makes means\n * narrowing and behaviour never meet.\n *\n * **Completeness is required, and the requirement is not arbitrary.** The\n * generated signature takes the full scalar payload, so a `Pick` of it is a\n * compile error rather than a runtime surprise (there is a type test for\n * exactly that). It is the same constraint that makes `save()` work on the\n * result: a complete row is one this can snapshot in full, so an instance is\n * tracked without the caller asking. The type constraint and the save\n * capability are one constraint, not two.\n *\n * Note the instance is a *copy*: mutating it does not touch the row that was\n * passed in, and `save()` diffs against what `wrap` received.\n */\n static wrap(row: object): any {\n const schema = this.$modelSchema();\n const instance = new (this as unknown as new () => any)();\n\n Object.assign(instance, row);\n // Tracked on the instance, not the argument — `save()` on the instance has\n // to diff against the values it was constructed from.\n //\n // The connection is the argument's, when the argument has one. `wrap` runs\n // *after* the query's scope has closed, so the ambient name here is\n // whatever the caller happens to be in — usually the default — and a row\n // read on `analytics` would be wrapped into an instance whose `save()`\n // wrote to the hot path. Taken in order: an explicit `on`, then where the\n // row actually came from, then the ambient connection for a row that was\n // never tracked at all.\n track(\n instance,\n schema,\n this.$connection ??\n provenanceOf(row)?.connection ??\n currentConnectionName(),\n );\n\n return instance;\n }\n\n /**\n * Persists this instance's changes. The instance counterpart of the static, and\n * a one-line delegation to it so there is one implementation.\n */\n save(): Promise<unknown> {\n return (this.constructor as typeof Model).save(this);\n }\n\n static $modelSchema(): ModelSchema {\n const schema = this.$schema;\n if (!schema) throw new MissingModelSchemaError(this.name);\n return schema;\n }\n\n /**\n * Runs `fn` inside a transaction. Every ORM query in it — at any call depth,\n * through any number of services, including the nested reads an `include`\n * fans out into — joins it automatically.\n *\n * The callback takes **no argument**, and that is the whole feature. Handing\n * back a `tx` would put it in the signature of every function between here\n * and the query, which is precisely the threading Prisma's `$transaction`\n * forces and this exists to remove. If a raw query genuinely needs the\n * handle, `currentTransaction()` hands it over without putting it in anyone's\n * parameter list.\n *\n * Nesting is a savepoint: an inner failure rolls back to it and leaves the\n * outer transaction usable, so a caller that catches keeps going.\n *\n * await User.transaction(async () => {\n * const user = await User.create({ data: { email } })\n * await audit(user) // its queries are in the transaction too\n * })\n *\n * **KNOWN DIALECT ASYMMETRY — catching an error inside a transaction.**\n * The sentence above holds for a *nested* `Model.transaction`. It does not\n * hold for a bare statement: on Postgres any failed statement aborts the\n * whole transaction block, so catching it and carrying on loses everything.\n * SQLite does not care. Verified against Postgres 16 and SQLite:\n *\n * await Model.transaction(async () => {\n * try { await User.create({ data: { email } }) }\n * catch (e) { if (!(e instanceof UniqueConstraintError)) throw e }\n * await Audit.create({ ... }) // fine on SQLite; on Postgres this\n * }) // throws 'current transaction is\n * // aborted', and the whole transaction\n * // is lost\n *\n * That is a bug that passes in development on SQLite and takes out the\n * transaction in production on Postgres, with an error naming neither the\n * statement that failed nor the one that caused it.\n *\n * The fix is already here: wrap the fallible statement in a nested\n * `Model.transaction`, which makes it a savepoint, and rolling back to that\n * savepoint clears the aborted state. Works on both dialects.\n *\n * await Model.transaction(async () => {\n * try {\n * await Model.transaction(() => User.create({ data: { email } }))\n * } catch (e) { if (!(e instanceof UniqueConstraintError)) throw e }\n * await Audit.create({ ... }) // fine on both\n * })\n *\n * **One statement at a time.** Every query in scope runs on one reserved\n * connection, so `Promise.all` over several ORM calls inside the callback is\n * not safe here — the ordinary, encouraged thing everywhere else in a Bun\n * codebase. Await them in sequence. (`$exec` already runs its own nested\n * writes and relation reads sequentially for this reason.)\n *\n * **The connection is held for as long as the callback runs**, including\n * while it awaits things that are not queries. In development a transaction\n * still open after 2s warns — `database.slowTransactionThreshold` sets that\n * bound, or `false` switches it off. In production it just holds the\n * connection. Keep network and filesystem I/O outside.\n */\n // `async`, so that naming a connection this transaction cannot reach —\n // `Subscription.on(\"analytics\").transaction(...)` inside a transaction on the\n // hot path — *rejects* rather than throwing synchronously. The same reasoning\n // `DB.query` records: an API that does one sometimes and the other otherwise\n // is a footgun, and a `.catch()` would miss exactly this error.\n static async transaction<T>(fn: () => Promise<T>): Promise<T> {\n // `Subscription.on(\"analytics\").transaction(...)` opens on that connection,\n // and a bare `Model.transaction` opens on whatever is ambient — which is\n // the default connection unless something outside has already named one.\n // `withTransaction` refuses the mismatch; there is no second check here.\n const name = this.$connection ?? currentConnectionName();\n\n return transact(app(DatabaseManager).connection(name), () =>\n runOnConnection(name, () => fn()),\n );\n }\n\n /**\n * The choke point's outer half: which connection this operation runs on.\n *\n * Split from the body below so that the name is resolved and entered\n * **once**, around everything — the policy pass, the plan lookup, the nested\n * writes and every relation read that recurses back through here. The\n * alternative, resolving it inside, would have left each nested read to\n * rediscover it, and the one that did not would have run against the default\n * connection with no error to show for it.\n *\n * Recursive calls cost a comparison: the ambient name already matches, so\n * `runOnConnection` calls straight through without entering a second scope.\n *\n * `async` for the reason `transaction` is: an operation refused for naming a\n * connection the open transaction cannot reach has to reject like every other\n * failure `$exec` produces, rather than being the one that throws before the\n * promise exists.\n *\n * The cross-connection refusal is `runOnConnection`'s, not repeated here:\n * *entering* the connection is the only moment at which the scope still holds\n * both the open transaction and the name it belongs to, so that is where the\n * comparison has to live.\n */\n static async $exec(\n op: Operation,\n args: any = {},\n options?: ExecOptions,\n ): Promise<unknown> {\n const name = this.$connection ?? currentConnectionName();\n // Outside a transaction, inside `DB.withSettings` (#1158): the call gets a\n // transaction of its own, which starts by applying the settings.\n if (currentTransaction() === undefined && currentSettings()) {\n return transact(app(DatabaseManager).connection(name), () =>\n runOnConnection(name, () => this.$execute(op, args, options)),\n );\n }\n return runOnConnection(name, () => this.$execute(op, args, options));\n }\n\n private static async $execute(\n op: Operation,\n args: any = {},\n options?: ExecOptions,\n ): Promise<unknown> {\n const schema = this.$modelSchema();\n\n // Resolved per call, never captured at module scope: that is what keeps the\n // connection swappable in tests.\n //\n // Through `connection()` rather than off the manager directly, so that a\n // query on a named connection reads *that* pool's client and dialect. The\n // default connection is the manager itself, which is what keeps every\n // existing wrapper of it — the harnesses that Proxy `sql` to count\n // statements — looking at the object this executes through.\n const db = app(DatabaseManager).connection(currentConnectionName());\n const dialect = dialectFor(db.dialect);\n\n // The ambient-transaction hook, and the entire integration. It is one line\n // — and it covers every operation, every nested write and every relation\n // read — only because invariant 1 held: `$exec` is the single door. An\n // operation that acquired a private path to the database would show up\n // here as a statement silently running outside the transaction, committed\n // while its neighbours roll back.\n // `let`, because a multi-statement write opens a transaction of its own\n // further down and every statement after that point — including the\n // `executor.query` closure below, which captures this binding rather than\n // its value — has to run on the new handle rather than back on the pool.\n let conn = currentTransaction() ?? db.sql;\n\n // A row lock outlives its statement only inside a transaction; outside one\n // it is released as the row comes back, before the write it was meant to\n // guard. Refused on every dialect — including SQLite, where the lock\n // compiles to nothing — so a missing transaction fails in development\n // rather than first under load on Postgres. After `runOnConnection`, so a\n // transaction on another connection has already been refused as such.\n if (\n args?.lock !== undefined &&\n READ_ARGS[op]?.has(\"lock\") &&\n currentTransaction() === undefined\n ) {\n throw new LockOutsideTransactionError(schema.name, op);\n }\n\n // POLICIES, AND THE ORDER MATTERS MORE HERE THAN ANYWHERE ELSE IN THE ORM.\n //\n // Policies rewrite the argument tree, so they change the SQL. They must\n // therefore run *before* `getOrCompile`, which keys the plan cache on those\n // arguments. Reordered — compile first, scope after — two users with the\n // same query shape and different scopes would share one plan, and one of\n // them would run the other's SQL. That is a cross-tenant data leak produced\n // by a caching bug, and it would not look like one.\n //\n // A scope that injects a *value* keeps the same shape for every user, so\n // the plan is still shared and only the bound value differs. That is the\n // desired outcome, not a compromise, and `policy.plan-cache.test.ts` pins\n // both halves: same shape means one plan and different parameters, and a\n // scope whose shape varies by user means a different plan key.\n // `asSystem` suspends the whole hook, not just the no-user check: a script\n // that has said it is a script should not then be scoped to a user that\n // happens to be in the request store.\n const system = isSystemScope();\n\n // The registered class, looked up once: the divergence guard below needs it,\n // and so does the soft-delete setting when the caller queried the generated\n // base rather than the class that declares it.\n const registered = registry.has(schema.name)\n ? registry.get<unknown>(schema.name)\n : undefined;\n\n // `$softDeletes` (#663) is applied **under `asSystem` too** — it is a fact\n // about the data, not an authorization rule. Read off the queried class\n // when it says anything, and off the registered one otherwise, so querying\n // `PriceOfferModel` where `PriceOffer` owns the name still hides deleted\n // rows: the safe direction for the same split the divergence guard covers.\n const softField = softDeleteFieldOf(this, schema, registered);\n const ownPolicies = system ? [] : policiesFor(this);\n const policies = softDeletePolicies(\n ownPolicies,\n softField,\n (this as { $trashed?: TrashedMode }).$trashed ?? trashedMode(schema.name),\n );\n let policy: PolicyContext | undefined;\n let effective = args;\n\n // POLICY-DIVERGENCE GUARD.\n //\n // A nested relation read resolves its target through the registry, so it\n // runs whatever is registered under this model's name — not necessarily the\n // class the caller queried. When those two disagree about *policies*, the\n // same policy applies to some queries and not others, silently. Both\n // directions are reachable and both are the same bug:\n //\n // policied class not registered -> root scoped, nested reads unscoped\n // policied class registered, but -> nested reads scoped, a direct query\n // the caller queries the base through the base unscoped\n //\n // The second is the one this check sat inside `policies.length > 0` and\n // therefore missed: querying `AccountModel` when `Account` owns the name\n // finds no policies on `AccountModel`, so the old placement never looked.\n // `AccountModel` and `Account` come out of the same barrel with near\n // identical names, so it needs no include and no mistake worth calling one.\n //\n // Keyed on the *divergence*, not on either class having policies. The\n // comparison is of the resolved policy chain rather than class identity: a\n // plain subclass of a registered, policied class inherits the same policy\n // objects in the same order, so nothing diverges and there is nothing to\n // refuse — checking identity rejected `class AdminUser extends User {}`, a\n // typed view, for policies it had not written.\n //\n // `!system` is load-bearing. Under `asSystem` policies are suspended by\n // design, so a seed script querying the generated base directly is correct\n // and must not raise.\n //\n // Cost on the common path: one `Map.get` and one reference compare, for a\n // model where nothing is registered under a different class.\n //\n // `inheritsPoliciesFrom` keeps that true for `Model.on(name)`, whose bound\n // subclass is never the registered class and so failed the reference\n // compare on *every* query — leaving each one to resolve the registered\n // chain and walk it twice to reach the same conclusion. A direct subclass\n // that declares no policies of its own has, by construction, the chain its\n // parent has: there is nothing to compare.\n if (!system) {\n if (\n registered !== undefined &&\n registered !== this &&\n !inheritsPoliciesFrom(this, registered)\n ) {\n const theirs = policiesFor(registered);\n const diverges =\n ownPolicies.length !== theirs.length ||\n ownPolicies.some((entry, index) => entry !== theirs[index]);\n\n if (diverges) {\n throw new UnregisteredPolicyClassError(\n schema.name,\n (registered as { name?: string }).name ?? String(registered),\n this.name,\n ownPolicies.length > 0 ? \"queried\" : \"registered\",\n );\n }\n }\n }\n\n // NESTED policies, applied to the argument tree before the plan key.\n //\n // A nested read under the batched strategy would acquire its own policies by\n // recursing through the child's `$exec` — but a lateral join has no such call,\n // so the child's policies would never be consulted and the subquery would be\n // unscoped. Applying them here, on the args, keeps the compiler pure and makes\n // the scope part of whatever SQL a strategy chooses to emit. See\n // `applyNestedPolicies` and `plans/orm/09-lateral-strategy.md`.\n //\n // `preScoped` is how the double application is avoided: the relation executor\n // marks its recursive calls, so a child whose args arrived already scoped does\n // not scope them again. Without it a batched include would `AND` the same\n // predicate twice — the same rows, but different SQL and a different plan key.\n const preScoped = isPreScoped(options);\n\n //\n // **Under `asSystem` too, but carrying only the soft-delete scopes.** The\n // walk is how a nested read gets its target's scope — and under the batched\n // strategy the child's own `$exec` is marked pre-scoped and skips it — so\n // skipping the walk would leave a deleted row reachable through any\n // `include`. The walk is told `system: false` because it is handed only\n // what should apply; `asSystem` has already removed the rest.\n if (!preScoped) {\n effective = applyNestedPolicies(\n schema,\n effective,\n currentUser(),\n false,\n (model) => {\n if (!registry.has(model)) return undefined;\n const target = registry.get<typeof Model>(model);\n const targetSchema = target.$schema;\n if (!targetSchema) return undefined;\n return {\n policies: softDeletePolicies(\n system ? [] : policiesFor(target),\n softDeleteField(target, targetSchema),\n trashedMode(targetSchema.name),\n ),\n schema: targetSchema,\n };\n },\n );\n }\n\n // `upsert` whose `create` does not set the conflict key, which used to\n // raise — and which is decided **before** policies are applied, on purpose.\n //\n // The last of iteration 4's three \"not before iteration 5\" items. That note:\n // \"Prisma means find-then-write there; expressing that takes a read and a\n // write inside one transaction, which is iteration 5's.\"\n //\n // Checked against a generated Prisma 6 client rather than reasoned about,\n // because the semantics are surprising: `upsert({ where: { publicId: \"X\" },\n // create: { email } })` inserts a row whose `publicId` is **generated**, not\n // \"X\". The `where` selects; it does not contribute to the insert.\n //\n // **`on conflict` is kept wherever it works.** It is one atomic statement,\n // and read-then-write is not — two callers can both miss and both insert.\n // Prisma's upsert has that race and this inherits it, but only on calls that\n // previously raised: nothing that worked becomes racy.\n //\n // **Before policies, and that is what lets a scoped model upsert at all.**\n // `assertScopable` refuses to put a scope on an `upsert`, because its where\n // becomes an `on conflict` target and a target cannot carry a predicate.\n // That reason is exactly true of the `on conflict` path and false of this\n // one, which is three ordinary statements. Deciding here means the three run\n // as `findFirst`, `create` and `update`, each scoped normally by its own\n // `$exec` — so this branch is *not* marked pre-scoped, and a policied model\n // gets a working upsert instead of a refusal whose justification expired.\n //\n // A policy that branches on `context.operation` therefore sees the three it\n // actually runs rather than the one the caller named. That is the honest\n // reading: the operation really is three statements here.\n if (op === \"upsert\" && !preScoped && findThenWrite(schema, args, op)) {\n const { where, create, update, ...projection } = args;\n\n // Marked ORM-issued so a `$skipNoopUpdates` model's default does not\n // reach the `update` half: `upsert` takes no `skipIfUnchanged`, and its\n // one-statement `on conflict` form could not honour one.\n const inner = markLenient(markOrmIssued({ ...options })) as ExecOptions;\n\n return transact(db, async () => {\n const found = await this.$exec(\"findFirst\", { where }, inner);\n\n return found === null\n ? await this.$exec(\"create\", { data: create, ...projection }, inner)\n : await this.$exec(\n \"update\",\n { where, data: update, ...projection },\n inner,\n );\n });\n }\n\n if (policies.length > 0) {\n // Deny-by-default lives on the context's `user` accessor, not here: a\n // policy that never consults the user — a soft-delete scope, say — has\n // nothing to deny and must keep working with no request in sight. See\n // `policyContext`.\n //\n // `redactedAs` is the one thing that can make `context.operation` differ\n // from `op`, and it exists to *remove* a difference the caller can see: a\n // `delete` that has to read before it writes runs its pre-read as a\n // `findFirst` and hands that row back, so without this a `redact` keyed on\n // `\"delete\"` stopped firing the moment the call also carried an `include`\n // (#366). The row is the delete's return value; it is redacted as one.\n //\n // **Only on a pre-scoped call, which is what keeps it a redaction\n // concern.** `applyPolicies` below is skipped when `preScoped`, so on the\n // one call that sets this marker the context reaches nothing but\n // `applyRedaction`. Reading the marker unconditionally would leave a\n // shape — a future non-pre-scoped caller — where a `before` or a `scope`\n // could be handed an operation the statement is not, and `SCOPABLE` is\n // keyed on exactly that. The guard does not make that shape\n // unconstructible — `markRedactedAs(options, \"delete\")` on its own is\n // still a value anyone can build — it makes it *unread*, so the\n // consequence is absent rather than the shape. That is the whole of what\n // is claimed, and it is enough: the marker changes nothing on any call\n // that policies still rewrite.\n policy = policyContext(\n schema.name,\n (preScoped ? redactedAs(options) : undefined) ?? op,\n currentUser(),\n system,\n );\n\n // **The context is built even when pre-scoped; only the rewrite is\n // skipped.** `preScoped` means \"the scope is already in these args\" — not\n // \"this model has no policies\". Guarding the whole block on it left\n // `policy` undefined for every nested relation read, and `policy` is what\n // `applyRedaction` below is keyed on. So a `redact` protected a root query\n // and was skipped inside every `include`: scoped one way, unscoped the\n // other, which is the failure iteration 6 exists to prevent.\n //\n // Only `applyPolicies` is idempotency-sensitive. Re-running it would `AND`\n // the same predicate twice; re-running `redact` on an already-redacted row\n // is a no-op.\n if (!preScoped) {\n effective = applyPolicies(\n policies,\n policy,\n effective,\n ormAuthoredFields(options),\n );\n }\n }\n\n // Encrypted columns (#844), refused as a filter, sort or grouping anywhere\n // in the argument tree — after policies, so a scope cannot slip one in\n // either. The raw mode is `encryption:rotate`'s, comparing envelopes.\n const raw = isEncryptionRaw(options);\n if (!raw) assertNoEncryptedFilters(schema, op, effective);\n\n // Which strategy plans the include tree. Named per call or chosen by\n // `defaultStrategy`, and either way it reaches the plan key — two strategies\n // emit different SQL for the same arguments, so sharing a plan between them\n // would run one request's statement for the other's.\n const strategy = resolveStrategy(options?.strategy, dialect, {\n model: schema.name,\n operation: op,\n });\n\n // `createMany` past the driver's parameter ceiling, which used to raise.\n //\n // Iteration 4 refused to chunk and said why: \"it would make this several\n // statements, which cannot be made atomic until transactions land.\" They\n // landed in iteration 5. So the split happens here, inside one transaction,\n // and the caller gets the same `{ count }` a single statement would have\n // returned.\n //\n // **Only on the call that would otherwise have failed.** The ceiling is\n // checked in `render`, so the ordinary path pays nothing for this — it is a\n // `catch`, not a size check on every write. A `createMany` small enough to\n // compile never enters it.\n if (op === \"createMany\" && Array.isArray(effective?.data)) {\n const chunks = chunkedCreateMany(\n schema,\n effective,\n dialect,\n strategy,\n op,\n );\n\n if (chunks !== null) {\n return transact(db, async () => {\n let count = 0;\n for (const data of chunks) {\n const written = (await this.$exec(\n \"createMany\",\n { ...effective, data },\n markPreScoped({ strategy: options?.strategy }) as never,\n )) as { count: number };\n count += written.count;\n }\n return { count };\n });\n }\n }\n\n // The model-level default for `skipIfUnchanged` (#664), resolved into the\n // arguments so it reaches the plan key like the per-call spelling does.\n // Not for the ORM's own nested-write updates: a `connect` that finds the\n // foreign key already pointing at its target must still count that row.\n if (\n (op === \"update\" || op === \"updateMany\") &&\n this.$skipNoopUpdates === true &&\n effective?.skipIfUnchanged === undefined &&\n !isOrmIssued(options)\n ) {\n effective = { ...effective, skipIfUnchanged: true };\n }\n\n // This model's typed columns (`$json` #995, `$columns` #1001), validated\n // and replaced by their parsed values. Same place and reasons as\n // encryption: after the `createMany` split, and nested writes are\n // validated by their own model. Before encryption, so a typed `String`\n // column that is also encrypted is validated as plaintext.\n const typedColumns = typedColumnsOf(schema, this);\n if (!raw) effective = validateTypedWriteArgs(typedColumns, schema.name, op, effective);\n const lenient = WRITES_RETURNING_ROWS.has(op) || isLenient(options);\n\n // This model's encrypted columns, encrypted. After the `createMany` split\n // above — each chunk re-enters `$exec` and is encrypted there, so doing it\n // first would encrypt twice — and before the plan, though only the bound\n // values change, never the plan's shape. Nested writes into other models\n // are encrypted by those models' own `$exec`.\n if (!raw) effective = encryptWriteArgs(schema, op, effective);\n\n const plan = getOrCompile(schema, op, effective, dialect, strategy);\n\n const executor: RelationExecutor = {\n // `markPreScoped`: this model's policies were already applied to\n // `relationArgs` by the parent's nested walk, so re-applying them here\n // would `AND` the same predicate twice — same rows, different SQL,\n // different plan key. The marker is a module-private Symbol and is not\n // exported, so it cannot become a way for an application to skip policies.\n // The strategy propagates too. Without it a nested `$exec` fell back to\n // `defaultStrategy`, so a query explicitly asking for `batched` got the\n // *default* for every level below the root — on Postgres that meant the\n // grandchild folded anyway and the statement count was one lower than the\n // caller asked for. Found by the query-count test, which is the only thing\n // that could have found it: the results were identical either way.\n exec: (model, operation, relationArgs, preScoped, ormAuthored) => {\n const marked = markOrmIssued(\n preScoped\n ? markPreScoped({ strategy: options?.strategy })\n : { strategy: options?.strategy },\n );\n // A write's includes are read after it was saved: see `markLenient`.\n const base = lenient ? markLenient(marked) : marked;\n return registry\n .get<typeof Model>(model)\n .$exec(\n operation as Operation,\n relationArgs,\n (ormAuthored && ormAuthored.length > 0\n ? markOrmAuthored(base, ormAuthored)\n : base) as never,\n );\n },\n // The one query with no model behind it — the implicit m-n join table —\n // resolves its connection here rather than reaching for the pool, so it\n // joins the transaction like everything else.\n query: (text, values) => conn.unsafe(text, values),\n };\n\n // One context per call, holding the instant every `now()` and `@updatedAt`\n // on this operation shares, plus whatever the `before` steps resolve.\n const context = createBindContext();\n\n // `delete` with an `include` on a **cascading** relation, which returned the\n // children empty until now.\n //\n // The relation reads run after the delete statement, so where the schema\n // declares `onDelete: Cascade` the database has already removed the children\n // by the time they are read. Prisma runs the whole thing in a transaction and\n // returns them as they were. `compileDelete` recorded this as \"not fixable at\n // this layer — the fix is to read the relations before the delete inside one\n // transaction, which is iteration 5's to provide\".\n //\n // Iteration 5 provided it. Read first, delete second, return what was read:\n //\n // - **A transaction, so the pair is atomic.** Without one, a delete that\n // fails after the read would leave the caller holding a row that still\n // exists. Nested inside a caller's transaction it is a savepoint, which is\n // what `withTransaction` already does.\n // - **`markPreScoped` on both**, because `effective` has been through this\n // model's policies once already; re-applying them would `AND` the same\n // predicate twice — same rows, different plan key.\n // - **The read is scoped as the delete was**, including its nested policies.\n // `effective` was rewritten by `applyPolicies` and `applyNestedPolicies`\n // under operation `\"delete\"`, and `markPreScoped` stops the pre-read\n // redoing either — so the `where` the `findFirst` runs is the delete's,\n // predicate for predicate.\n // - **`markRedactedAs`, so the row is redacted as the delete it belongs\n // to.** This bullet used to claim `context.operation` was already\n // `\"delete\"` here. It was not, and the row it was most wrong about was the\n // root one — the one returned. The pre-read is a `findFirst`, so\n // `policyContext` was built with `\"findFirst\"` and a `redact` keyed on\n // `\"delete\"` silently stopped firing as soon as the same call carried an\n // `include` (#366). The `delete` statement below *does* run under\n // `\"delete\"`, and its row is thrown away, so nothing observable came of\n // that half.\n //\n // The marker covers the returned row and nothing else. Nested reads are\n // *scoped* as `findMany` on both strategies — `NESTED_READ` in `policy.ts`\n // is a constant on purpose, because a read of another model is a read\n // whatever statement encloses it — and the marker does not reach them: the\n // relation executor rebuilds its options from `{ strategy }` rather than\n // forwarding these.\n //\n // Which name a nested row is *redacted* as is a second mechanism, and it\n // agrees with the first since #388. Both strategies answer `NESTED_READ`:\n // a **batched** child runs its own `$exec` under it, and a **folded**\n // (lateral, the Postgres default) child is handed the same constant by\n // `redactFolded` below, which redacts it on the parent's behalf because\n // its rows never enter its own `$exec`.\n //\n // Until #388 the folded path built its context from the enclosing\n // `$exec`'s `op` — on this call the pre-read, a `findFirst` — so the same\n // query over the same rows reported `findMany` on SQLite and `findFirst`\n // on Postgres. Neither value was ever the write, which is the part #366 is\n // about and the only part `delete-redact-operation.test.ts` pins under the\n // default strategy; `nested-redact-strategy.test.ts` pins the agreement.\n //\n // Only when there is something to read. A plain `delete` still compiles to\n // one statement and opens no transaction.\n //\n // `plan.counts` is here for the same hazard in its quietest form, and the\n // two dialects disagree about it. A `_count` compiles to a correlated\n // subquery inside the `RETURNING`, and where the schema cascades:\n //\n // postgres delete … returning (select count(*) from ch …) -> 3\n // sqlite delete … returning (select count(*) from ch …) -> 0\n //\n // Measured through Bun against a real `on delete cascade` on both. Postgres\n // evaluates the subquery against the pre-statement snapshot, which is what\n // Prisma returns; SQLite evaluates it after the cascade has run, so the\n // count is 0 — a *number*, so nothing looks missing and no error is raised.\n //\n // Reading first answers it the same way it already answers the `include`\n // case, and on both dialects rather than one. A count is not a relation\n // plan, so `relations` stays empty for an `include: { _count: … }` on its\n // own — hence the separate flag rather than a wider check.\n if (op === \"delete\" && (plan.relations !== undefined || plan.counts)) {\n // **Everything but the `where`, rather than the operands named one by\n // one.** The row this reads is the row the caller gets back — `return\n // before`, below — so an operand left out here is silently un-narrowed,\n // and nothing downstream will notice. That is #364: this rebuilt the\n // projection as `select` *or* `include`, `omit` was not among the names,\n // and a `delete` that asked to drop a column got it back as soon as the\n // same call also carried an `include`. A `delete` with no relation to read\n // never reaches this branch and projects through `resolveSelection`, which\n // had honoured `omit` all along — one operation, two paths, two answers.\n //\n // **Do not turn this back into named arms.** The rest is what makes the\n // next projection operand — Prisma's `relationLoadStrategy`, a `distinct`\n // on a write, whatever it turns out to be — arrive here for free instead\n // of arriving as the same bug with a different column name. The `upsert`\n // find-then-write branch a few hundred lines up spreads for the same\n // reason and was never affected by #364.\n //\n // Bounded, not hopeful. `assertArgs` (`compile/write.ts`) rejects any\n // operand outside `WRITE_ARGS.delete` — `where`, `select`, `include`,\n // `omit` — and the plan above is already compiled, so the rest holds\n // projection operands and nothing else. That set is a strict subset of\n // `findFirst`'s, so every one of them is a legal read operand. `omit` and\n // `select` cannot both be in it: `resolveSelection` refuses that pair, and\n // a warm plan cannot smuggle it past, since both are in `LITERAL_KEYS`\n // (`plan.ts`) and so key separately. An `undefined` operand is dropped from\n // the plan key too, so carrying one costs no second cache entry.\n const { where, ...projection } = effective;\n\n // The pool, not `conn`: when a transaction is already open `withTransaction`\n // savepoints against the ambient handle and ignores this argument, and\n // passing a transaction handle here would read as though we begin on it.\n return transact(db, async () => {\n const before = await this.$exec(\n \"findFirst\",\n { where, ...projection },\n // `op` rather than the literal `\"delete\"`: the branch is guarded on\n // it, so they are the same string, and taking it from the variable\n // keeps the two from drifting if the guard ever admits a second\n // operation that has to read before it writes.\n markLenient(\n markRedactedAs(markPreScoped({ strategy: options?.strategy }), op),\n ) as never,\n );\n\n // `findFirst` shapes a miss to `null`; the caller asked for a delete, so\n // the error has to name that rather than the read this used underneath.\n if (before === null) throw new RecordNotFoundError(schema.name, op);\n\n await this.$exec(\n \"delete\",\n { where },\n markPreScoped({ strategy: options?.strategy }) as never,\n );\n\n return before;\n });\n }\n\n // A write with a nested `create` / `connect` runs more than one statement,\n // and those statements are one unit: the parent row and the children it was\n // asked for either all land or none do.\n //\n // This used to be left to the caller — \"atomic exactly when the caller\n // wrapped the call in `Model.transaction`, *not* implicitly\" — on the\n // reasoning that `$exec` cannot know whether it is one step of a larger unit\n // and that opening one per call would put a `BEGIN` around every query in\n // the framework. The second half of that is right and is why the condition\n // below is what it is; the first half does not survive contact with\n // policies. A nested write step runs the *child's* `$exec`, so the child's\n // policies are consulted mid-sequence, after the parent row is already\n // written. A child that denies therefore left a half-written parent behind,\n // and \"your policy stopped the write\" and \"your policy stopped half the\n // write\" are not the same promise.\n //\n // So: implicit, but only for the calls that are actually multi-statement.\n // A plain `create` still compiles to one statement and opens nothing, which\n // is what keeps the `BEGIN`-around-everything objection answered — and\n // inside a caller's own transaction `withTransaction` takes a savepoint\n // rather than nesting a second one.\n const finish = async (): Promise<unknown> => {\n // Re-resolved rather than reused: if the branch below opened a\n // transaction, every statement from here on belongs to it. Outside one\n // this is the same handle it already was.\n conn = currentTransaction() ?? conn;\n\n await runSteps(plan.before, effective, context, executor, []);\n\n // `unsafe` despite the name. Bun's tagged template cannot express a query\n // whose *shape* is dynamic, which every ORM query is. Safety here does not\n // come from the template syntax: it comes from the compiler's two rules —\n // identifiers only ever come from the generated schema, and every value is\n // a bound parameter. Do not \"fix\" this into a tagged template.\n const rows = await execute(\n conn,\n dialect,\n schema,\n op,\n plan.text,\n plan.bind(effective, context),\n );\n\n const result = this.$shape(plan, rows as unknown[]);\n\n // This model's encrypted columns, decrypted — before anything else reads\n // the rows, so a policy's `redact`, `track`'s snapshot and the caller all\n // see the plaintext. A value that does not decrypt throws.\n if (!raw && RETURNS_ROWS.has(op)) decryptRows(schema, rowsOf(result));\n\n // Then its typed columns (#995, #1001), parsed, so a policy's `redact`\n // and the caller see the schema's values.\n if (!raw && RETURNS_ROWS.has(op)) parseTypedRows(typedColumns, schema.name, rowsOf(result), lenient);\n\n // `skipIfUnchanged` (#664): an `update` that matched its row but changed\n // nothing wrote nothing, so `returning` came back empty. The caller still\n // gets the row, read the way the `delete` pre-read reads one — the same\n // scoped `where`, the same projection, redacted as the `update`. Only a\n // row that does not exist at all is still `RecordNotFoundError`.\n if (result === null && op === \"update\" && effective?.skipIfUnchanged === true) {\n const {\n data: _data,\n skipIfUnchanged: _skip,\n where,\n ...projection\n } = effective;\n const current = await this.$exec(\n \"findFirst\",\n { where, ...projection },\n markLenient(\n markRedactedAs(\n markPreScoped({ strategy: options?.strategy, track: options?.track }),\n op,\n ),\n ) as never,\n );\n if (current === null) throw new RecordNotFoundError(schema.name, op);\n return current;\n }\n\n // The plan shapes a single-row operation to `null` when nothing matched;\n // turning that into an error belongs here rather than in the plan, because\n // this is where the model's name is in scope for the message.\n if (result === null && ORTHROW.has(op)) {\n throw new RecordNotFoundError(schema.name, op);\n }\n\n // Rows that could not exist until this one did: the far side of a relation\n // whose foreign key lives on the child. Run before relations are attached,\n // so an `include` on the same call sees what was just written.\n await runSteps(plan.after, effective, context, executor, rowsOf(result));\n\n // ...and a `_count` on the same call has to be recomputed once they have,\n // for the same reason `include` is attached after them rather than before.\n //\n // A count is a correlated subquery inside the write's own `RETURNING`, so\n // it is evaluated at the instant the parent row is inserted — before any\n // `after` step has written a child. That produced a single response\n // contradicting itself:\n //\n // User.create({ data: { …, accounts: { create: [a, b] } },\n // include: { accounts: true, _count: { … } } })\n //\n // accounts.length 2 attached after the steps\n // _count 0 projected before them\n //\n // Both keys describe the same relation on the same row. The row itself was\n // never wrong — reading it back gives 2 — so this is the projection being\n // frozen, which is the mirror of the `delete` case above: there the count\n // is taken too late, here too early.\n //\n // **Only when there is something to be wrong about.** A write with no\n // `after` steps keeps the projected value and costs nothing extra; one\n // with both pays a single read. `plan.counts` is what makes that condition\n // cheap enough to ask on every write.\n //\n // **Between `runSteps` and the `hidden` deletion, and that is\n // load-bearing.** `select: { email, _count: … }` never asks for the\n // primary key, so the key the recount reads the row by is on it only\n // because the plan added it for the nested write and has not stripped it\n // yet. Move this after the strip and the recount loses its identifier;\n // move it before `runSteps` and there is nothing new to count.\n if (plan.counts && plan.after !== undefined) {\n await recountAfterSteps(\n schema,\n this as unknown as typeof Model,\n effective,\n rowsOf(result),\n options,\n );\n }\n\n // Relations are loaded after the root rows are shaped, one query per node\n // in the include tree. Each of those queries is `$exec` on the *related\n // model's own class*, recursively — not a private helper — so a nested read\n // is subject to everything a top-level read is.\n //\n // The planner is handed the database rather than reaching for it: that is\n // what keeps `compile/` free of a runtime import, and it is why the one\n // query with no model behind it — the implicit m-n join table — still runs\n // on the connection this call resolved.\n if (plan.relations !== undefined) {\n await attachRelations(\n plan.relations,\n plan.hidden,\n result,\n effective,\n executor,\n );\n } else if (plan.hidden !== undefined && plan.hidden.length > 0) {\n // A write can hide a key column without having any relation to attach:\n // a nested `after` step needs the parent's key returned, but the caller's\n // `select` never asked for it.\n for (const row of rowsOf(result)) {\n for (const key of plan.hidden) delete row[key];\n }\n }\n\n // A **folded** relation's rows never entered the child's `$exec`, so nothing\n // has run the child's `redact` over them. The comment below — \"a related row\n // was shaped by its own model's `$exec`\" — is true of the batched strategy\n // and false of the lateral one, which is precisely the kind of assumption\n // iteration 9 had to revisit for `scope`.\n //\n // `scope` survived the fold because policies rewrite the *argument tree*\n // before planning, and a scoped `where` lands inside the subquery. `redact`\n // cannot: it is a row transform in the shaping stage, with no argument to\n // rewrite. So the parent runs it on the child's behalf, which is the only\n // place that can.\n //\n // **`NESTED_READ`, not `op` — #388.** Running it here is a fact about where\n // the rows were shaped, not about what they are. The child is a read of\n // another model whatever statement encloses it, which is the whole reason\n // `applyNestedPolicies` scopes every nested node under the same constant,\n // and its docblock argues that at length. Handing the enclosing `op` down\n // made the *same* relation read, over the same rows, tell the child's\n // `redact` a different `context.operation` depending on which strategy\n // planned it: `findMany` batched, `findFirst` folded. A policy written as\n // `context.operation === \"findMany\"` therefore protected a child on SQLite\n // and leaked it on Postgres, for identical application code.\n // The same for decryption, and unconditionally: a folded child's rows\n // never entered its own `$exec`, so nothing has decrypted them.\n if (plan.relations !== undefined && !raw) {\n const parents = rowsOf(result);\n for (const relation of plan.relations) {\n if (relation.root === undefined) continue;\n decryptFolded(\n { as: relation.as, model: relation.model, folded: relation.root.folded },\n parents,\n );\n parseTypedFolded(\n { as: relation.as, model: relation.model, folded: relation.root.folded },\n parents,\n lenient,\n );\n }\n }\n\n if (plan.relations !== undefined && !system) {\n for (const relation of plan.relations) {\n if (relation.root === undefined) continue;\n redactFolded(\n {\n as: relation.as,\n model: relation.model,\n folded: relation.root.folded,\n },\n result,\n NESTED_READ,\n system,\n );\n }\n }\n\n // Redaction last, on the shaped result. After relations, not before: a\n // related row was shaped by its own model's `$exec` and has already been\n // through its own policy's `redact` — this one only owns its own rows.\n if (policy) applyRedaction(policies, policy, result);\n\n // Provenance, after redaction so a redacted field is not snapshotted as its\n // original value and then written back by `save`.\n //\n // Here rather than inside `$shape`, which is where the plan sketched it, for\n // one reason: `$shape` is the seam an `ActiveRecordModel` overrides to\n // return instances, and tracking there would make every such override\n // responsible for reimplementing it. Doing it at the choke point means an\n // override gets provenance for free — which is the same argument that put\n // everything else in `$exec`.\n if (options?.track === true) {\n for (const row of rowsOf(result)) track(row, schema);\n }\n\n return result;\n };\n\n const atomic =\n (plan.before !== undefined && plan.before.length > 0) ||\n (plan.after !== undefined && plan.after.length > 0);\n\n return atomic ? transact(db, finish) : finish();\n }\n\n /**\n * A static, not a module-level function, so subclassing is the extension\n * mechanism: a future `ActiveRecordModel` overrides this to build instances,\n * and every model extending it gets that with no change to the operations. It\n * is also where iteration 8 populates row provenance.\n */\n static $shape(plan: QueryPlan, rows: unknown[]): unknown {\n return plan.shape(rows);\n }\n}\n\n/**\n * Whether `queried` can only have the policies `registered` has.\n *\n * True for a direct subclass that declares none of its own — which is what\n * `Model.on(name)` builds, and also what `class AdminUser extends User {}` is.\n * `policiesFor` walks the prototype chain and takes each level's own\n * `$policies`; a level that declares none contributes nothing, so the walk from\n * here and the walk from the parent visit the same levels in the same order and\n * cannot disagree.\n *\n * Structural rather than a flag on the classes `on` mints, so the typed-view\n * subclass the divergence guard already argues should be allowed gets the same\n * short-circuit rather than paying for a second resolution of the chain.\n *\n * `$policy` — the removed name — is deliberately not checked: `policiesFor` has\n * already walked this class by the time this is called, and it raises on that\n * name at any level, so a class carrying it never reaches here.\n */\nfunction inheritsPoliciesFrom(queried: unknown, registered: unknown): boolean {\n return (\n Object.getPrototypeOf(queried) === registered &&\n !Object.hasOwn(queried as object, \"$policies\")\n );\n}\n\n/**\n * The subclasses `withTrashed()` / `onlyTrashed()` return, per class and mode,\n * so `User.withTrashed()` is the same class every time — like `Model.on`'s.\n */\nconst trashedViews = new WeakMap<object, Map<TrashedMode, unknown>>();\n\n/**\n * `withTrashed` / `onlyTrashed`, both spellings.\n *\n * The chain is a bound subclass for the reasons `Model.on` gives for being\n * one — the generated statics are inherited, `$exec`'s `this` stays the\n * subclass, and a subclass that declares no `$policies` is recognised by the\n * divergence guard as carrying its parent's. The block is an ambient scope\n * keyed by model name, because it has to reach reads of this model that start\n * from another one.\n */\nfunction trashedView(\n model: typeof Model,\n mode: TrashedMode,\n fn: (() => Promise<unknown>) | undefined,\n): unknown {\n // Refused in both spellings: lifting a scope the model does not have is a\n // misunderstanding, and silently doing nothing would let it stand. The block\n // rejects rather than throws, like the operations it wraps; the chain has no\n // promise to reject, so it throws where it is written.\n const method = mode === \"with\" ? \"withTrashed\" : \"onlyTrashed\";\n\n if (fn !== undefined) {\n return Promise.resolve().then(() => {\n requireSoftDeletes(model, method);\n return runWithTrashed(model.$modelSchema().name, mode, fn);\n });\n }\n\n requireSoftDeletes(model, method);\n\n let byMode = trashedViews.get(model);\n if (byMode === undefined) trashedViews.set(model, (byMode = new Map()));\n\n const cached = byMode.get(mode);\n if (cached !== undefined) return cached;\n\n const bound = class extends model {\n static $trashed = mode;\n };\n Object.defineProperty(bound, \"name\", {\n value: (model as { name: string }).name,\n configurable: true,\n });\n\n byMode.set(mode, bound);\n return bound;\n}\n\n/**\n * The column `$softDeletes` names for a query on `model`: read off the queried\n * class when it says anything, and off the registered one otherwise — so a\n * query through the generated base still hides deleted rows when the\n * application's subclass owns the name.\n */\nfunction softDeleteFieldOf(\n model: unknown,\n schema: ModelSchema,\n registered: unknown,\n): string | undefined {\n const own = (model as { $softDeletes?: SoftDeletesSetting }).$softDeletes;\n return softDeleteField(\n (own !== undefined || registered === undefined ? model : registered) as {\n $softDeletes?: SoftDeletesSetting;\n },\n schema,\n );\n}\n\n/** The model's soft-delete column, or a refusal naming the method that needed one. */\nfunction requireSoftDeletes(model: typeof Model, method: string): string {\n const schema = model.$modelSchema();\n const field = softDeleteFieldOf(\n model,\n schema,\n registry.has(schema.name) ? registry.get<unknown>(schema.name) : undefined,\n );\n\n if (field === undefined) {\n throw new UnsupportedQueryError(\n method,\n schema.name,\n method,\n `${schema.name} does not soft-delete. Set \\`static $softDeletes = true\\` ` +\n `on the model class (or \\`{ field: \"<column>\" }\\`) to use ${method}.`,\n );\n }\n\n return field;\n}\n\nasync function runSteps(\n steps: NestedWriteStep[] | undefined,\n args: any,\n context: BindContext,\n executor: RelationExecutor,\n rows: readonly Record<string, unknown>[],\n): Promise<void> {\n if (steps === undefined) return;\n // Sequentially, for the same reason relations load sequentially: inside an\n // ambient transaction every statement runs on one reserved connection, where\n // concurrent statements are not safe.\n for (const step of steps) {\n await step.run(args, context, executor, rows);\n }\n}\n\n/**\n * The skew warning, gated on this process's **zone** — resolved once, here.\n *\n * Reading the clock per call cost a `Date` allocation on the one path every\n * query takes — ~60ns, against under a nanosecond for the closed-over boolean\n * that replaces it — and the latch inside only ever closes on a *firing*, so\n * the deployment that is configured correctly and never warns paid it forever.\n *\n * `clockCouldSkew()` asks the question whose answer cannot change under a\n * running process: not \"is the offset zero today\", which is also true of\n * `Europe/London` every winter, but \"is this zone ever off UTC at all\". A UTC\n * process never enters the check; anything else stops entering once it has said\n * its piece, and reads the clock only until then — see `protocol-skew.ts`,\n * which owns both halves so that both can be tested from a UTC machine.\n */\nconst warnProtocolSkewOnce = createProtocolSkewWarner(clockCouldSkew(), () =>\n new Date().getTimezoneOffset(),\n);\n\n/**\n * Runs the statement and translates the failures that have a typed home.\n *\n * A unique violation is the one every application branches on, and every driver\n * reports it differently — SQLite as a message with a code, Postgres as a\n * SQLSTATE with a constraint name. Asking the dialect keeps that difference\n * behind the same seam as everything else, and turning it into an error that\n * names *fields* rather than columns is what makes it useful to a caller that\n * has never seen the database's names.\n */\nasync function execute(\n conn: Pick<SQL, \"unsafe\">,\n dialect: SqlDialect,\n schema: ModelSchema,\n op: Operation,\n text: string,\n values: unknown[],\n): Promise<unknown> {\n // Said once per process, and only for the configuration that silently returns\n // the wrong instant — see `protocol-skew.ts`. Printing is left here because\n // this is the layer allowed to talk to the operator; deciding is not, because\n // nothing that needs a database can be tested in the one configuration CI\n // runs.\n const warning = warnProtocolSkewOnce(dialect.name, schema, text, values);\n if (warning) console.warn(warning);\n\n try {\n return await conn.unsafe(text, values);\n } catch (error) {\n const violation = dialect.constraintViolation(error);\n if (!violation) throw error;\n\n throw new UniqueConstraintError(\n schema.name,\n op,\n fieldsForColumns(schema, violation.columns),\n violation.constraint,\n { cause: error },\n );\n }\n}\n\n/**\n * Driver column names back to Prisma field names, so the error reads in the\n * caller's vocabulary. A column with no matching field is reported as-is rather\n * than dropped: it is still the truest thing we know about the failure.\n */\nfunction fieldsForColumns(\n schema: ModelSchema,\n columns: readonly string[],\n): string[] {\n return columns.map((column) => {\n for (const field of Object.values(schema.fields)) {\n if (field.column === column) return field.name;\n }\n return column;\n });\n}\n\n/**\n * Re-reads the `_count` for rows whose children were written by an `after` step.\n *\n * One read per row rather than one for all of them, and that is not a\n * concession: every write that can carry both a `_count` and an `after` step is\n * a single-row operation — `create`, `update`, `upsert`. `createMany` takes no\n * `include` at all. So the loop runs once, and writing it as a loop keeps a\n * compound primary key expressible without an `in` list over tuples.\n *\n * **Pre-scoped, deliberately.** `effective` has already been through this\n * model's policies and `applyNestedPolicies` has already scoped the `_count`\n * node, so re-applying them would `AND` the same predicate twice — the same\n * rows, a different plan key. This is the same reasoning `delete`'s read-first\n * path uses, a few hundred lines up.\n */\nasync function recountAfterSteps(\n schema: ModelSchema,\n model: typeof Model,\n effective: any,\n rows: Record<string, unknown>[],\n options: unknown,\n): Promise<void> {\n const node = effective?.include?._count ?? effective?.select?._count;\n if (node === undefined || rows.length === 0) return;\n\n for (const row of rows) {\n // **Every component present, or nothing.** What the plan guarantees is on\n // the row is the *link* field — `planForeignSide` pushes `link.parentField`\n // into `keyFields`, which is the column the relation `references`, and that\n // is the primary key only by convention. Declare a relation\n // `references: [publicId]`, ask for `select: { email, _count }`, and `id` is\n // simply not there.\n //\n // The failure that would produce is the bad kind. `compileWhere` drops\n // `undefined` keys, so a `where` built entirely from missing components\n // compiles to **no predicate at all**:\n //\n // findFirst({ where: { id: undefined } }) -> select … from \"User\" limit ?\n //\n // — an arbitrary row, whose count is a plausible number rather than an\n // error. So an incomplete key means the projected value stands, which is\n // the same answer this already gives for a missing row: stale, not\n // invented. Nothing here can be salvaged by guessing.\n const where: Record<string, unknown> = {};\n let identified = schema.primaryKey.length > 0;\n for (const field of schema.primaryKey) {\n const value = row[field];\n if (value === undefined) {\n identified = false;\n break;\n }\n where[field] = value;\n }\n if (!identified) continue;\n\n const fresh = (await (model as any).$exec(\n \"findFirst\",\n { where, select: { _count: node } },\n markPreScoped({ strategy: (options as any)?.strategy }),\n )) as Record<string, unknown> | null;\n\n // `null` only if the row vanished between the write and this read, which\n // inside the write's own transaction it cannot. Leaving the projected value\n // alone is still the right fallback: it is stale, not invented.\n if (fresh && fresh._count !== undefined) row._count = fresh._count;\n }\n}\n\nfunction rowsOf(result: unknown): Record<string, unknown>[] {\n if (Array.isArray(result)) return result as Record<string, unknown>[];\n if (result === null || result === undefined) return [];\n if (typeof result !== \"object\") return [];\n return [result as Record<string, unknown>];\n}\n\n/**\n * Splits a `createMany` that would exceed the driver's parameter ceiling, or\n * returns `null` when it fits.\n *\n * The ceiling is enforced in `render`, so the only way to learn that a call is\n * too large is to try compiling it. That is deliberate rather than lazy: a size\n * check ahead of every write would cost every write, and the plan cache means\n * the compile is paid once per shape anyway.\n *\n * The chunk size comes from **binding one row**, not from dividing the reported\n * total. Division looks equivalent and is not: `required` includes whatever the\n * statement binds besides the rows, so on a shape with any fixed overhead it\n * understates the per-row cost and produces a chunk that is still too large.\n * Binding a single row asks the compiler the question directly.\n */\nfunction chunkedCreateMany(\n schema: ModelSchema,\n args: any,\n dialect: SqlDialect,\n strategy: RelationStrategy,\n op: Operation,\n): unknown[][] | null {\n const rows = args.data as unknown[];\n if (rows.length < 2) return null;\n\n try {\n getOrCompile(schema, op, args, dialect, strategy);\n return null;\n } catch (error) {\n if (!(error instanceof ParameterLimitError)) throw error;\n\n const single = { ...args, data: [rows[0]] };\n const perRow = getOrCompile(schema, op, single, dialect, strategy).bind(\n single,\n createBindContext(),\n ).length;\n\n // One row on its own over the ceiling is not a chunking problem — no split\n // can help, and the original error says the useful thing.\n if (perRow === 0 || perRow > error.limit) throw error;\n\n const size = Math.floor(error.limit / perRow);\n const chunks: unknown[][] = [];\n for (let at = 0; at < rows.length; at += size) {\n chunks.push(rows.slice(at, at + size));\n }\n return chunks;\n }\n}\n\n/**\n * Whether an `upsert` has to become a read and a write.\n *\n * True exactly when `create` leaves part of the conflict key unset, which is the\n * case `on conflict` cannot express — the insert could never collide on the\n * target, so the update branch would be unreachable.\n *\n * A `where` that names no unique key, or names several, is not this function's\n * to report: it returns false and lets the ordinary path raise the error it\n * already has for that, with the message it already has.\n */\nfunction findThenWrite(schema: ModelSchema, args: any, op: Operation): boolean {\n try {\n const key = matchUniqueKey(schema, args?.where, {\n model: schema.name,\n operation: op,\n argument: \"where\",\n });\n return upsertAbsentConflictKey(schema, args, key).length > 0;\n } catch {\n return false;\n }\n}\n\n/**\n * Runs a folded relation's own `redact` over the rows the strategy inlined, and\n * then its descendants' over theirs.\n *\n * Only for a plan carrying `root` — a batched child came back through its own\n * `$exec` and has already redacted itself, and doing it twice is harmless but\n * pointless. Only outside `asSystem`, like every other policy.\n *\n * **Recursive, because the fold is.** A lateral node folds its whole subtree into\n * one statement, so a grandchild's rows never enter its model's `$exec` either —\n * and stopping at depth 1 would leave exactly the rows nobody thinks to check\n * unredacted. `RootContribution.folded` is the shape of what was folded, which is\n * the only thing that makes the walk possible.\n *\n * The child's policies are resolved through the registry by name, so this obeys\n * the same rule every nested read does: whatever is registered under that name\n * is the class whose policies apply.\n */\nfunction redactFolded(\n relation: { as: string; model: string; folded?: readonly FoldedRelation[] },\n result: unknown,\n op: Operation,\n system: boolean,\n): void {\n const target = registry.has(relation.model)\n ? registry.get<unknown>(relation.model)\n : undefined;\n const policies = target ? policiesFor(target) : [];\n const nested = relation.folded ?? [];\n\n if (policies.length === 0 && nested.length === 0) return;\n\n const context =\n policies.length > 0\n ? policyContext(\n (target as { $schema?: { name?: string } }).$schema?.name ??\n relation.model,\n op,\n currentUser(),\n system,\n )\n : undefined;\n\n // Collected whether or not *this* level redacts anything: an unpolicied model\n // in the middle of the tree must not hide a policied one below it.\n const children: Record<string, unknown>[] = [];\n\n for (const parent of rowsOf(result)) {\n const rows = parent?.[relation.as];\n if (rows === undefined || rows === null) continue;\n if (context) applyRedaction(policies, context, rows);\n if (nested.length > 0) children.push(...rowsOf(rows));\n }\n\n for (const child of nested) redactFolded(child, children, op, system);\n}\n\n/**\n * Marks an `$exec` call as issued by the ORM itself — a nested write step or a\n * relation read — rather than by the application. A module-private `Symbol`,\n * like `PRE_SCOPED` in `policy.ts`, so it cannot be set from outside. Read only\n * by the `$skipNoopUpdates` default (#664).\n */\nconst ORM_ISSUED = Symbol(\"gemi.orm.issuedByTheOrm\");\n\nfunction markOrmIssued(options: object): object {\n return { ...options, [ORM_ISSUED]: true };\n}\n\nfunction isOrmIssued(options: unknown): boolean {\n return (\n typeof options === \"object\" &&\n options !== null &&\n (options as Record<symbol, unknown>)[ORM_ISSUED] === true\n );\n}\n",
|
|
33
33
|
"import { Model } from \"./Model\";\nimport type { QueryPlan } from \"./plan\";\n\n/**\n * Every query returns instances, achieved **purely** by overriding `$shape`.\n *\n * This is iteration 8's deliverable 4, and its job is to prove invariant 3 was\n * worth holding: `$shape` is a static on the model base rather than a\n * module-level function, so a subclass can change what a query *returns* without\n * any operation knowing. If that had required touching an\n * operation, it would have been a design defect to fix while the cost was still\n * small.\n *\n * It did not. The whole tier is the method below.\n *\n * class Post extends ActiveRecordModel {\n * static $schema = schema.Post\n * get excerpt() { return this.body.slice(0, 100) }\n * }\n *\n * const posts = await Post.findMany({}) // Post instances\n * posts[0].excerpt\n * await posts[0].save()\n *\n * **Shipped as a documented example, not a supported tier.** Two reasons, and\n * neither is effort:\n *\n * 1. It reintroduces the conflict `wrap` exists to avoid. Queries hydrate\n * unconditionally here, so `select: { id: true }` produces an instance whose\n * methods can read fields the query never fetched — a runtime crash the type\n * system cannot see, because the operations' return types still describe\n * plain narrowed payloads. `wrap` requires a complete row precisely so that\n * cannot happen; this trades that guarantee for ergonomics.\n * 2. The return *types* do not change. `findMany` is still typed as returning\n * `Prisma.PostGetPayload<T>[]`, so the instance methods are invisible to\n * TypeScript at the call site even though they are there at runtime. Fixing\n * that means conditional return types across every operation, which is\n * exactly the complexity the POJO baseline was chosen to avoid.\n *\n * So this file is evidence that the seam works, and a warning about what using\n * it costs. If the tier is ever pursued properly it needs its own plan — see the\n * out-of-scope section of `plans/orm/08-eloquent-doorway.md`, which is explicit\n * that half an identity map is worse than none.\n */\nexport abstract class ActiveRecordModel extends Model {\n /**\n * The one override. `plan.shape` still does all the work — decoding, key\n * mapping, relation placeholders — and this only decides what the resulting\n * data is *carried in*.\n *\n * Note what is not here: no per-operation branching, no knowledge of which of\n * the operations is running, and no second code path for writes. A\n * `count` returns a number and an `updateMany` returns `{ count }`; both fall\n * through untouched because they are not rows.\n */\n static override $shape(plan: QueryPlan, rows: unknown[]): unknown {\n const shaped = plan.shape(rows);\n\n if (Array.isArray(shaped)) {\n return shaped.map((row) => this.hydrate(row));\n }\n\n // A single-row operation shapes to `null` when nothing matched, and a\n // counting one to `{ count }`. Neither is a row, and hydrating either would\n // be the kind of special case this override exists to show is unnecessary.\n if (shaped === null || typeof shaped !== \"object\") return shaped;\n if (\"count\" in (shaped as object)) return shaped;\n\n return this.hydrate(shaped);\n }\n\n /**\n * Builds one instance. Separate so a subclass can decide what hydration means\n * — a value object per column, a lazily-decoded field — without reimplementing\n * the shape dispatch above.\n *\n * Goes through `Model.wrap`, so an instance from a query is tracked exactly as\n * one from `wrap` is and `save()` works on it. That reuse is the point: there\n * is one definition of \"a row became an instance\".\n */\n protected static hydrate(row: unknown): unknown {\n if (row === null || typeof row !== \"object\") return row;\n return (this as unknown as typeof Model).wrap(row as object);\n }\n}\n",
|
|
34
34
|
"/**\n * `take` / `skip` built from a request, so that a query string cannot produce a\n * value the compiler refuses.\n *\n * **This file is not `compile/paginate.ts`, and the two do opposite jobs.** That\n * one is the compiler's *validator*: `assertPageArgument` refuses a `take` or a\n * `skip` that is not an integer, and its note explains at length why refusing is\n * the only honest answer — a fraction is an opaque `SQLITE_MISMATCH` on one\n * dialect and a silent disagreement with both Prisma and the other dialect on\n * the second. Read that note (`compile/paginate.ts:9-63`) for the reasoning; it\n * is not restated here.\n *\n * This file is the other half, and the half that was missing. A refusal is only\n * useful if the correct spelling is available and short — otherwise the fix a\n * caller reaches for is `Math.floor` sprinkled at whichever call site happened\n * to throw, which fixes one of them. `paginate` is the shorter spelling:\n *\n * const { take, skip } = paginate({\n * page: req.search.get(\"page\"),\n * perPage: req.search.get(\"perPage\"),\n * })\n * await Post.findMany({ take, skip, orderBy: { createdAt: \"desc\" } })\n *\n * against the shape gemi's own documentation used to teach, which breaks:\n *\n * const limit = Number(req.search.get(\"limit\")) || 25 // ?limit=1.5\n *\n * **Why the arguments are `unknown` and not `number`.** A query string is where\n * these values come from — that is the entire point of the helper, and typing\n * them as `number` would mean every caller writes the `Number(...)` that is the\n * bug. `req.search.get` hands back `string | string[]` (`http/HttpRequest.ts:211-223`\n * collects repeated keys into an array), a JSON body hands back whatever was\n * sent, and both arrive here unconverted.\n *\n * **The coercions, measured rather than assumed.** Each of these is a shape a\n * real query string produces, and each one is why the rules below are not simply\n * `Number(...)`:\n *\n * Number(\"\") 0 `?perPage=` — a form's blank field\n * Number(\" \") 0 the same, url-encoded\n * Number(null) 0 an absent key read off a plain object\n * Number([\"2\"]) 2 a single repeated key\n * Number([\"1\",\"2\"]) NaN two of them — so `Number` honours a\n * repeated param sometimes and not others\n * Number(\"1e400\") Infinity not a number `Math.trunc` can fix\n * Number(true) 1\n *\n * The `0`s are the dangerous ones. `page: 0` computes `skip: -25`, and\n * `assertPageArgument` refuses a negative `skip` outright — so a blank field in\n * a form is a 500. `perPage: 0` is worse, because it is *not* refused: `take: 0`\n * is a perfectly good integer and returns an empty page for ever.\n *\n * So an empty or blank string means **absent**, not zero, and anything that is\n * not a number or a string is absent too. Coercing a boolean or a one-element\n * array would be honouring input no HTTP surface can actually send, at the cost\n * of the rule being explainable.\n *\n * **Why `skip` is capped.** `?page=1e300` is finite, so it survives every check\n * above and multiplies out to a `skip` of `2.5e301`. Measured through Bun\n * against SQLite, binding an offset past int64:\n *\n * offset 1e18 -> ok\n * offset 9223372036854775807 -> SQLiteError: datatype mismatch\n * offset 1e20 -> SQLiteError: datatype mismatch\n *\n * — the same `SQLITE_MISMATCH` the fractional-`take` note records, reached from\n * the other end. The cap is `Number.MAX_SAFE_INTEGER` rather than int64's\n * ceiling: it is well inside what both drivers bind, it needs no per-dialect\n * measurement, and above it JavaScript's own arithmetic stops being exact, so a\n * number past it was never a page anybody could count to.\n *\n * **The guarantee, which is the whole contract:** every return value is a pair\n * of integers with `take >= 1` and `skip >= 0`, for every input. It is therefore\n * impossible for `paginate`'s output to be something `assertPageArgument`\n * refuses, and `page-args.test.ts` asserts exactly that by running the validator\n * over the output of a table of hostile query-string values rather than by\n * re-checking the arithmetic.\n */\n\n/**\n * The default page size, and it is not an invented number: `docs/controllers.md`\n * and `docs/routing.md` both taught `Number(req.search.get(\"limit\")) || 25`. The\n * helper replaces those examples, and picking a different default would silently\n * change the page size of every call site rewritten onto it.\n */\nconst DEFAULT_PER_PAGE = 25;\n\n/**\n * The ceiling on a *request-supplied* page size. Its job is that `?perPage=100000`\n * cannot ask for the whole table — one request that reads a million rows into\n * memory is a denial of service the caller did not have to authenticate for.\n *\n * A hundred rather than \"no ceiling at all\", because a helper whose ceiling is\n * opt-in has no ceiling in the code that most needs one. An endpoint that\n * genuinely serves larger pages says so at the call site — `paginate(args,\n * { maxPerPage: 500 })` — which is one visible decision instead of an invisible\n * default.\n */\nconst DEFAULT_MAX_PER_PAGE = 100;\n\n/**\n * See the cap discussion above. Exported so the test can assert the boundary\n * against the same constant the implementation clamps to, rather than repeating\n * the literal and agreeing with itself.\n */\nexport const MAX_SKIP = Number.MAX_SAFE_INTEGER;\n\n/**\n * A query-string value as a whole number, or `null` for \"absent\".\n *\n * `null` rather than a default, so the two callers below can apply *their* own\n * default — the page defaults to 1 and the size defaults to `perPage`, and\n * folding that in here would mean one of them lying about which.\n */\nfunction toWholeNumber(value: unknown): number | null {\n if (typeof value === \"string\") {\n // Measured above: `Number(\"\")` is 0. `?perPage=` is what a browser sends\n // for a blank field, and reading it as zero rather than as absent is how a\n // cleared filter box becomes an empty page.\n if (value.trim() === \"\") return null;\n } else if (typeof value !== \"number\") {\n // Arrays, objects, booleans, `null`, `undefined`. Every one of them has a\n // `Number()` answer and not one of them has a *meaning* — see the table.\n return null;\n }\n\n const parsed = Number(value);\n // Catches `NaN` and both infinities in one test, which is what `Math.trunc`\n // cannot do: `Math.trunc(Infinity)` is `Infinity`, and `Number.isInteger`\n // then says false, so an untruncatable value would reach the compiler and be\n // refused there — by this helper, which exists so that cannot happen.\n if (!Number.isFinite(parsed)) return null;\n\n // Toward zero, which is what Prisma does with a fractional `take` (measured\n // in `compile/paginate.ts`). Matching it means a caller who moves off Prisma\n // keeps the same page, rather than trading a crash for a different answer.\n return Math.trunc(parsed);\n}\n\nconst clamp = (value: number, low: number, high: number) =>\n Math.min(Math.max(value, low), high);\n\n/**\n * Turn `{ page, perPage }` — as read off a query string, in whatever state the\n * client left them — into a `take` / `skip` pair the ORM accepts.\n *\n * paginate({ page: \"2\" }) { take: 25, skip: 25 }\n * paginate({ page: \"2.5\" }) { take: 25, skip: 25 }\n * paginate({ page: \"0\" }) { take: 25, skip: 0 }\n * paginate({ page: \"abc\" }) { take: 25, skip: 0 }\n * paginate({ perPage: \"1000\" }) { take: 100, skip: 0 }\n * paginate({ perPage: \"10\" }, { maxPerPage: 5 }) { take: 5, skip: 0 }\n */\nexport function paginate(\n args: { page?: unknown; perPage?: unknown },\n options: {\n /** The page size when the request does not name one. Default 25. */\n perPage?: number;\n /** The largest page size a *request* may ask for. Default 100. */\n maxPerPage?: number;\n } = {},\n): { take: number; skip: number } {\n // The options are code rather than user input, so it is tempting to trust\n // them. They are clamped anyway, because the guarantee this function makes is\n // unconditional — `paginate(args, { perPage: 0 })` returning `take: 0` would\n // be an empty page for ever, with the helper's own name on it.\n //\n // `Infinity` is honoured rather than rejected, and it is the one place the\n // options are read differently from the arguments. `toWholeNumber` refuses a\n // non-finite value because that rule is about hostile input — `?perPage=1e400`\n // is `Infinity`, and binding it as a `take` is not a page size. Reusing the\n // same rule here made `{ maxPerPage: Infinity }`, the natural spelling of \"no\n // ceiling\", fall back to the default 100 instead: an internal export written\n // to opt out of the cap silently got it back, returned a plausible first page,\n // and was found when somebody noticed 900 rows missing. The caller who writes\n // `Infinity` here is the application, saying so deliberately.\n const maxPerPage =\n options.maxPerPage === Infinity\n ? Infinity\n : Math.max(1, toWholeNumber(options.maxPerPage) ?? DEFAULT_MAX_PER_PAGE);\n const fallback = clamp(\n toWholeNumber(options.perPage) ?? DEFAULT_PER_PAGE,\n 1,\n maxPerPage,\n );\n\n const perPage = clamp(toWholeNumber(args?.perPage) ?? fallback, 1, maxPerPage);\n\n // Page 1 is the first page, and there is no page 0 — a `page` below 1 is\n // clamped up rather than refused, because the values that land there are\n // `\"\"`, `\"0\"` and `\"-1\"`, and none of them is a request for a page that does\n // not exist. Refusing would put a 500 on a link somebody edited by hand.\n const page = Math.max(toWholeNumber(args?.page) ?? 1, 1);\n\n // Clamped after multiplying rather than by bounding `page` first: the product\n // is the thing that has to stay exact, and `page` alone cannot be bounded\n // without knowing `perPage` anyway.\n const skip = Math.min((page - 1) * perPage, MAX_SKIP);\n\n return { take: perPage, skip };\n}\n",
|
|
35
35
|
"// A compact description of the models, for a prompt (#1065).\n//\n// An AI agent that writes SQL needs to know the tables, their columns and how\n// they relate, in as few tokens as possible, and the summary must not go stale\n// the way a hand-pasted schema does. The generated artifact already has all of\n// it, so this reads the registered schemas (or ones it is handed) and writes\n// one line per model.\n//\n// Secrets are the other half: a column marked `/// @gemi.sensitive` (or\n// encrypted, or named in `sensitive`) is marked in the summary so the model\n// knows not to select it, or left out with `sensitiveColumns: \"omit\"`.\n\nimport * as registry from \"./registry\";\nimport type { FieldSchema, ModelSchema, RelationSchema } from \"./schema\";\n\nexport type DescribeSchemaOptions = {\n /**\n * The schemas to describe. Default: every registered model. Takes a list,\n * or the generated module itself (`import * as schema from\n * \"./models/generated/schema\"`), whose non-schema exports are skipped.\n */\n schemas?: readonly ModelSchema[] | Record<string, unknown>;\n /** Only these models, by name. Default: all of them. */\n models?: readonly string[];\n /** Models (`\"Session\"`) or fields (`\"User.password\"`) left out entirely. */\n exclude?: readonly string[];\n /**\n * Fields (`\"User.verificationToken\"`) to treat as sensitive, beside the ones\n * marked `/// @gemi.sensitive` and the encrypted ones.\n */\n sensitive?: readonly string[];\n /**\n * What a sensitive column looks like in the summary: `\"mark\"` (the\n * default) keeps it with `[sensitive]`, so the model knows it exists and\n * not to select it; `\"omit\"` leaves it out.\n */\n sensitiveColumns?: \"mark\" | \"omit\";\n};\n\n/** One column, as `describeSchemaModels` reports it. */\nexport type SchemaColumnSummary = {\n field: string;\n /** The database column, which differs from `field` under `@map`. */\n column: string;\n type: string;\n nullable: boolean;\n primaryKey: boolean;\n /** A single-column unique key. Composite ones are on the model. */\n unique: boolean;\n list: boolean;\n enum?: string;\n sensitive: boolean;\n};\n\n/** One relation, as `describeSchemaModels` reports it. */\nexport type SchemaRelationSummary = {\n name: string;\n model: string;\n kind: \"one\" | \"many\";\n nullable: boolean;\n /** This model's foreign key columns, on the side that holds them. */\n from: string[];\n /** The related model's columns they point at. */\n to: string[];\n /** The join table of an implicit many-to-many. */\n joinTable?: string;\n};\n\n/** One model, as `describeSchemaModels` reports it. */\nexport type SchemaModelSummary = {\n name: string;\n table: string;\n columns: SchemaColumnSummary[];\n relations: SchemaRelationSummary[];\n primaryKey: string[];\n /** Composite unique keys, as column names. */\n uniques: string[][];\n};\n\n/**\n * The models as data: tables, columns (database names beside field names),\n * keys and relations, with sensitive columns flagged or left out. What\n * `describeSchema` writes, for a tool that answers \"describe these tables\".\n */\nexport function describeSchemaModels(options: DescribeSchemaOptions = {}): SchemaModelSummary[] {\n const schemas = schemasFrom(options.schemas);\n const only = options.models ? new Set(options.models) : undefined;\n const excludedModels = new Set<string>();\n const excludedFields = new Set<string>();\n for (const entry of options.exclude ?? []) {\n if (entry.includes(\".\")) excludedFields.add(entry);\n else excludedModels.add(entry);\n }\n const sensitive = new Set(options.sensitive ?? []);\n const omit = options.sensitiveColumns === \"omit\";\n if (only) {\n const known = new Set(schemas.map((schema) => schema.name));\n const unknown = [...only].filter((name) => !known.has(name));\n if (unknown.length > 0) {\n throw new Error(\n `describeSchema: no model named ${unknown.map((name) => `\"${name}\"`).join(\", \")}. ` +\n `The models are: ${[...known].join(\", \")}.`,\n );\n }\n }\n\n const out: SchemaModelSummary[] = [];\n for (const schema of schemas) {\n if (only && !only.has(schema.name)) continue;\n if (excludedModels.has(schema.name)) continue;\n const isSensitive = (field: FieldSchema) =>\n field.sensitive === true ||\n field.encrypted === true ||\n sensitive.has(`${schema.name}.${field.name}`);\n const singleUniques = new Set(\n schema.uniques.filter((key) => key.length === 1).map((key) => key[0]),\n );\n const columnOf = (name: string) => schema.fields[name]?.column ?? name;\n\n const columns: SchemaColumnSummary[] = [];\n for (const field of Object.values(schema.fields)) {\n if (excludedFields.has(`${schema.name}.${field.name}`)) continue;\n const secret = isSensitive(field);\n if (secret && omit) continue;\n columns.push({\n field: field.name,\n column: field.column,\n type: field.type,\n nullable: field.nullable,\n primaryKey: schema.primaryKey.includes(field.name),\n unique: singleUniques.has(field.name),\n list: field.isList === true,\n ...(field.enum ? { enum: field.enum } : {}),\n sensitive: secret,\n });\n }\n\n const relations: SchemaRelationSummary[] = [];\n for (const relation of Object.values(schema.relations)) {\n if (excludedModels.has(relation.model)) continue;\n if (excludedFields.has(`${schema.name}.${relation.name}`)) continue;\n relations.push(relationSummary(relation, columnOf, schemas));\n }\n\n out.push({\n name: schema.name,\n table: schema.table,\n columns,\n relations,\n primaryKey: schema.primaryKey.map(columnOf),\n uniques: schema.uniques.filter((key) => key.length > 1).map((key) => key.map(columnOf)),\n });\n }\n return out;\n}\n\n/**\n * The models as prompt-ready text: one line per model, with its table, its\n * columns (`field:Type`, the database column after `@` when `@map` renamed\n * it, `?` for nullable, `[]` for a list, flags in brackets) and its\n * relations, in registry (declaration) order, so the same schema always\n * gives the same text and the prompt cache holds.\n *\n * User table \"users\": id:Int [pk], email:String [unique], name:String?,\n * passwordHash@password_hash:String [sensitive]; relations: posts -> Post[]\n *\n * Sensitive columns are marked `[sensitive]` (or left out with\n * `sensitiveColumns: \"omit\"`). See `DescribeSchemaOptions`.\n */\nexport function describeSchema(options: DescribeSchemaOptions = {}): string {\n const models = describeSchemaModels(options);\n const lines = models.map((model) => {\n const columns = model.columns.map(describeColumn).join(\", \");\n const parts = [`${model.name} table \"${model.table}\": ${columns}`];\n if (model.uniques.length > 0) {\n parts.push(`unique (${model.uniques.map((key) => key.join(\", \")).join(\"), (\")})`);\n }\n if (model.relations.length > 0) {\n parts.push(`relations: ${model.relations.map(describeRelation).join(\", \")}`);\n }\n return parts.join(\"; \");\n });\n const legend = models.some((model) => model.columns.some((column) => column.sensitive))\n ? \"\\nColumns marked [sensitive] hold secrets: never select them.\"\n : \"\";\n return lines.join(\"\\n\") + legend;\n}\n\nfunction describeColumn(column: SchemaColumnSummary): string {\n const name = column.column === column.field ? column.field : `${column.field}@${column.column}`;\n const type = (column.enum ? `${column.enum}(enum)` : column.type) + (column.list ? \"[]\" : \"\");\n const flags = [\n column.primaryKey ? \"pk\" : null,\n column.unique ? \"unique\" : null,\n column.sensitive ? \"sensitive\" : null,\n ].filter(Boolean);\n return `${name}:${type}${column.nullable ? \"?\" : \"\"}${flags.length > 0 ? ` [${flags.join(\", \")}]` : \"\"}`;\n}\n\nfunction describeRelation(relation: SchemaRelationSummary): string {\n const target = `${relation.model}${relation.kind === \"many\" ? \"[]\" : relation.nullable ? \"?\" : \"\"}`;\n if (relation.joinTable) return `${relation.name} -> ${target} via \"${relation.joinTable}\"`;\n if (relation.from.length > 0) {\n const on = relation.from\n .map((column, index) => `${column} = ${relation.model}.${relation.to[index] ?? \"?\"}`)\n .join(\" and \");\n return `${relation.name} -> ${target} on ${on}`;\n }\n return `${relation.name} -> ${target}`;\n}\n\nfunction relationSummary(\n relation: RelationSchema,\n columnOf: (name: string) => string,\n schemas: readonly ModelSchema[],\n): SchemaRelationSummary {\n const target = schemas.find((schema) => schema.name === relation.model);\n return {\n name: relation.name,\n model: relation.model,\n kind: relation.kind,\n nullable: relation.nullable,\n from: relation.from.map(columnOf),\n to: relation.to.map((name) => target?.fields[name]?.column ?? name),\n ...(relation.joinTable ? { joinTable: relation.joinTable.table } : {}),\n };\n}\n\nfunction isModelSchema(value: unknown): value is ModelSchema {\n return (\n typeof value === \"object\" &&\n value !== null &&\n typeof (value as ModelSchema).name === \"string\" &&\n typeof (value as ModelSchema).table === \"string\" &&\n typeof (value as ModelSchema).fields === \"object\" &&\n typeof (value as ModelSchema).relations === \"object\"\n );\n}\n\nfunction schemasFrom(given: DescribeSchemaOptions[\"schemas\"]): ModelSchema[] {\n if (given !== undefined) {\n const values = Array.isArray(given) ? given : Object.values(given);\n return values.filter(isModelSchema);\n }\n // A model can be registered under more than one name; describe it once.\n const seen = new Set<string>();\n const schemas: ModelSchema[] = [];\n for (const name of registry.registeredNames()) {\n const schema = registry.get<{ $schema?: ModelSchema }>(name).$schema;\n if (!schema || seen.has(schema.name)) continue;\n seen.add(schema.name);\n schemas.push(schema);\n }\n return schemas;\n}\n"
|
|
36
36
|
],
|
|
37
|
-
"mappings": ";+zCAgDO,IAAS,HAAS,JACvB,HACA,HACA,HAEA,HAEA,HAKA,HACY,JACZ,DAAM,EAAQ,GAAc,EAAQ,CAAQ,EAItC,EAAO,GAAY,EAAQ,EAAO,EAAU,CAAS,EAErD,EAAS,EAAQ,WAAW,CAAK,EACjC,EAAY,GAAG,KAUf,EAAc,EAAK,aACtB,IAAI,CAAC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