@noy-db/hub 0.2.0-pre.1 → 0.2.0-pre.11
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/aggregate/index.cjs +9 -0
- package/dist/aggregate/index.cjs.map +1 -1
- package/dist/aggregate/index.d.cts +2 -2
- package/dist/aggregate/index.d.ts +2 -2
- package/dist/aggregate/index.js +4 -4
- package/dist/attestation/index.cjs +305 -0
- package/dist/attestation/index.cjs.map +1 -0
- package/dist/attestation/index.d.cts +52 -0
- package/dist/attestation/index.d.ts +52 -0
- package/dist/attestation/index.js +36 -0
- package/dist/attestation/index.js.map +1 -0
- package/dist/blobs/index.cjs.map +1 -1
- package/dist/blobs/index.d.cts +7 -6
- package/dist/blobs/index.d.ts +7 -6
- package/dist/blobs/index.js +10 -8
- package/dist/blobs/index.js.map +1 -1
- package/dist/bundle/index.cjs +18912 -129
- package/dist/bundle/index.cjs.map +1 -1
- package/dist/bundle/index.d.cts +175 -6
- package/dist/bundle/index.d.ts +175 -6
- package/dist/bundle/index.js +533 -5
- package/dist/bundle/index.js.map +1 -1
- package/dist/{chunk-6HPZY4ON.js → chunk-26NK23DZ.js} +9 -4
- package/dist/chunk-26NK23DZ.js.map +1 -0
- package/dist/{chunk-XGSOTWYX.js → chunk-2LPPNWF6.js} +3 -3
- package/dist/{chunk-537VFZTR.js → chunk-3DGHRDCX.js} +4 -4
- package/dist/{chunk-HB3Z2GCR.js → chunk-5OEJ6GOT.js} +2 -2
- package/dist/chunk-5OEJ6GOT.js.map +1 -0
- package/dist/{chunk-UA4RI7OT.js → chunk-6MFH4BMK.js} +5 -5
- package/dist/chunk-6MFH4BMK.js.map +1 -0
- package/dist/{chunk-UZXLQCHP.js → chunk-6T2UDBKG.js} +2 -2
- package/dist/chunk-6T2UDBKG.js.map +1 -0
- package/dist/{chunk-23TTQXVO.js → chunk-6YLPHBKR.js} +214 -9
- package/dist/chunk-6YLPHBKR.js.map +1 -0
- package/dist/chunk-73YLDCNF.js +83 -0
- package/dist/chunk-73YLDCNF.js.map +1 -0
- package/dist/chunk-77DWLQRY.js +233 -0
- package/dist/chunk-77DWLQRY.js.map +1 -0
- package/dist/{chunk-Z72JH4KG.js → chunk-7CEGU63S.js} +5 -35
- package/dist/chunk-7CEGU63S.js.map +1 -0
- package/dist/{chunk-PEULZC6M.js → chunk-A3JMGXPG.js} +8 -1
- package/dist/chunk-A3JMGXPG.js.map +1 -0
- package/dist/{chunk-I6MX32UC.js → chunk-BDV7INMP.js} +4 -4
- package/dist/{chunk-MKSA2V7A.js → chunk-C3WE6UJY.js} +2 -2
- package/dist/{chunk-FCXOFQAJ.js → chunk-CH22FZHT.js} +19 -2
- package/dist/chunk-CH22FZHT.js.map +1 -0
- package/dist/{chunk-DYBQG5PQ.js → chunk-CXFOITNS.js} +2 -2
- package/dist/{chunk-5ZGZ6HIZ.js → chunk-CXJG63MA.js} +11 -2
- package/dist/chunk-CXJG63MA.js.map +1 -0
- package/dist/{chunk-EGQYGYIU.js → chunk-DAP2XL7Q.js} +3 -3
- package/dist/chunk-DAP2XL7Q.js.map +1 -0
- package/dist/chunk-EBVBE7UK.js +59 -0
- package/dist/chunk-EBVBE7UK.js.map +1 -0
- package/dist/{chunk-DPMFBCV6.js → chunk-FO3UEG4S.js} +20 -3
- package/dist/chunk-FO3UEG4S.js.map +1 -0
- package/dist/{chunk-SIZWEV2Y.js → chunk-GAUEWM7D.js} +7 -5
- package/dist/chunk-GAUEWM7D.js.map +1 -0
- package/dist/chunk-GKI4SDP7.js +57 -0
- package/dist/chunk-GKI4SDP7.js.map +1 -0
- package/dist/chunk-IMYKDWB4.js +139 -0
- package/dist/chunk-IMYKDWB4.js.map +1 -0
- package/dist/{chunk-5SCJ5UEF.js → chunk-JQ4NEJJ6.js} +3 -3
- package/dist/chunk-LJXYPGRH.js +251 -0
- package/dist/chunk-LJXYPGRH.js.map +1 -0
- package/dist/{chunk-5DWL3JBF.js → chunk-LSTBFLL2.js} +2 -2
- package/dist/chunk-MPOLUAMI.js +10531 -0
- package/dist/chunk-MPOLUAMI.js.map +1 -0
- package/dist/{chunk-ADQ5MQ54.js → chunk-O6EJ6WTI.js} +163 -2
- package/dist/chunk-O6EJ6WTI.js.map +1 -0
- package/dist/chunk-PC3ZZBTO.js +79 -0
- package/dist/chunk-PC3ZZBTO.js.map +1 -0
- package/dist/{chunk-OMLIZL2P.js → chunk-PC6ZEDRL.js} +12 -2
- package/dist/{chunk-OMLIZL2P.js.map → chunk-PC6ZEDRL.js.map} +1 -1
- package/dist/{chunk-34YSDCDP.js → chunk-PVUUIWHY.js} +2 -2
- package/dist/{chunk-PA6R5ZCI.js → chunk-QCXNMCHN.js} +18 -5
- package/dist/chunk-QCXNMCHN.js.map +1 -0
- package/dist/{chunk-DYECX3IX.js → chunk-QSOYKKMD.js} +4 -4
- package/dist/chunk-QSOYKKMD.js.map +1 -0
- package/dist/{chunk-WCA2NROQ.js → chunk-R233SLY3.js} +2 -2
- package/dist/chunk-RC6SU5NO.js +36 -0
- package/dist/chunk-RC6SU5NO.js.map +1 -0
- package/dist/{chunk-P7EQ2S5O.js → chunk-RRNA5GKT.js} +2 -2
- package/dist/{chunk-ZNOEIM6Y.js → chunk-RYIL3PI2.js} +2 -2
- package/dist/{chunk-YS3POABP.js → chunk-SLV4LAKX.js} +1 -1
- package/dist/chunk-SLV4LAKX.js.map +1 -0
- package/dist/chunk-STNPB3UM.js +9 -0
- package/dist/chunk-STNPB3UM.js.map +1 -0
- package/dist/{chunk-7H6DOO3E.js → chunk-TGALXXLV.js} +211 -36
- package/dist/chunk-TGALXXLV.js.map +1 -0
- package/dist/{chunk-MRIBLZL3.js → chunk-TV3YZ35S.js} +5 -1
- package/dist/chunk-TV3YZ35S.js.map +1 -0
- package/dist/{chunk-VMIO4IXG.js → chunk-V2PZC6AW.js} +6 -229
- package/dist/chunk-V2PZC6AW.js.map +1 -0
- package/dist/{chunk-YMYK7US4.js → chunk-WIBHRONM.js} +2 -2
- package/dist/chunk-WIBHRONM.js.map +1 -0
- package/dist/{chunk-KESP7GOK.js → chunk-Y26YV5R3.js} +3 -3
- package/dist/{chunk-MIQHZESA.js → chunk-YM7LFCG7.js} +5 -5
- package/dist/{chunk-MIQHZESA.js.map → chunk-YM7LFCG7.js.map} +1 -1
- package/dist/{chunk-CBAHB2BF.js → chunk-YVZRTCGG.js} +7 -70
- package/dist/chunk-YVZRTCGG.js.map +1 -0
- package/dist/{chunk-4TFSM22V.js → chunk-YW5DBAPG.js} +4 -4
- package/dist/{chunk-2AXFIYHT.js → chunk-Z6FNBOTC.js} +1 -1
- package/dist/chunk-Z6FNBOTC.js.map +1 -0
- package/dist/{chunk-NIOHFJPJ.js → chunk-ZBBW7YQN.js} +218 -119
- package/dist/chunk-ZBBW7YQN.js.map +1 -0
- package/dist/{chunk-RD5LYKD6.js → chunk-ZROPXHJY.js} +2 -2
- package/dist/chunk-ZROPXHJY.js.map +1 -0
- package/dist/consent/index.cjs.map +1 -1
- package/dist/consent/index.d.cts +7 -6
- package/dist/consent/index.d.ts +7 -6
- package/dist/consent/index.js +3 -3
- package/dist/{crypto-A7FRXYHC.js → crypto-2CRLG4F4.js} +3 -3
- package/dist/{delegation-YBA4X4JN.js → delegation-ZTRT2PRV.js} +5 -5
- package/dist/derivations/index.cjs +18 -1
- package/dist/derivations/index.cjs.map +1 -1
- package/dist/derivations/index.d.cts +10 -9
- package/dist/derivations/index.d.ts +10 -9
- package/dist/derivations/index.js +4 -4
- package/dist/{dev-unlock-D9s-loPr.d.ts → dev-unlock-BH6y3Hx0.d.ts} +1 -1
- package/dist/{dev-unlock-DRwVSy2S.d.cts → dev-unlock-H1Xwxc3U.d.cts} +1 -1
- package/dist/discriminant-BN9REW3o.d.cts +60 -0
- package/dist/discriminant-BN9REW3o.d.ts +60 -0
- package/dist/executor-S76VN45G.js +8 -0
- package/dist/executor-UCXLIGLW.js +11 -0
- package/dist/executor-ZCNZJMGR.js +8 -0
- package/dist/{fanout-sidecar-VJ52RIEY.js → fanout-sidecar-F3ZRFU4H.js} +2 -2
- package/dist/fanout-sidecar-F3ZRFU4H.js.map +1 -0
- package/dist/guards/index.cjs +7 -0
- package/dist/guards/index.cjs.map +1 -1
- package/dist/guards/index.d.cts +8 -7
- package/dist/guards/index.d.ts +8 -7
- package/dist/guards/index.js +4 -4
- package/dist/{hash-DXXXusyk.d.ts → hash-D89JdDbj.d.ts} +1 -1
- package/dist/{hash-DtRih9MQ.d.cts → hash-_sDFvtmX.d.cts} +1 -1
- package/dist/history/index.cjs +2 -2
- package/dist/history/index.cjs.map +1 -1
- package/dist/history/index.d.cts +8 -7
- package/dist/history/index.d.ts +8 -7
- package/dist/history/index.js +6 -6
- package/dist/i18n/index.cjs +287 -27
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +7 -6
- package/dist/i18n/index.d.ts +7 -6
- package/dist/i18n/index.js +21 -6
- package/dist/i18n/index.js.map +1 -1
- package/dist/{index-CmVgTkqk.d.cts → index-B8bjExET.d.cts} +214 -18
- package/dist/{index-CNwA-B6-.d.ts → index-DfUbNad8.d.ts} +214 -18
- package/dist/index.cjs +3343 -447
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +43 -22
- package/dist/index.d.ts +43 -22
- package/dist/index.js +179 -8799
- package/dist/index.js.map +1 -1
- package/dist/indexing/index.cjs +5 -1
- package/dist/indexing/index.cjs.map +1 -1
- package/dist/indexing/index.d.cts +3 -3
- package/dist/indexing/index.d.ts +3 -3
- package/dist/indexing/index.js +4 -4
- package/dist/issue-IVTVSKWW.js +12 -0
- package/dist/{lazy-builder-Rpd-V3jP.d.ts → lazy-builder-Ci5_YG73.d.cts} +2 -2
- package/dist/{lazy-builder-C-rPfWG0.d.cts → lazy-builder-D5GU14TS.d.ts} +2 -2
- package/dist/{ledger-3TXNP47J.js → ledger-NYCGJX2D.js} +6 -6
- package/dist/materialized-views/index.cjs +21 -2
- package/dist/materialized-views/index.cjs.map +1 -1
- package/dist/materialized-views/index.d.cts +23 -20
- package/dist/materialized-views/index.d.ts +23 -20
- package/dist/materialized-views/index.js +12 -12
- package/dist/noydb-SH4RLE47.js +34 -0
- package/dist/overlay-views/index.cjs +11 -1
- package/dist/overlay-views/index.cjs.map +1 -1
- package/dist/overlay-views/index.d.cts +10 -9
- package/dist/overlay-views/index.d.ts +10 -9
- package/dist/overlay-views/index.js +6 -4
- package/dist/periods/index.cjs.map +1 -1
- package/dist/periods/index.d.cts +7 -6
- package/dist/periods/index.d.ts +7 -6
- package/dist/periods/index.js +6 -6
- package/dist/{predicate-Dnu81tsS.d.cts → predicate-Bt5ft-9c.d.cts} +28 -3
- package/dist/{predicate-Dnu81tsS.d.ts → predicate-Bt5ft-9c.d.ts} +28 -3
- package/dist/{public-envelope-PY6NKFLI.js → public-envelope-QOXZEHKH.js} +4 -4
- package/dist/query/index.cjs +255 -6
- package/dist/query/index.cjs.map +1 -1
- package/dist/query/index.d.cts +3 -3
- package/dist/query/index.d.ts +3 -3
- package/dist/query/index.js +12 -6
- package/dist/registry-DKEXOJVO.js +7 -0
- package/dist/{registry-3L3N3PTG.js → registry-ST2VNFZC.js} +3 -3
- package/dist/registry-UFIK7CSR.js +8 -0
- package/dist/registry-ZGYYSM5I.js +8 -0
- package/dist/registry-ZGYYSM5I.js.map +1 -0
- package/dist/revoke-RT7QYB4G.js +17 -0
- package/dist/revoke-RT7QYB4G.js.map +1 -0
- package/dist/session/index.cjs.map +1 -1
- package/dist/session/index.d.cts +8 -7
- package/dist/session/index.d.ts +8 -7
- package/dist/session/index.js +3 -3
- package/dist/shadow/index.cjs.map +1 -1
- package/dist/shadow/index.d.cts +7 -6
- package/dist/shadow/index.d.ts +7 -6
- package/dist/shadow/index.js +2 -2
- package/dist/signer-QNU66JF5.js +18 -0
- package/dist/signer-QNU66JF5.js.map +1 -0
- package/dist/snapshots/index.cjs +937 -0
- package/dist/snapshots/index.cjs.map +1 -0
- package/dist/snapshots/index.d.cts +28 -0
- package/dist/snapshots/index.d.ts +28 -0
- package/dist/snapshots/index.js +152 -0
- package/dist/snapshots/index.js.map +1 -0
- package/dist/{stale-HSC5YO2O.js → stale-VKXSXJF4.js} +2 -2
- package/dist/stale-VKXSXJF4.js.map +1 -0
- package/dist/store/index.cjs.map +1 -1
- package/dist/store/index.d.cts +7 -6
- package/dist/store/index.d.ts +7 -6
- package/dist/store/index.js +2 -2
- package/dist/{strategy-DSTrsZ8t.d.cts → strategy-CT2LCKAX.d.cts} +12 -0
- package/dist/{strategy-DSTrsZ8t.d.ts → strategy-CT2LCKAX.d.ts} +12 -0
- package/dist/sync/index.cjs.map +1 -1
- package/dist/sync/index.d.cts +6 -5
- package/dist/sync/index.d.ts +6 -5
- package/dist/sync/index.js +4 -4
- package/dist/team/index.cjs +1 -1
- package/dist/team/index.cjs.map +1 -1
- package/dist/team/index.d.cts +7 -6
- package/dist/team/index.d.ts +7 -6
- package/dist/team/index.js +13 -11
- package/dist/tx/index.cjs +82 -2
- package/dist/tx/index.cjs.map +1 -1
- package/dist/tx/index.d.cts +8 -7
- package/dist/tx/index.d.ts +8 -7
- package/dist/tx/index.js +56 -3
- package/dist/tx/index.js.map +1 -1
- package/dist/{types-DW9RGSSs.d.ts → types-CD8mc8zR.d.ts} +1279 -259
- package/dist/{types-C4lwMKKF.d.cts → types-DiSXn3a4.d.cts} +1279 -259
- package/dist/{index-4agOpzqd.d.ts → ulid-8p83wbR4.d.ts} +64 -46
- package/dist/{index-hdFvZkBP.d.cts → ulid-DQ1hcJvZ.d.cts} +64 -46
- package/dist/util/index.cjs +7 -0
- package/dist/util/index.cjs.map +1 -1
- package/dist/util/index.d.cts +2 -0
- package/dist/util/index.d.ts +2 -0
- package/dist/util/index.js +5 -1
- package/dist/util/index.js.map +1 -1
- package/dist/{with-derivation-C8LDlV7t.d.cts → with-derivation-CVT7-dUt.d.cts} +1 -1
- package/dist/{with-derivation-g-pGoMzL.d.ts → with-derivation-DWMTpgEH.d.ts} +1 -1
- package/dist/{with-guard-DWOCK4Ca.d.ts → with-guard-BRvt53da.d.ts} +1 -1
- package/dist/{with-guard-jI1x9Z3k.d.cts → with-guard-Dx2zZnTA.d.cts} +1 -1
- package/dist/{with-materialized-view-DaKR-N6J.d.ts → with-materialized-view-BTTU3BNK.d.cts} +2 -2
- package/dist/{with-materialized-view-DcTx4H3j.d.cts → with-materialized-view-X0CoL8-L.d.ts} +2 -2
- package/dist/{with-overlayed-view-N7jYuNOS.d.ts → with-overlayed-view-DQjO_DSG.d.ts} +2 -2
- package/dist/{with-overlayed-view-D-6oWAgM.d.cts → with-overlayed-view-DcacRRsS.d.cts} +2 -2
- package/package.json +27 -4
- package/dist/chunk-23TTQXVO.js.map +0 -1
- package/dist/chunk-2AXFIYHT.js.map +0 -1
- package/dist/chunk-5ZGZ6HIZ.js.map +0 -1
- package/dist/chunk-6HPZY4ON.js.map +0 -1
- package/dist/chunk-7H6DOO3E.js.map +0 -1
- package/dist/chunk-ADQ5MQ54.js.map +0 -1
- package/dist/chunk-CBAHB2BF.js.map +0 -1
- package/dist/chunk-DPMFBCV6.js.map +0 -1
- package/dist/chunk-DYECX3IX.js.map +0 -1
- package/dist/chunk-EGQYGYIU.js.map +0 -1
- package/dist/chunk-FCXOFQAJ.js.map +0 -1
- package/dist/chunk-HB3Z2GCR.js.map +0 -1
- package/dist/chunk-MRIBLZL3.js.map +0 -1
- package/dist/chunk-NIOHFJPJ.js.map +0 -1
- package/dist/chunk-PA6R5ZCI.js.map +0 -1
- package/dist/chunk-PEULZC6M.js.map +0 -1
- package/dist/chunk-RD5LYKD6.js.map +0 -1
- package/dist/chunk-SIZWEV2Y.js.map +0 -1
- package/dist/chunk-UA4RI7OT.js.map +0 -1
- package/dist/chunk-UZXLQCHP.js.map +0 -1
- package/dist/chunk-VMIO4IXG.js.map +0 -1
- package/dist/chunk-YMYK7US4.js.map +0 -1
- package/dist/chunk-YS3POABP.js.map +0 -1
- package/dist/chunk-Z72JH4KG.js.map +0 -1
- package/dist/executor-7E3VFGW7.js +0 -11
- package/dist/executor-CEWX2FQI.js +0 -8
- package/dist/executor-X4SQ3ZLC.js +0 -8
- package/dist/fanout-sidecar-VJ52RIEY.js.map +0 -1
- package/dist/registry-O47PUPSY.js +0 -8
- package/dist/registry-RFGGMVNJ.js +0 -7
- package/dist/registry-WLLMODKN.js +0 -8
- /package/dist/{chunk-XGSOTWYX.js.map → chunk-2LPPNWF6.js.map} +0 -0
- /package/dist/{chunk-537VFZTR.js.map → chunk-3DGHRDCX.js.map} +0 -0
- /package/dist/{chunk-I6MX32UC.js.map → chunk-BDV7INMP.js.map} +0 -0
- /package/dist/{chunk-MKSA2V7A.js.map → chunk-C3WE6UJY.js.map} +0 -0
- /package/dist/{chunk-DYBQG5PQ.js.map → chunk-CXFOITNS.js.map} +0 -0
- /package/dist/{chunk-5SCJ5UEF.js.map → chunk-JQ4NEJJ6.js.map} +0 -0
- /package/dist/{chunk-5DWL3JBF.js.map → chunk-LSTBFLL2.js.map} +0 -0
- /package/dist/{chunk-34YSDCDP.js.map → chunk-PVUUIWHY.js.map} +0 -0
- /package/dist/{chunk-WCA2NROQ.js.map → chunk-R233SLY3.js.map} +0 -0
- /package/dist/{chunk-P7EQ2S5O.js.map → chunk-RRNA5GKT.js.map} +0 -0
- /package/dist/{chunk-ZNOEIM6Y.js.map → chunk-RYIL3PI2.js.map} +0 -0
- /package/dist/{chunk-KESP7GOK.js.map → chunk-Y26YV5R3.js.map} +0 -0
- /package/dist/{chunk-4TFSM22V.js.map → chunk-YW5DBAPG.js.map} +0 -0
- /package/dist/{crypto-A7FRXYHC.js.map → crypto-2CRLG4F4.js.map} +0 -0
- /package/dist/{delegation-YBA4X4JN.js.map → delegation-ZTRT2PRV.js.map} +0 -0
- /package/dist/{executor-7E3VFGW7.js.map → executor-S76VN45G.js.map} +0 -0
- /package/dist/{executor-CEWX2FQI.js.map → executor-UCXLIGLW.js.map} +0 -0
- /package/dist/{executor-X4SQ3ZLC.js.map → executor-ZCNZJMGR.js.map} +0 -0
- /package/dist/{ledger-3TXNP47J.js.map → issue-IVTVSKWW.js.map} +0 -0
- /package/dist/{public-envelope-PY6NKFLI.js.map → ledger-NYCGJX2D.js.map} +0 -0
- /package/dist/{registry-3L3N3PTG.js.map → noydb-SH4RLE47.js.map} +0 -0
- /package/dist/{registry-O47PUPSY.js.map → public-envelope-QOXZEHKH.js.map} +0 -0
- /package/dist/{registry-RFGGMVNJ.js.map → registry-DKEXOJVO.js.map} +0 -0
- /package/dist/{registry-WLLMODKN.js.map → registry-ST2VNFZC.js.map} +0 -0
- /package/dist/{stale-HSC5YO2O.js.map → registry-UFIK7CSR.js.map} +0 -0
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
evaluateClause,
|
|
3
3
|
readPath
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-TV3YZ35S.js";
|
|
5
5
|
import {
|
|
6
|
+
CrossJoinSourceUnknownError,
|
|
7
|
+
CrossJoinTooLargeError,
|
|
6
8
|
DanglingReferenceError,
|
|
7
9
|
JoinTooLargeError
|
|
8
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-O6EJ6WTI.js";
|
|
9
11
|
|
|
10
12
|
// src/query/join.ts
|
|
11
13
|
var DEFAULT_JOIN_MAX_ROWS = 5e4;
|
|
@@ -260,6 +262,7 @@ var EMPTY_PLAN = {
|
|
|
260
262
|
offset: 0,
|
|
261
263
|
joins: []
|
|
262
264
|
};
|
|
265
|
+
var DEFAULT_CROSS_JOIN_MAX_ROWS = 5e4;
|
|
263
266
|
var Query = class _Query {
|
|
264
267
|
source;
|
|
265
268
|
plan;
|
|
@@ -292,7 +295,7 @@ var Query = class _Query {
|
|
|
292
295
|
/**
|
|
293
296
|
* @internal — clone this Query with a declared-predicate map
|
|
294
297
|
* attached. Used by the materialized-view registry to enable
|
|
295
|
-
* `.wherePredicate(name, ctx?)` for the MV's query callback
|
|
298
|
+
* `.wherePredicate(name, ctx?)` for the MV's query callback.
|
|
296
299
|
* Consumers don't call this directly.
|
|
297
300
|
*/
|
|
298
301
|
_withPredicates(predicates) {
|
|
@@ -305,7 +308,7 @@ var Query = class _Query {
|
|
|
305
308
|
);
|
|
306
309
|
}
|
|
307
310
|
/**
|
|
308
|
-
* Filter by a registered deterministic predicate
|
|
311
|
+
* Filter by a registered deterministic predicate. Requires
|
|
309
312
|
* the Query to have been augmented with a predicates map (typically
|
|
310
313
|
* via the materialized-view registry — bare Queries constructed
|
|
311
314
|
* outside an MV throw on `.wherePredicate()`).
|
|
@@ -541,6 +544,78 @@ var Query = class _Query {
|
|
|
541
544
|
this.predicates
|
|
542
545
|
);
|
|
543
546
|
}
|
|
547
|
+
/**
|
|
548
|
+
* Cartesian-product cross-join against `target` collection. Each result row
|
|
549
|
+
* carries the original `T` fields plus `result[as]` populated from every
|
|
550
|
+
* right-side row (or the filtered subset when `on:` is supplied).
|
|
551
|
+
*
|
|
552
|
+
* **Order matters:** `.where().crossJoin()` filters BEFORE expanding (cheaper);
|
|
553
|
+
* `.crossJoin().where('alias.field', ...)` filters AFTER (required when the
|
|
554
|
+
* where clause references the aliased fields).
|
|
555
|
+
*
|
|
556
|
+
* **Cost ceiling:** `CrossJoinTooLargeError` fires before allocation when
|
|
557
|
+
* `leftRows × rightRows` (or the cumulative lateral count) exceeds the limit.
|
|
558
|
+
* Default: 50,000 rows. Override per-clause with `{ maxRows: N }`.
|
|
559
|
+
*
|
|
560
|
+
* **`on:` shapes:**
|
|
561
|
+
* - `on: (left) => TTarget[]` — subset form (most efficient)
|
|
562
|
+
* - `on: (left) => (right) => boolean` — predicate form
|
|
563
|
+
* - `on: { predicate: 'name' }` — MV-safe, hash-tracked form
|
|
564
|
+
* (requires the Query to have been augmented via `_withPredicates`)
|
|
565
|
+
*
|
|
566
|
+
* Requires a JoinContext (constructed via `collection.query()`).
|
|
567
|
+
*/
|
|
568
|
+
crossJoin(target, opts) {
|
|
569
|
+
if (!this.joinContext) {
|
|
570
|
+
throw new Error(
|
|
571
|
+
`Query.crossJoin("${target}"): requires a join context. Use collection.query() to construct a cross-join-capable Query instead of the Query constructor directly.`
|
|
572
|
+
);
|
|
573
|
+
}
|
|
574
|
+
let onFn;
|
|
575
|
+
let onPredicateName;
|
|
576
|
+
if (opts.on !== void 0) {
|
|
577
|
+
if (typeof opts.on === "function") {
|
|
578
|
+
onFn = opts.on;
|
|
579
|
+
if (this.predicates) {
|
|
580
|
+
console.warn(
|
|
581
|
+
`Query.crossJoin("${target}", { on: callback }): inline on: callback inside a withMaterializedView query() disables queryHash drift detection for this cross-join. Use on: { predicate: '<name>' } to enable it.`
|
|
582
|
+
);
|
|
583
|
+
}
|
|
584
|
+
} else {
|
|
585
|
+
const predName = opts.on.predicate;
|
|
586
|
+
if (!this.predicates) {
|
|
587
|
+
throw new Error(
|
|
588
|
+
`Query.crossJoin("${target}", { on: { predicate: "${predName}" } }): the { predicate } form requires a predicates map. Use this form inside a withMaterializedView query() callback that declares predicates: { ${predName}: { hash, fn } }.`
|
|
589
|
+
);
|
|
590
|
+
}
|
|
591
|
+
const decl = this.predicates.get(predName);
|
|
592
|
+
if (!decl) {
|
|
593
|
+
throw new Error(
|
|
594
|
+
`Query.crossJoin("${target}"): predicate "${predName}" not registered. Available: ${[...this.predicates.keys()].join(", ") || "(none)"}.`
|
|
595
|
+
);
|
|
596
|
+
}
|
|
597
|
+
const as = opts.as;
|
|
598
|
+
const predicateFn = decl.fn;
|
|
599
|
+
onFn = (_left) => (right) => predicateFn({ ..._left, [as]: right });
|
|
600
|
+
onPredicateName = predName;
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
const clause = {
|
|
604
|
+
type: "crossJoin",
|
|
605
|
+
target,
|
|
606
|
+
as: opts.as,
|
|
607
|
+
...onFn !== void 0 && { on: onFn },
|
|
608
|
+
...onPredicateName !== void 0 && { onPredicateName },
|
|
609
|
+
...opts.maxRows !== void 0 && { maxRows: opts.maxRows }
|
|
610
|
+
};
|
|
611
|
+
return new _Query(
|
|
612
|
+
this.source,
|
|
613
|
+
{ ...this.plan, clauses: [...this.plan.clauses, clause] },
|
|
614
|
+
this.joinContext,
|
|
615
|
+
this.aggregateStrategy,
|
|
616
|
+
this.predicates
|
|
617
|
+
);
|
|
618
|
+
}
|
|
544
619
|
/**
|
|
545
620
|
* Execute the plan and return the matching records. When the plan
|
|
546
621
|
* carries any join legs, they are applied after `where` / `orderBy`
|
|
@@ -548,7 +623,7 @@ var Query = class _Query {
|
|
|
548
623
|
* for the ordering rationale.
|
|
549
624
|
*/
|
|
550
625
|
toArray() {
|
|
551
|
-
const base = executePlanWithSource(this.source, this.plan);
|
|
626
|
+
const base = executePlanWithSource(this.source, this.plan, this.joinContext);
|
|
552
627
|
if (this.plan.joins.length === 0) return base;
|
|
553
628
|
if (!this.joinContext) {
|
|
554
629
|
throw new Error(
|
|
@@ -572,6 +647,14 @@ var Query = class _Query {
|
|
|
572
647
|
* intent is purely to count.
|
|
573
648
|
*/
|
|
574
649
|
count() {
|
|
650
|
+
if (this.plan.clauses.some((c) => c.type === "crossJoin")) {
|
|
651
|
+
if (!this.joinContext) {
|
|
652
|
+
throw new Error(
|
|
653
|
+
`Query.count(): plan contains crossJoin clauses but no JoinContext is attached.`
|
|
654
|
+
);
|
|
655
|
+
}
|
|
656
|
+
return executeClausePipeline(this.source, this.plan.clauses, this.joinContext).length;
|
|
657
|
+
}
|
|
575
658
|
const { candidates, remainingClauses } = candidateRecords(this.source, this.plan.clauses);
|
|
576
659
|
if (remainingClauses.length === 0) return candidates.length;
|
|
577
660
|
return filterRecords(candidates, remainingClauses).length;
|
|
@@ -619,7 +702,13 @@ var Query = class _Query {
|
|
|
619
702
|
aggregate(spec) {
|
|
620
703
|
const source = this.source;
|
|
621
704
|
const clauses = this.plan.clauses;
|
|
705
|
+
const joinCtx = this.joinContext;
|
|
706
|
+
const hasCrossJoins = clauses.some((c) => c.type === "crossJoin");
|
|
622
707
|
const executeRecords = () => {
|
|
708
|
+
if (hasCrossJoins) {
|
|
709
|
+
if (!joinCtx) throw new Error("Query.aggregate(): crossJoin requires a join context");
|
|
710
|
+
return executeClausePipeline(source, clauses, joinCtx);
|
|
711
|
+
}
|
|
623
712
|
const { candidates, remainingClauses } = candidateRecords(source, clauses);
|
|
624
713
|
return remainingClauses.length === 0 ? candidates : filterRecords(candidates, remainingClauses);
|
|
625
714
|
};
|
|
@@ -636,7 +725,13 @@ var Query = class _Query {
|
|
|
636
725
|
}
|
|
637
726
|
const source = this.source;
|
|
638
727
|
const clauses = this.plan.clauses;
|
|
728
|
+
const joinCtx = this.joinContext;
|
|
729
|
+
const hasCrossJoins = clauses.some((c) => c.type === "crossJoin");
|
|
639
730
|
const executeRecords = () => {
|
|
731
|
+
if (hasCrossJoins) {
|
|
732
|
+
if (!joinCtx) throw new Error("Query.groupBy(): crossJoin requires a join context");
|
|
733
|
+
return executeClausePipeline(source, clauses, joinCtx);
|
|
734
|
+
}
|
|
640
735
|
const { candidates, remainingClauses } = candidateRecords(source, clauses);
|
|
641
736
|
return remainingClauses.length === 0 ? candidates : filterRecords(candidates, remainingClauses);
|
|
642
737
|
};
|
|
@@ -750,6 +845,21 @@ var Query = class _Query {
|
|
|
750
845
|
}
|
|
751
846
|
}
|
|
752
847
|
}
|
|
848
|
+
if (this.joinContext) {
|
|
849
|
+
const subscribedCross = /* @__PURE__ */ new Set();
|
|
850
|
+
for (const clause of this.plan.clauses) {
|
|
851
|
+
if (clause.type !== "crossJoin") continue;
|
|
852
|
+
if (subscribedCross.has(clause.target)) continue;
|
|
853
|
+
subscribedCross.add(clause.target);
|
|
854
|
+
const rightSource = this.joinContext.resolveSource(clause.target);
|
|
855
|
+
if (rightSource?.subscribe) {
|
|
856
|
+
const rightSubscribe = rightSource.subscribe.bind(rightSource);
|
|
857
|
+
upstreams.push({
|
|
858
|
+
subscribe: (cb) => rightSubscribe(cb)
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
}
|
|
862
|
+
}
|
|
753
863
|
return buildLiveQuery(() => this.toArray(), upstreams);
|
|
754
864
|
}
|
|
755
865
|
/**
|
|
@@ -761,9 +871,20 @@ var Query = class _Query {
|
|
|
761
871
|
return serializePlan(this.plan);
|
|
762
872
|
}
|
|
763
873
|
};
|
|
764
|
-
function executePlanWithSource(source, plan) {
|
|
765
|
-
const
|
|
766
|
-
let result
|
|
874
|
+
function executePlanWithSource(source, plan, joinContext) {
|
|
875
|
+
const hasCrossJoins = plan.clauses.some((c) => c.type === "crossJoin");
|
|
876
|
+
let result;
|
|
877
|
+
if (hasCrossJoins) {
|
|
878
|
+
if (!joinContext) {
|
|
879
|
+
throw new Error(
|
|
880
|
+
`Query.toArray(): plan contains crossJoin clauses but no JoinContext is attached. Use collection.query() instead of new Query() for cross-join support.`
|
|
881
|
+
);
|
|
882
|
+
}
|
|
883
|
+
result = executeClausePipeline(source, plan.clauses, joinContext);
|
|
884
|
+
} else {
|
|
885
|
+
const { candidates, remainingClauses } = candidateRecords(source, plan.clauses);
|
|
886
|
+
result = remainingClauses.length === 0 ? [...candidates] : filterRecords(candidates, remainingClauses);
|
|
887
|
+
}
|
|
767
888
|
if (plan.orderBy.length > 0) {
|
|
768
889
|
result = sortRecords(result, plan.orderBy);
|
|
769
890
|
}
|
|
@@ -813,6 +934,11 @@ function materializeIds(ids, lookupById) {
|
|
|
813
934
|
return out;
|
|
814
935
|
}
|
|
815
936
|
function executePlan(records, plan) {
|
|
937
|
+
if (plan.clauses.some((c) => c.type === "crossJoin")) {
|
|
938
|
+
throw new Error(
|
|
939
|
+
`executePlan(): does not support crossJoin clauses. executePlan is a stateless pure function \u2014 it cannot resolve cross-join right-side collections. Use Query.toArray() (via collection.query()) instead.`
|
|
940
|
+
);
|
|
941
|
+
}
|
|
816
942
|
let result = filterRecords(records, plan.clauses);
|
|
817
943
|
if (plan.orderBy.length > 0) {
|
|
818
944
|
result = sortRecords(result, plan.orderBy);
|
|
@@ -840,6 +966,74 @@ function filterRecords(records, clauses) {
|
|
|
840
966
|
}
|
|
841
967
|
return out;
|
|
842
968
|
}
|
|
969
|
+
function executeClausePipeline(source, clauses, joinContext) {
|
|
970
|
+
let rel = [...source.snapshot()];
|
|
971
|
+
let filterBatch = [];
|
|
972
|
+
for (const clause of clauses) {
|
|
973
|
+
if (clause.type === "crossJoin") {
|
|
974
|
+
if (filterBatch.length > 0) {
|
|
975
|
+
rel = filterRecords(rel, filterBatch);
|
|
976
|
+
filterBatch = [];
|
|
977
|
+
}
|
|
978
|
+
const rightSource = joinContext.resolveSource(clause.target);
|
|
979
|
+
if (!rightSource) {
|
|
980
|
+
throw new CrossJoinSourceUnknownError(clause.target, joinContext.leftCollection);
|
|
981
|
+
}
|
|
982
|
+
rel = applyCrossJoin(rel, clause, rightSource);
|
|
983
|
+
} else {
|
|
984
|
+
filterBatch.push(clause);
|
|
985
|
+
}
|
|
986
|
+
}
|
|
987
|
+
if (filterBatch.length > 0) {
|
|
988
|
+
rel = filterRecords(rel, filterBatch);
|
|
989
|
+
}
|
|
990
|
+
return rel;
|
|
991
|
+
}
|
|
992
|
+
function applyCrossJoin(leftRel, clause, rightSource) {
|
|
993
|
+
const rightRows = rightSource.snapshot();
|
|
994
|
+
const maxRows = clause.maxRows ?? DEFAULT_CROSS_JOIN_MAX_ROWS;
|
|
995
|
+
const { as } = clause;
|
|
996
|
+
if (!clause.on) {
|
|
997
|
+
const product = leftRel.length * rightRows.length;
|
|
998
|
+
if (product > maxRows) {
|
|
999
|
+
throw new CrossJoinTooLargeError({ target: clause.target, expected: product, limit: maxRows });
|
|
1000
|
+
}
|
|
1001
|
+
const expanded2 = [];
|
|
1002
|
+
for (const left of leftRel) {
|
|
1003
|
+
const leftObj = left;
|
|
1004
|
+
for (const right of rightRows) {
|
|
1005
|
+
expanded2.push({ ...leftObj, [as]: right });
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
return expanded2;
|
|
1009
|
+
}
|
|
1010
|
+
const expanded = [];
|
|
1011
|
+
let cumulative = 0;
|
|
1012
|
+
for (const left of leftRel) {
|
|
1013
|
+
const callbackResult = clause.on(left);
|
|
1014
|
+
let filteredRight;
|
|
1015
|
+
if (Array.isArray(callbackResult)) {
|
|
1016
|
+
filteredRight = callbackResult;
|
|
1017
|
+
} else {
|
|
1018
|
+
filteredRight = rightRows.filter(
|
|
1019
|
+
callbackResult
|
|
1020
|
+
);
|
|
1021
|
+
}
|
|
1022
|
+
cumulative += filteredRight.length;
|
|
1023
|
+
if (cumulative > maxRows) {
|
|
1024
|
+
throw new CrossJoinTooLargeError({
|
|
1025
|
+
target: clause.target,
|
|
1026
|
+
expected: cumulative,
|
|
1027
|
+
limit: maxRows
|
|
1028
|
+
});
|
|
1029
|
+
}
|
|
1030
|
+
const leftObj = left;
|
|
1031
|
+
for (const right of filteredRight) {
|
|
1032
|
+
expanded.push({ ...leftObj, [as]: right });
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
return expanded;
|
|
1036
|
+
}
|
|
843
1037
|
function sortRecords(records, orderBy) {
|
|
844
1038
|
return [...records].sort((a, b) => {
|
|
845
1039
|
for (const { field, direction } of orderBy) {
|
|
@@ -902,6 +1096,16 @@ function serializeClause(clause) {
|
|
|
902
1096
|
clauses: clause.clauses.map(serializeClause)
|
|
903
1097
|
};
|
|
904
1098
|
}
|
|
1099
|
+
if (clause.type === "crossJoin") {
|
|
1100
|
+
return {
|
|
1101
|
+
type: "crossJoin",
|
|
1102
|
+
target: clause.target,
|
|
1103
|
+
as: clause.as,
|
|
1104
|
+
on: clause.on ? "[function]" : void 0,
|
|
1105
|
+
onPredicateName: clause.onPredicateName,
|
|
1106
|
+
maxRows: clause.maxRows
|
|
1107
|
+
};
|
|
1108
|
+
}
|
|
905
1109
|
return clause;
|
|
906
1110
|
}
|
|
907
1111
|
function canonicalCtxHash(ctx) {
|
|
@@ -1360,8 +1564,9 @@ export {
|
|
|
1360
1564
|
resetJoinWarnings,
|
|
1361
1565
|
buildLiveQuery,
|
|
1362
1566
|
NO_AGGREGATE,
|
|
1567
|
+
DEFAULT_CROSS_JOIN_MAX_ROWS,
|
|
1363
1568
|
Query,
|
|
1364
1569
|
executePlan,
|
|
1365
1570
|
ScanBuilder
|
|
1366
1571
|
};
|
|
1367
|
-
//# sourceMappingURL=chunk-
|
|
1572
|
+
//# sourceMappingURL=chunk-6YLPHBKR.js.map
|