@rocicorp/zero 0.25.0-canary.0 → 0.25.0-canary.2
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/out/{chunk-MXPHMVU7.js → chunk-COKJ5W7V.js} +2527 -540
- package/out/chunk-COKJ5W7V.js.map +7 -0
- package/out/{chunk-4RB4OYLQ.js → chunk-TJFNGO7E.js} +3 -2
- package/out/{chunk-BJ2CGCME.js → chunk-YWU2DZ23.js} +20 -4
- package/out/chunk-YWU2DZ23.js.map +7 -0
- package/out/{lazy-inspector-2SW772W4.js → lazy-inspector-OXIFYSSQ.js} +2 -2
- package/out/react.js +59 -28
- package/out/react.js.map +4 -4
- package/out/replicache/src/dag/lazy-store.d.ts +1 -1
- package/out/replicache/src/dag/lazy-store.d.ts.map +1 -1
- package/out/replicache/src/log-options.d.ts +1 -1
- package/out/replicache/src/log-options.d.ts.map +1 -1
- package/out/replicache/src/persist/collect-idb-databases.d.ts +3 -3
- package/out/replicache/src/persist/collect-idb-databases.d.ts.map +1 -1
- package/out/replicache/src/replicache-options.d.ts +1 -1
- package/out/replicache/src/replicache-options.d.ts.map +1 -1
- package/out/shared/src/error.d.ts +4 -0
- package/out/shared/src/error.d.ts.map +1 -0
- package/out/shared/src/error.js +70 -0
- package/out/shared/src/error.js.map +1 -0
- package/out/shared/src/options.d.ts +1 -1
- package/out/shared/src/options.d.ts.map +1 -1
- package/out/shared/src/promise-race.d.ts +17 -0
- package/out/shared/src/promise-race.d.ts.map +1 -0
- package/out/solid.js +61 -22
- package/out/solid.js.map +4 -4
- package/out/z2s/src/compiler.d.ts +1 -1
- package/out/z2s/src/compiler.d.ts.map +1 -1
- package/out/z2s/src/compiler.js +1 -1
- package/out/z2s/src/compiler.js.map +1 -1
- package/out/z2s/src/sql.d.ts.map +1 -1
- package/out/z2s/src/sql.js +1 -1
- package/out/z2s/src/sql.js.map +1 -1
- package/out/zero/package.json +6 -4
- package/out/zero/src/zero-out.d.ts +3 -0
- package/out/zero/src/zero-out.d.ts.map +1 -0
- package/out/zero/src/zero-out.js +13 -0
- package/out/zero/src/zero-out.js.map +1 -0
- package/out/zero-cache/src/config/zero-config.d.ts +12 -0
- package/out/zero-cache/src/config/zero-config.d.ts.map +1 -1
- package/out/zero-cache/src/config/zero-config.js +36 -0
- package/out/zero-cache/src/config/zero-config.js.map +1 -1
- package/out/zero-cache/src/custom/fetch.d.ts +3 -1
- package/out/zero-cache/src/custom/fetch.d.ts.map +1 -1
- package/out/zero-cache/src/custom/fetch.js +104 -27
- package/out/zero-cache/src/custom/fetch.js.map +1 -1
- package/out/zero-cache/src/custom-queries/transform-query.d.ts +2 -6
- package/out/zero-cache/src/custom-queries/transform-query.d.ts.map +1 -1
- package/out/zero-cache/src/custom-queries/transform-query.js +42 -41
- package/out/zero-cache/src/custom-queries/transform-query.js.map +1 -1
- package/out/zero-cache/src/db/create.d.ts +4 -0
- package/out/zero-cache/src/db/create.d.ts.map +1 -1
- package/out/zero-cache/src/db/create.js +7 -9
- package/out/zero-cache/src/db/create.js.map +1 -1
- package/out/zero-cache/src/db/lite-tables.js +2 -2
- package/out/zero-cache/src/db/lite-tables.js.map +1 -1
- package/out/zero-cache/src/db/pg-to-lite.d.ts.map +1 -1
- package/out/zero-cache/src/db/pg-to-lite.js +7 -6
- package/out/zero-cache/src/db/pg-to-lite.js.map +1 -1
- package/out/zero-cache/src/db/specs.d.ts +12 -12
- package/out/zero-cache/src/scripts/decommission.d.ts +50 -0
- package/out/zero-cache/src/scripts/decommission.d.ts.map +1 -0
- package/out/zero-cache/src/scripts/decommission.js +51 -0
- package/out/zero-cache/src/scripts/decommission.js.map +1 -0
- package/out/zero-cache/src/server/change-streamer.d.ts.map +1 -1
- package/out/zero-cache/src/server/change-streamer.js +1 -1
- package/out/zero-cache/src/server/change-streamer.js.map +1 -1
- package/out/zero-cache/src/server/inspector-delegate.d.ts.map +1 -1
- package/out/zero-cache/src/server/inspector-delegate.js +6 -1
- package/out/zero-cache/src/server/inspector-delegate.js.map +1 -1
- package/out/zero-cache/src/server/syncer.d.ts.map +1 -1
- package/out/zero-cache/src/server/syncer.js +1 -1
- package/out/zero-cache/src/server/syncer.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/change-source.js +1 -0
- package/out/zero-cache/src/services/change-source/pg/change-source.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts +1 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.js +1 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/ddl.d.ts +25 -25
- package/out/zero-cache/src/services/change-source/pg/schema/published.d.ts +10 -10
- package/out/zero-cache/src/services/change-source/pg/schema/shard.d.ts +5 -5
- package/out/zero-cache/src/services/change-source/protocol/current/data.d.ts +16 -16
- package/out/zero-cache/src/services/change-source/protocol/current/downstream.d.ts +24 -24
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts +2 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts.map +1 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.js +18 -2
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.js.map +1 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts +8 -8
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +1 -1
- package/out/zero-cache/src/services/mutagen/mutagen.js +9 -7
- package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.d.ts +21 -25
- package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +1 -1
- package/out/zero-cache/src/services/mutagen/pusher.js +78 -60
- package/out/zero-cache/src/services/mutagen/pusher.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts +3 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.js +10 -6
- package/out/zero-cache/src/services/view-syncer/client-handler.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-schema.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/client-schema.js +6 -3
- package/out/zero-cache/src/services/view-syncer/client-schema.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts +4 -4
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr-store.js +15 -6
- package/out/zero-cache/src/services/view-syncer/cvr-store.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/cvr.js +4 -2
- package/out/zero-cache/src/services/view-syncer/cvr.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts +1 -0
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.js +5 -0
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/key-columns.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/key-columns.js +4 -2
- package/out/zero-cache/src/services/view-syncer/key-columns.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts +1 -1
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.js +19 -2
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +7 -0
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.js +91 -32
- package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
- package/out/zero-cache/src/types/error-with-level.d.ts +9 -0
- package/out/zero-cache/src/types/error-with-level.d.ts.map +1 -0
- package/out/zero-cache/src/types/error-with-level.js +24 -0
- package/out/zero-cache/src/types/error-with-level.js.map +1 -0
- package/out/zero-cache/src/types/lite.d.ts +15 -13
- package/out/zero-cache/src/types/lite.d.ts.map +1 -1
- package/out/zero-cache/src/types/lite.js +17 -5
- package/out/zero-cache/src/types/lite.js.map +1 -1
- package/out/zero-cache/src/types/pg-data-type.d.ts +73 -0
- package/out/zero-cache/src/types/pg-data-type.d.ts.map +1 -0
- package/out/zero-cache/src/types/pg-data-type.js +76 -0
- package/out/zero-cache/src/types/pg-data-type.js.map +1 -0
- package/out/zero-cache/src/types/pg.d.ts +1 -73
- package/out/zero-cache/src/types/pg.d.ts.map +1 -1
- package/out/zero-cache/src/types/pg.js +0 -77
- package/out/zero-cache/src/types/pg.js.map +1 -1
- package/out/zero-cache/src/types/processes.d.ts +1 -1
- package/out/zero-cache/src/types/processes.d.ts.map +1 -1
- package/out/zero-cache/src/types/processes.js.map +1 -1
- package/out/zero-cache/src/types/schema-versions.d.ts +7 -3
- package/out/zero-cache/src/types/schema-versions.d.ts.map +1 -1
- package/out/zero-cache/src/types/schema-versions.js +7 -5
- package/out/zero-cache/src/types/schema-versions.js.map +1 -1
- package/out/zero-cache/src/types/streams.d.ts +1 -1
- package/out/zero-cache/src/types/streams.d.ts.map +1 -1
- package/out/zero-cache/src/types/streams.js +19 -9
- package/out/zero-cache/src/types/streams.js.map +1 -1
- package/out/zero-cache/src/types/subscription.d.ts +17 -2
- package/out/zero-cache/src/types/subscription.d.ts.map +1 -1
- package/out/zero-cache/src/types/subscription.js +42 -6
- package/out/zero-cache/src/types/subscription.js.map +1 -1
- package/out/zero-cache/src/types/websocket-handoff.d.ts +3 -3
- package/out/zero-cache/src/types/websocket-handoff.d.ts.map +1 -1
- package/out/zero-cache/src/types/websocket-handoff.js +6 -4
- package/out/zero-cache/src/types/websocket-handoff.js.map +1 -1
- package/out/zero-cache/src/workers/connection.d.ts +6 -1
- package/out/zero-cache/src/workers/connection.d.ts.map +1 -1
- package/out/zero-cache/src/workers/connection.js +26 -9
- package/out/zero-cache/src/workers/connection.js.map +1 -1
- package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts.map +1 -1
- package/out/zero-cache/src/workers/syncer-ws-message-handler.js +7 -1
- package/out/zero-cache/src/workers/syncer-ws-message-handler.js.map +1 -1
- package/out/zero-cache/src/workers/syncer.d.ts.map +1 -1
- package/out/zero-cache/src/workers/syncer.js +22 -4
- package/out/zero-cache/src/workers/syncer.js.map +1 -1
- package/out/zero-client/src/client/client-error-kind-enum.d.ts +8 -0
- package/out/zero-client/src/client/client-error-kind-enum.d.ts.map +1 -1
- package/out/zero-client/src/client/connection-manager.d.ts +82 -14
- package/out/zero-client/src/client/connection-manager.d.ts.map +1 -1
- package/out/zero-client/src/client/connection-status-enum.d.ts +4 -0
- package/out/zero-client/src/client/connection-status-enum.d.ts.map +1 -1
- package/out/zero-client/src/client/connection.d.ts +53 -0
- package/out/zero-client/src/client/connection.d.ts.map +1 -0
- package/out/zero-client/src/client/error.d.ts +51 -24
- package/out/zero-client/src/client/error.d.ts.map +1 -1
- package/out/zero-client/src/client/ivm-branch.d.ts +2 -2
- package/out/zero-client/src/client/ivm-branch.d.ts.map +1 -1
- package/out/zero-client/src/client/metrics.d.ts +9 -0
- package/out/zero-client/src/client/metrics.d.ts.map +1 -1
- package/out/zero-client/src/client/mutation-tracker.d.ts +5 -4
- package/out/zero-client/src/client/mutation-tracker.d.ts.map +1 -1
- package/out/zero-client/src/client/options.d.ts +15 -18
- package/out/zero-client/src/client/options.d.ts.map +1 -1
- package/out/zero-client/src/client/query-manager.d.ts +5 -4
- package/out/zero-client/src/client/query-manager.d.ts.map +1 -1
- package/out/zero-client/src/client/zero-rep.d.ts +3 -1
- package/out/zero-client/src/client/zero-rep.d.ts.map +1 -1
- package/out/zero-client/src/client/zero.d.ts +27 -5
- package/out/zero-client/src/client/zero.d.ts.map +1 -1
- package/out/zero-client/src/mod.d.ts +12 -1
- package/out/zero-client/src/mod.d.ts.map +1 -1
- package/out/zero-client/src/types/query-result.d.ts +23 -0
- package/out/zero-client/src/types/query-result.d.ts.map +1 -0
- package/out/zero-protocol/src/application-error.d.ts +33 -0
- package/out/zero-protocol/src/application-error.d.ts.map +1 -0
- package/out/zero-protocol/src/application-error.js +37 -0
- package/out/zero-protocol/src/application-error.js.map +1 -0
- package/out/zero-protocol/src/custom-queries.d.ts +56 -53
- package/out/zero-protocol/src/custom-queries.d.ts.map +1 -1
- package/out/zero-protocol/src/custom-queries.js +16 -14
- package/out/zero-protocol/src/custom-queries.js.map +1 -1
- package/out/zero-protocol/src/down.d.ts +8 -10
- package/out/zero-protocol/src/down.d.ts.map +1 -1
- package/out/zero-protocol/src/error-kind-enum.d.ts +65 -0
- package/out/zero-protocol/src/error-kind-enum.d.ts.map +1 -1
- package/out/zero-protocol/src/error-kind-enum.js +2 -0
- package/out/zero-protocol/src/error-kind-enum.js.map +1 -1
- package/out/zero-protocol/src/error-origin-enum.d.ts +7 -0
- package/out/zero-protocol/src/error-origin-enum.d.ts.map +1 -0
- package/out/zero-protocol/src/error-origin-enum.js +4 -0
- package/out/zero-protocol/src/error-origin-enum.js.map +1 -0
- package/out/zero-protocol/src/error-origin.d.ts +5 -0
- package/out/zero-protocol/src/error-origin.d.ts.map +1 -0
- package/out/zero-protocol/src/error-origin.js +3 -0
- package/out/zero-protocol/src/error-origin.js.map +1 -0
- package/out/zero-protocol/src/error-reason-enum.d.ts +15 -0
- package/out/zero-protocol/src/error-reason-enum.d.ts.map +1 -0
- package/out/zero-protocol/src/error-reason-enum.js +8 -0
- package/out/zero-protocol/src/error-reason-enum.js.map +1 -0
- package/out/zero-protocol/src/error-reason.d.ts +5 -0
- package/out/zero-protocol/src/error-reason.d.ts.map +1 -0
- package/out/zero-protocol/src/error-reason.js +3 -0
- package/out/zero-protocol/src/error-reason.js.map +1 -0
- package/out/zero-protocol/src/error.d.ts +181 -1
- package/out/zero-protocol/src/error.d.ts.map +1 -1
- package/out/zero-protocol/src/error.js +71 -2
- package/out/zero-protocol/src/error.js.map +1 -1
- package/out/zero-protocol/src/mutation-id.d.ts +7 -0
- package/out/zero-protocol/src/mutation-id.d.ts.map +1 -0
- package/out/zero-protocol/src/mutation-id.js +6 -0
- package/out/zero-protocol/src/mutation-id.js.map +1 -0
- package/out/zero-protocol/src/mutations-patch.d.ts +6 -3
- package/out/zero-protocol/src/mutations-patch.d.ts.map +1 -1
- package/out/zero-protocol/src/mutations-patch.js +2 -1
- package/out/zero-protocol/src/mutations-patch.js.map +1 -1
- package/out/zero-protocol/src/poke.d.ts +2 -0
- package/out/zero-protocol/src/poke.d.ts.map +1 -1
- package/out/zero-protocol/src/protocol-version.d.ts +1 -1
- package/out/zero-protocol/src/protocol-version.d.ts.map +1 -1
- package/out/zero-protocol/src/protocol-version.js +3 -1
- package/out/zero-protocol/src/protocol-version.js.map +1 -1
- package/out/zero-protocol/src/push.d.ts +145 -13
- package/out/zero-protocol/src/push.d.ts.map +1 -1
- package/out/zero-protocol/src/push.js +35 -13
- package/out/zero-protocol/src/push.js.map +1 -1
- package/out/zero-react/src/mod.d.ts +7 -2
- package/out/zero-react/src/mod.d.ts.map +1 -1
- package/out/zero-react/src/use-query.d.ts +1 -21
- package/out/zero-react/src/use-query.d.ts.map +1 -1
- package/out/zero-react/src/use-zero-connection-state.d.ts +9 -0
- package/out/zero-react/src/use-zero-connection-state.d.ts.map +1 -0
- package/out/zero-react/src/use-zero-online.d.ts +2 -0
- package/out/zero-react/src/use-zero-online.d.ts.map +1 -1
- package/out/zero-react/src/zero-provider.d.ts.map +1 -1
- package/out/zero-server/src/mod.d.ts +5 -4
- package/out/zero-server/src/mod.d.ts.map +1 -1
- package/out/zero-server/src/mod.js +5 -4
- package/out/zero-server/src/mod.js.map +1 -1
- package/out/zero-server/src/process-mutations.d.ts +3 -3
- package/out/zero-server/src/process-mutations.d.ts.map +1 -1
- package/out/zero-server/src/process-mutations.js +181 -68
- package/out/zero-server/src/process-mutations.js.map +1 -1
- package/out/zero-server/src/queries/process-queries.d.ts +4 -3
- package/out/zero-server/src/queries/process-queries.d.ts.map +1 -1
- package/out/zero-server/src/queries/process-queries.js +85 -19
- package/out/zero-server/src/queries/process-queries.js.map +1 -1
- package/out/zero-server/src/schema.js +1 -1
- package/out/zero-server/src/schema.js.map +1 -1
- package/out/zero-server/src/zql-database.d.ts +1 -1
- package/out/zero-server/src/zql-database.d.ts.map +1 -1
- package/out/zero-server/src/zql-database.js.map +1 -1
- package/out/zero-solid/src/mod.d.ts +11 -2
- package/out/zero-solid/src/mod.d.ts.map +1 -1
- package/out/zero-solid/src/solid-view.d.ts +3 -23
- package/out/zero-solid/src/solid-view.d.ts.map +1 -1
- package/out/zero-solid/src/use-query.d.ts +1 -1
- package/out/zero-solid/src/use-query.d.ts.map +1 -1
- package/out/zero-solid/src/use-zero-connection-state.d.ts +10 -0
- package/out/zero-solid/src/use-zero-connection-state.d.ts.map +1 -0
- package/out/zero-solid/src/use-zero-online.d.ts +1 -7
- package/out/zero-solid/src/use-zero-online.d.ts.map +1 -1
- package/out/zero-solid/src/use-zero.d.ts +1 -0
- package/out/zero-solid/src/use-zero.d.ts.map +1 -1
- package/out/zero.js +15 -3
- package/out/zql/src/builder/builder.d.ts +2 -1
- package/out/zql/src/builder/builder.d.ts.map +1 -1
- package/out/zql/src/builder/builder.js +5 -1
- package/out/zql/src/builder/builder.js.map +1 -1
- package/out/zql/src/ivm/data.d.ts +1 -1
- package/out/zql/src/ivm/data.d.ts.map +1 -1
- package/out/zql/src/ivm/data.js.map +1 -1
- package/out/zql/src/ivm/filter-push.d.ts +1 -1
- package/out/zql/src/ivm/filter-push.d.ts.map +1 -1
- package/out/zql/src/ivm/filter-push.js.map +1 -1
- package/out/zql/src/ivm/memory-source.d.ts +2 -2
- package/out/zql/src/ivm/memory-source.d.ts.map +1 -1
- package/out/zql/src/ivm/memory-source.js.map +1 -1
- package/out/zql/src/ivm/source.d.ts +1 -1
- package/out/zql/src/ivm/source.d.ts.map +1 -1
- package/out/zql/src/ivm/take.d.ts +1 -1
- package/out/zql/src/ivm/take.d.ts.map +1 -1
- package/out/zql/src/ivm/take.js.map +1 -1
- package/out/zql/src/planner/planner-builder.d.ts +15 -0
- package/out/zql/src/planner/planner-builder.d.ts.map +1 -0
- package/out/zql/src/planner/planner-builder.js +180 -0
- package/out/zql/src/planner/planner-builder.js.map +1 -0
- package/out/zql/src/planner/planner-connection.d.ts +125 -0
- package/out/zql/src/planner/planner-connection.d.ts.map +1 -0
- package/out/zql/src/planner/planner-connection.js +257 -0
- package/out/zql/src/planner/planner-connection.js.map +1 -0
- package/out/zql/src/planner/planner-constraint.d.ts +14 -0
- package/out/zql/src/planner/planner-constraint.d.ts.map +1 -0
- package/out/zql/src/planner/planner-constraint.js +12 -0
- package/out/zql/src/planner/planner-constraint.js.map +1 -0
- package/out/zql/src/planner/planner-debug.d.ts +148 -0
- package/out/zql/src/planner/planner-debug.d.ts.map +1 -0
- package/out/zql/src/planner/planner-debug.js +176 -0
- package/out/zql/src/planner/planner-debug.js.map +1 -0
- package/out/zql/src/planner/planner-fan-in.d.ts +39 -0
- package/out/zql/src/planner/planner-fan-in.d.ts.map +1 -0
- package/out/zql/src/planner/planner-fan-in.js +167 -0
- package/out/zql/src/planner/planner-fan-in.js.map +1 -0
- package/out/zql/src/planner/planner-fan-out.d.ts +23 -0
- package/out/zql/src/planner/planner-fan-out.d.ts.map +1 -0
- package/out/zql/src/planner/planner-fan-out.js +62 -0
- package/out/zql/src/planner/planner-fan-out.js.map +1 -0
- package/out/zql/src/planner/planner-graph.d.ts +103 -0
- package/out/zql/src/planner/planner-graph.d.ts.map +1 -0
- package/out/zql/src/planner/planner-graph.js +380 -0
- package/out/zql/src/planner/planner-graph.js.map +1 -0
- package/out/zql/src/planner/planner-join.d.ts +136 -0
- package/out/zql/src/planner/planner-join.d.ts.map +1 -0
- package/out/zql/src/planner/planner-join.js +329 -0
- package/out/zql/src/planner/planner-join.js.map +1 -0
- package/out/zql/src/planner/planner-node.d.ts +48 -0
- package/out/zql/src/planner/planner-node.d.ts.map +1 -0
- package/out/zql/src/planner/planner-node.js +2 -0
- package/out/zql/src/planner/planner-node.js.map +1 -0
- package/out/zql/src/planner/planner-source.d.ts +11 -0
- package/out/zql/src/planner/planner-source.d.ts.map +1 -0
- package/out/zql/src/planner/planner-source.js +13 -0
- package/out/zql/src/planner/planner-source.js.map +1 -0
- package/out/zql/src/planner/planner-terminus.d.ts +17 -0
- package/out/zql/src/planner/planner-terminus.d.ts.map +1 -0
- package/out/zql/src/planner/planner-terminus.js +28 -0
- package/out/zql/src/planner/planner-terminus.js.map +1 -0
- package/out/zql/src/query/error.d.ts +4 -0
- package/out/zql/src/query/error.d.ts.map +1 -0
- package/out/zql/src/query/error.js +9 -0
- package/out/zql/src/query/error.js.map +1 -0
- package/out/zql/src/query/expression.d.ts +2 -2
- package/out/zql/src/query/expression.d.ts.map +1 -1
- package/out/zql/src/query/expression.js.map +1 -1
- package/out/zql/src/query/named.d.ts.map +1 -1
- package/out/zql/src/query/named.js +9 -1
- package/out/zql/src/query/named.js.map +1 -1
- package/out/zql/src/query/query-delegate.d.ts +3 -3
- package/out/zql/src/query/query-delegate.d.ts.map +1 -1
- package/out/zql/src/query/query-impl.d.ts +8 -8
- package/out/zql/src/query/query-impl.d.ts.map +1 -1
- package/out/zql/src/query/query-impl.js.map +1 -1
- package/out/zql/src/query/query.d.ts +3 -3
- package/out/zql/src/query/query.d.ts.map +1 -1
- package/out/zql/src/query/static-query.d.ts +1 -1
- package/out/zql/src/query/static-query.d.ts.map +1 -1
- package/out/zql/src/query/static-query.js.map +1 -1
- package/out/zql/src/query/typed-view.d.ts +1 -1
- package/out/zql/src/query/typed-view.d.ts.map +1 -1
- package/out/zqlite/src/query-delegate.d.ts +1 -1
- package/out/zqlite/src/query-delegate.d.ts.map +1 -1
- package/out/zqlite/src/query-delegate.js.map +1 -1
- package/out/zqlite/src/sqlite-cost-model.d.ts +17 -0
- package/out/zqlite/src/sqlite-cost-model.d.ts.map +1 -0
- package/out/zqlite/src/sqlite-cost-model.js +134 -0
- package/out/zqlite/src/sqlite-cost-model.js.map +1 -0
- package/out/zqlite/src/table-source.d.ts +1 -1
- package/out/zqlite/src/table-source.d.ts.map +1 -1
- package/out/zqlite/src/table-source.js.map +1 -1
- package/package.json +6 -4
- package/out/chunk-BJ2CGCME.js.map +0 -7
- package/out/chunk-MXPHMVU7.js.map +0 -7
- package/out/zero-cache/src/types/error-for-client.d.ts +0 -23
- package/out/zero-cache/src/types/error-for-client.d.ts.map +0 -1
- package/out/zero-cache/src/types/error-for-client.js +0 -28
- package/out/zero-cache/src/types/error-for-client.js.map +0 -1
- package/out/zero-client/src/client/ping-result-enum.d.ts +0 -5
- package/out/zero-client/src/client/ping-result-enum.d.ts.map +0 -1
- /package/out/{chunk-4RB4OYLQ.js.map → chunk-TJFNGO7E.js.map} +0 -0
- /package/out/{lazy-inspector-2SW772W4.js.map → lazy-inspector-OXIFYSSQ.js.map} +0 -0
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { assert } from "../../../shared/src/asserts.js";
|
|
2
|
+
import { mergeConstraints, } from "./planner-constraint.js";
|
|
3
|
+
/**
|
|
4
|
+
* Translate constraints for a flipped join from parent space to child space.
|
|
5
|
+
* Matches the runtime behavior of FlippedJoin.fetch() which translates
|
|
6
|
+
* parent constraints to child constraints using index-based key mapping.
|
|
7
|
+
*
|
|
8
|
+
* Example:
|
|
9
|
+
* parentConstraint = {issueID: undefined, projectID: undefined}
|
|
10
|
+
* childConstraint = {id: undefined, projectID: undefined}
|
|
11
|
+
* incomingConstraint = {issueID: 5}
|
|
12
|
+
* result = {id: 5} // issueID at index 0 maps to id at index 0
|
|
13
|
+
*/
|
|
14
|
+
function translateConstraintsForFlippedJoin(incomingConstraint, parentConstraint, childConstraint) {
|
|
15
|
+
if (!incomingConstraint)
|
|
16
|
+
return undefined;
|
|
17
|
+
const parentKeys = Object.keys(parentConstraint);
|
|
18
|
+
const childKeys = Object.keys(childConstraint);
|
|
19
|
+
const translated = {};
|
|
20
|
+
for (const [key, value] of Object.entries(incomingConstraint)) {
|
|
21
|
+
const index = parentKeys.indexOf(key);
|
|
22
|
+
if (index !== -1) {
|
|
23
|
+
// Found this key in parent at position `index`
|
|
24
|
+
// Map to child key at same position
|
|
25
|
+
translated[childKeys[index]] = value;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return Object.keys(translated).length > 0 ? translated : undefined;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Semi-join overhead multiplier.
|
|
32
|
+
*
|
|
33
|
+
* Semi-joins represent correlated subqueries (EXISTS checks) which have
|
|
34
|
+
* execution overhead compared to flipped joins, even when logical row counts
|
|
35
|
+
* are identical. This overhead comes from:
|
|
36
|
+
* - Need to execute a separate correlation check for each parent row
|
|
37
|
+
* - Cannot leverage combined constraint checking as effectively as flipped joins
|
|
38
|
+
*
|
|
39
|
+
* A multiplier of 1.5 means semi-joins are estimated to be ~50% more expensive
|
|
40
|
+
* than equivalent flipped joins, which empirically matches observed performance
|
|
41
|
+
* differences in production workloads (e.g., 1.7x in zbugs benchmarks).
|
|
42
|
+
*
|
|
43
|
+
* Flipped joins have a different overhead in that they become unlimited. This
|
|
44
|
+
* is accounted for when propagating unlimits rather than here.
|
|
45
|
+
*/
|
|
46
|
+
// const SEMI_JOIN_OVERHEAD_MULTIPLIER = 1.5;
|
|
47
|
+
/**
|
|
48
|
+
* Represents a join between two data streams (parent and child).
|
|
49
|
+
*
|
|
50
|
+
* # Dual-State Pattern
|
|
51
|
+
* Like all planner nodes, PlannerJoin separates:
|
|
52
|
+
* 1. IMMUTABLE STRUCTURE: Parent/child nodes, constraints, flippability
|
|
53
|
+
* 2. MUTABLE STATE: Join type (semi/flipped), pinned status
|
|
54
|
+
*
|
|
55
|
+
* # Join Flipping
|
|
56
|
+
* A join can be in two states:
|
|
57
|
+
* - 'semi': Parent is outer loop, child is inner (semi-join for EXISTS)
|
|
58
|
+
* - 'flipped': Child is outer loop, parent is inner
|
|
59
|
+
*
|
|
60
|
+
* Flipping is the key optimization: choosing which table scans first.
|
|
61
|
+
* NOT EXISTS joins cannot be flipped (#flippable = false).
|
|
62
|
+
*
|
|
63
|
+
* # Constraint Propagation
|
|
64
|
+
* - Semi-join: Sends childConstraint to child, forwards received constraints to parent
|
|
65
|
+
* - Flipped join: Sends undefined to child, merges parentConstraint with received to parent
|
|
66
|
+
* - Unpinned join: Only forwards constraints to parent (doesn't constrain child yet)
|
|
67
|
+
*
|
|
68
|
+
* # Lifecycle
|
|
69
|
+
* 1. Construct with immutable structure (parent, child, constraints, flippability)
|
|
70
|
+
* 2. Wire to output node during graph construction
|
|
71
|
+
* 3. Planning calls flipIfNeeded() based on connection selection order
|
|
72
|
+
* 4. pin() locks the join type once chosen
|
|
73
|
+
* 5. reset() clears mutable state (type → 'semi', pinned → false)
|
|
74
|
+
*/
|
|
75
|
+
export class PlannerJoin {
|
|
76
|
+
kind = 'join';
|
|
77
|
+
#parent;
|
|
78
|
+
#child;
|
|
79
|
+
#parentConstraint;
|
|
80
|
+
#childConstraint;
|
|
81
|
+
#flippable;
|
|
82
|
+
planId;
|
|
83
|
+
#output; // Set once during graph construction
|
|
84
|
+
// Reset between planning attempts
|
|
85
|
+
#type;
|
|
86
|
+
constructor(parent, child, parentConstraint, childConstraint, flippable, planId) {
|
|
87
|
+
this.#type = 'semi';
|
|
88
|
+
this.#parent = parent;
|
|
89
|
+
this.#child = child;
|
|
90
|
+
this.#childConstraint = childConstraint;
|
|
91
|
+
this.#parentConstraint = parentConstraint;
|
|
92
|
+
this.#flippable = flippable;
|
|
93
|
+
this.planId = planId;
|
|
94
|
+
}
|
|
95
|
+
setOutput(node) {
|
|
96
|
+
this.#output = node;
|
|
97
|
+
}
|
|
98
|
+
get output() {
|
|
99
|
+
assert(this.#output !== undefined, 'Output not set');
|
|
100
|
+
return this.#output;
|
|
101
|
+
}
|
|
102
|
+
closestJoinOrSource() {
|
|
103
|
+
return 'join';
|
|
104
|
+
}
|
|
105
|
+
flipIfNeeded(input) {
|
|
106
|
+
if (input === this.#child) {
|
|
107
|
+
this.flip();
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
assert(input === this.#parent, 'Can only flip a join from one of its inputs');
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
flip() {
|
|
114
|
+
assert(this.#type === 'semi', 'Can only flip a semi-join');
|
|
115
|
+
if (!this.#flippable) {
|
|
116
|
+
throw new UnflippableJoinError('Cannot flip a non-flippable join (e.g., NOT EXISTS)');
|
|
117
|
+
}
|
|
118
|
+
this.#type = 'flipped';
|
|
119
|
+
}
|
|
120
|
+
get type() {
|
|
121
|
+
return this.#type;
|
|
122
|
+
}
|
|
123
|
+
isFlippable() {
|
|
124
|
+
return this.#flippable;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Propagate unlimiting when this join is flipped.
|
|
128
|
+
* When a join is flipped:
|
|
129
|
+
* 1. Child becomes outer loop → produces all rows (unlimited)
|
|
130
|
+
* 2. Parent is fetched once per child row → effectively unlimited
|
|
131
|
+
*
|
|
132
|
+
* Example: If child produces 896 rows, parent is fetched 896 times.
|
|
133
|
+
* Even if each fetch returns 1 row, parent produces 896 total rows.
|
|
134
|
+
*
|
|
135
|
+
* Propagation rules:
|
|
136
|
+
* - Connection: call unlimit()
|
|
137
|
+
* - Semi-join: continue to parent (outer loop)
|
|
138
|
+
* - Flipped join: stop (already unlimited when it was flipped)
|
|
139
|
+
* - Fan-out/Fan-in: propagate to all inputs
|
|
140
|
+
*/
|
|
141
|
+
propagateUnlimit() {
|
|
142
|
+
assert(this.#type === 'flipped', 'Can only unlimit a flipped join');
|
|
143
|
+
this.#parent.propagateUnlimitFromFlippedJoin();
|
|
144
|
+
this.#child.propagateUnlimitFromFlippedJoin(); // Up the child chain
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Called when a parent join is flipped and this join is part of its child subgraph.
|
|
148
|
+
* - Semi-join: continue propagation to parent (the outer loop)
|
|
149
|
+
* - Flipped join: stop propagation (already unlimited when it was flipped)
|
|
150
|
+
*/
|
|
151
|
+
propagateUnlimitFromFlippedJoin() {
|
|
152
|
+
if (this.#type === 'semi') {
|
|
153
|
+
this.#parent.propagateUnlimitFromFlippedJoin();
|
|
154
|
+
}
|
|
155
|
+
// For flipped joins, stop propagation
|
|
156
|
+
}
|
|
157
|
+
propagateConstraints(branchPattern, constraint, from, planDebugger) {
|
|
158
|
+
planDebugger?.log({
|
|
159
|
+
type: 'node-constraint',
|
|
160
|
+
nodeType: 'join',
|
|
161
|
+
node: this.getName(),
|
|
162
|
+
branchPattern,
|
|
163
|
+
constraint,
|
|
164
|
+
from: from ? getNodeName(from) : 'unknown',
|
|
165
|
+
});
|
|
166
|
+
if (this.#type === 'semi') {
|
|
167
|
+
// A semi-join always has constraints for its child.
|
|
168
|
+
// They are defined by the correlation between parent and child.
|
|
169
|
+
this.#child.propagateConstraints(branchPattern, this.#childConstraint, this, planDebugger);
|
|
170
|
+
// A semi-join forwards constraints to its parent.
|
|
171
|
+
this.#parent.propagateConstraints(branchPattern, constraint, this, planDebugger);
|
|
172
|
+
}
|
|
173
|
+
else if (this.#type === 'flipped') {
|
|
174
|
+
// A flipped join translates constraints from parent space to child space.
|
|
175
|
+
// This matches FlippedJoin.fetch() runtime behavior where parent constraints
|
|
176
|
+
// on join keys are translated to child constraints.
|
|
177
|
+
// Example: If parent has {issueID: 5} and join maps issueID→id,
|
|
178
|
+
// child gets {id: 5} allowing index usage.
|
|
179
|
+
const translatedConstraint = translateConstraintsForFlippedJoin(constraint, this.#parentConstraint, this.#childConstraint);
|
|
180
|
+
this.#child.propagateConstraints(branchPattern, translatedConstraint, this, planDebugger);
|
|
181
|
+
// A flipped join will have constraints to send to its parent.
|
|
182
|
+
// - The constraints its output sent
|
|
183
|
+
// - The constraints its child creates
|
|
184
|
+
this.#parent.propagateConstraints(branchPattern, mergeConstraints(constraint, this.#parentConstraint), this, planDebugger);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
reset() {
|
|
188
|
+
this.#type = 'semi';
|
|
189
|
+
}
|
|
190
|
+
estimateCost(
|
|
191
|
+
/**
|
|
192
|
+
* This argument is to deal with consecutive `andExists` statements.
|
|
193
|
+
* Each one will constrain how often a parent row passes all constraints.
|
|
194
|
+
* This means that we have to scan more and more parent rows the more
|
|
195
|
+
* constraints we add.
|
|
196
|
+
*/
|
|
197
|
+
downstreamChildSelectivity,
|
|
198
|
+
/**
|
|
199
|
+
* branchPattern uniquely identifies OR branches in the graph.
|
|
200
|
+
* Each path through an OR will have unique constraints to apply to the source
|
|
201
|
+
* connection.
|
|
202
|
+
* branchPattern allows us to correlate a path through the graph
|
|
203
|
+
* to the constraints that should be applied for that path.
|
|
204
|
+
*
|
|
205
|
+
* Example graph:
|
|
206
|
+
* UFO
|
|
207
|
+
* / \
|
|
208
|
+
* J1 J2
|
|
209
|
+
* \ /
|
|
210
|
+
* UFI
|
|
211
|
+
*
|
|
212
|
+
* J1 and J2 are joins inside an OR (FO).
|
|
213
|
+
* branchPattern [0] = path through J1
|
|
214
|
+
* branchPattern [1] = path through J2
|
|
215
|
+
*
|
|
216
|
+
* If many ORs are nested, branchPattern will have multiple elements
|
|
217
|
+
* representing each level of OR.
|
|
218
|
+
*
|
|
219
|
+
* If no joins are flipped within the `OR`, then only a single
|
|
220
|
+
* branchPattern element will be needed, as FO represents all sub-joins
|
|
221
|
+
* as a single path.
|
|
222
|
+
*/
|
|
223
|
+
branchPattern, planDebugger) {
|
|
224
|
+
/**
|
|
225
|
+
* downstreamChildSelectivity accumulates up a parent chain, not
|
|
226
|
+
* up child chains. Child chains represent independent sub-graphs.
|
|
227
|
+
* So we pass 1 for `downstreamChildSelectivity` when estimating child cost.
|
|
228
|
+
* Put another way, downstreamChildSelectivity impacts how many parent
|
|
229
|
+
* rows are returned.
|
|
230
|
+
*/
|
|
231
|
+
const child = this.#child.estimateCost(1, branchPattern, planDebugger);
|
|
232
|
+
/**
|
|
233
|
+
* How selective is the graph from this point forward?
|
|
234
|
+
* If we are _very_ selective then we must scan more parent rows
|
|
235
|
+
* before finding a match.
|
|
236
|
+
* E.g., if childSelectivity = 0.1 and downstreamChildSelectivity = 0.5
|
|
237
|
+
* then we only pass 5% of parent rows (0.1 * 0.5 = 0.05).
|
|
238
|
+
*
|
|
239
|
+
* This is used to estimate how many rows will be pulled from the parent
|
|
240
|
+
* when trying to satisfy downstream constraints and a limit.
|
|
241
|
+
*
|
|
242
|
+
* NOTE: We do not know if the probabilities are correlated so we assume independence.
|
|
243
|
+
* This is a fundamental limitation of the planner.
|
|
244
|
+
*/
|
|
245
|
+
const parent = this.#parent.estimateCost(
|
|
246
|
+
// Selectivity flows up the graph from child to parent
|
|
247
|
+
// so we can determine the total selectivity of all ANDed exists checks.
|
|
248
|
+
child.selectivity * downstreamChildSelectivity, branchPattern, planDebugger);
|
|
249
|
+
let costEstimate;
|
|
250
|
+
if (this.type === 'semi') {
|
|
251
|
+
costEstimate = {
|
|
252
|
+
startupCost: parent.startupCost,
|
|
253
|
+
scanEst: parent.limit === undefined
|
|
254
|
+
? parent.returnedRows
|
|
255
|
+
: Math.min(parent.returnedRows, parent.limit / downstreamChildSelectivity),
|
|
256
|
+
cost: parent.cost + parent.scanEst * (child.startupCost + child.scanEst),
|
|
257
|
+
returnedRows: parent.returnedRows * child.selectivity,
|
|
258
|
+
selectivity: child.selectivity * parent.selectivity,
|
|
259
|
+
limit: parent.limit,
|
|
260
|
+
};
|
|
261
|
+
}
|
|
262
|
+
else {
|
|
263
|
+
costEstimate = {
|
|
264
|
+
startupCost: child.startupCost,
|
|
265
|
+
scanEst: parent.limit === undefined
|
|
266
|
+
? parent.returnedRows
|
|
267
|
+
: Math.min(parent.returnedRows * child.returnedRows, parent.limit / downstreamChildSelectivity),
|
|
268
|
+
cost: child.cost + child.scanEst * (parent.startupCost + parent.scanEst),
|
|
269
|
+
returnedRows: parent.returnedRows * child.returnedRows * child.selectivity,
|
|
270
|
+
selectivity: parent.selectivity * child.selectivity,
|
|
271
|
+
limit: parent.limit,
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
planDebugger?.log({
|
|
275
|
+
type: 'node-cost',
|
|
276
|
+
nodeType: 'join',
|
|
277
|
+
node: this.getName(),
|
|
278
|
+
branchPattern,
|
|
279
|
+
downstreamChildSelectivity,
|
|
280
|
+
costEstimate,
|
|
281
|
+
joinType: this.#type,
|
|
282
|
+
});
|
|
283
|
+
return costEstimate;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Get a human-readable name for this join for debugging.
|
|
287
|
+
* Format: "parentName ⋈ childName"
|
|
288
|
+
*/
|
|
289
|
+
getName() {
|
|
290
|
+
const parentName = getNodeName(this.#parent);
|
|
291
|
+
const childName = getNodeName(this.#child);
|
|
292
|
+
return `${parentName} ⋈ ${childName}`;
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Get debug information about this join's state.
|
|
296
|
+
*/
|
|
297
|
+
getDebugInfo() {
|
|
298
|
+
return {
|
|
299
|
+
name: this.getName(),
|
|
300
|
+
type: this.#type,
|
|
301
|
+
planId: this.planId,
|
|
302
|
+
};
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
export class UnflippableJoinError extends Error {
|
|
306
|
+
constructor(message) {
|
|
307
|
+
super(message);
|
|
308
|
+
this.name = 'UnflippableJoinError';
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Get a human-readable name for any planner node.
|
|
313
|
+
* Used for debugging and tracing.
|
|
314
|
+
*/
|
|
315
|
+
function getNodeName(node) {
|
|
316
|
+
switch (node.kind) {
|
|
317
|
+
case 'connection':
|
|
318
|
+
return node.name;
|
|
319
|
+
case 'join':
|
|
320
|
+
return node.getName();
|
|
321
|
+
case 'fan-out':
|
|
322
|
+
return 'FO';
|
|
323
|
+
case 'fan-in':
|
|
324
|
+
return 'FI';
|
|
325
|
+
case 'terminus':
|
|
326
|
+
return 'terminus';
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
//# sourceMappingURL=planner-join.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-join.js","sourceRoot":"","sources":["../../../../../zql/src/planner/planner-join.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,gCAAgC,CAAC;AACtD,OAAO,EACL,gBAAgB,GAEjB,MAAM,yBAAyB,CAAC;AASjC;;;;;;;;;;GAUG;AACH,SAAS,kCAAkC,CACzC,kBAAiD,EACjD,gBAAmC,EACnC,eAAkC;IAElC,IAAI,CAAC,kBAAkB;QAAE,OAAO,SAAS,CAAC;IAE1C,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACjD,MAAM,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC/C,MAAM,UAAU,GAAsB,EAAE,CAAC;IAEzC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC,EAAE,CAAC;QAC9D,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE,CAAC;YACjB,+CAA+C;YAC/C,oCAAoC;YACpC,UAAU,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,GAAG,KAAK,CAAC;QACvC,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;AACrE,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,6CAA6C;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,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CAAC,OAAO,EAAE;YACpB,aAAa;YACb,0BAA0B;YAC1B,YAAY;YACZ,QAAQ,EAAE,IAAI,CAAC,KAAK;SACrB,CAAC,CAAC;QAEH,OAAO,YAAY,CAAC;IACtB,CAAC;IAED;;;OAGG;IACH,OAAO;QACL,MAAM,UAAU,GAAG,WAAW,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QAC7C,MAAM,SAAS,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAC3C,OAAO,GAAG,UAAU,MAAM,SAAS,EAAE,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,YAAY;QAKV,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,OAAO,EAAE;YACpB,IAAI,EAAE,IAAI,CAAC,KAAK;YAChB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAC;IACJ,CAAC;CACF;AAED,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAC7C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;IACrC,CAAC;CACF;AAED;;;GAGG;AACH,SAAS,WAAW,CAAC,IAAiB;IACpC,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,KAAK,YAAY;YACf,OAAO,IAAI,CAAC,IAAI,CAAC;QACnB,KAAK,MAAM;YACT,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;QACxB,KAAK,SAAS;YACZ,OAAO,IAAI,CAAC;QACd,KAAK,QAAQ;YACX,OAAO,IAAI,CAAC;QACd,KAAK,UAAU;YACb,OAAO,UAAU,CAAC;IACtB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { PlannerConnection } from './planner-connection.ts';
|
|
2
|
+
import type { PlannerFanIn } from './planner-fan-in.ts';
|
|
3
|
+
import type { PlannerFanOut } from './planner-fan-out.ts';
|
|
4
|
+
import type { PlannerJoin } from './planner-join.ts';
|
|
5
|
+
import type { PlannerTerminus } from './planner-terminus.ts';
|
|
6
|
+
/**
|
|
7
|
+
* Union of all node types that can appear in the planner graph.
|
|
8
|
+
* All nodes follow the dual-state pattern described above.
|
|
9
|
+
*/
|
|
10
|
+
export type PlannerNode = PlannerJoin | PlannerConnection | PlannerFanOut | PlannerFanIn | PlannerTerminus;
|
|
11
|
+
export type CostEstimate = {
|
|
12
|
+
startupCost: number;
|
|
13
|
+
scanEst: number;
|
|
14
|
+
/**
|
|
15
|
+
* The cumulative cost to run the pipeline so far.
|
|
16
|
+
*
|
|
17
|
+
* In a semi-join, each row output by the parent is multiplied by the cost to evaluate the child.
|
|
18
|
+
* In a flipped join, each row output by the child is multiplied by the cost to evaluate the parent.
|
|
19
|
+
*
|
|
20
|
+
* "each row output by the parent" is determined by the downstreamChildSelectivity parameter in combination
|
|
21
|
+
* with the limit or the rows output by the parent node.
|
|
22
|
+
*
|
|
23
|
+
* We pull on the parent and stop when hitting a limit or exhausting rows.
|
|
24
|
+
*/
|
|
25
|
+
cost: number;
|
|
26
|
+
/**
|
|
27
|
+
* The number of rows output from a node.
|
|
28
|
+
* - For a connection, this is the estimated number of rows returned by the source query.
|
|
29
|
+
* - For a semi-join, this is the estimated number of rows that pass the semi-join filter.
|
|
30
|
+
* - For a flipped join, this is the estimated number of rows that match all child rows.
|
|
31
|
+
* - For fan-in, this is the sum of the rows from each input.
|
|
32
|
+
* - For fan-out, this is the rows from its input.
|
|
33
|
+
*/
|
|
34
|
+
returnedRows: number;
|
|
35
|
+
/**
|
|
36
|
+
* The selectivity of the node.
|
|
37
|
+
* For a connection, this is the fraction of rows passing filters (1.0 = no filtering).
|
|
38
|
+
* For joins, this is the fraction of parent rows that match child rows.
|
|
39
|
+
* For fan-in, this is the probability of a match in any branch, assuming independent events.
|
|
40
|
+
* For fan-out, this is the selectivity of its input.
|
|
41
|
+
*/
|
|
42
|
+
selectivity: number;
|
|
43
|
+
limit: number | undefined;
|
|
44
|
+
};
|
|
45
|
+
export type NodeType = PlannerNode['kind'];
|
|
46
|
+
export type JoinOrConnection = 'join' | 'connection';
|
|
47
|
+
export type JoinType = PlannerJoin['type'];
|
|
48
|
+
//# sourceMappingURL=planner-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-node.d.ts","sourceRoot":"","sources":["../../../../../zql/src/planner/planner-node.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAC/D,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,mBAAmB,CAAC;AACnD,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAE3D;;;GAGG;AACH,MAAM,MAAM,WAAW,GACnB,WAAW,GACX,iBAAiB,GACjB,aAAa,GACb,YAAY,GACZ,eAAe,CAAC;AAEpB,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;;;;;OAUG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;;;;;OAOG;IACH,YAAY,EAAE,MAAM,CAAC;IAErB;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;AAE3C,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,YAAY,CAAC;AAErD,MAAM,MAAM,QAAQ,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-node.js","sourceRoot":"","sources":["../../../../../zql/src/planner/planner-node.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Condition, Ordering } from '../../../zero-protocol/src/ast.ts';
|
|
2
|
+
import { PlannerConnection, type ConnectionCostModel } from './planner-connection.ts';
|
|
3
|
+
import type { PlannerConstraint } from './planner-constraint.ts';
|
|
4
|
+
export type { ConnectionCostModel };
|
|
5
|
+
export declare class PlannerSource {
|
|
6
|
+
#private;
|
|
7
|
+
readonly name: string;
|
|
8
|
+
constructor(name: string, model: ConnectionCostModel);
|
|
9
|
+
connect(sort: Ordering, filters: Condition | undefined, isRoot: boolean, baseConstraints?: PlannerConstraint, limit?: number): PlannerConnection;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=planner-source.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-source.d.ts","sourceRoot":"","sources":["../../../../../zql/src/planner/planner-source.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAE,QAAQ,EAAC,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EACL,iBAAiB,EACjB,KAAK,mBAAmB,EACzB,MAAM,yBAAyB,CAAC;AACjC,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,yBAAyB,CAAC;AAE/D,YAAY,EAAC,mBAAmB,EAAC,CAAC;AAElC,qBAAa,aAAa;;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;gBAGV,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,mBAAmB;IAKpD,OAAO,CACL,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,SAAS,GAAG,SAAS,EAC9B,MAAM,EAAE,OAAO,EACf,eAAe,CAAC,EAAE,iBAAiB,EACnC,KAAK,CAAC,EAAE,MAAM,GACb,iBAAiB;CAWrB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { PlannerConnection, } from "./planner-connection.js";
|
|
2
|
+
export class PlannerSource {
|
|
3
|
+
name;
|
|
4
|
+
#model;
|
|
5
|
+
constructor(name, model) {
|
|
6
|
+
this.name = name;
|
|
7
|
+
this.#model = model;
|
|
8
|
+
}
|
|
9
|
+
connect(sort, filters, isRoot, baseConstraints, limit) {
|
|
10
|
+
return new PlannerConnection(this.name, this.#model, sort, filters, isRoot, baseConstraints, limit);
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=planner-source.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-source.js","sourceRoot":"","sources":["../../../../../zql/src/planner/planner-source.ts"],"names":[],"mappings":"AACA,OAAO,EACL,iBAAiB,GAElB,MAAM,yBAAyB,CAAC;AAKjC,MAAM,OAAO,aAAa;IACf,IAAI,CAAS;IACb,MAAM,CAAsB;IAErC,YAAY,IAAY,EAAE,KAA0B;QAClD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,OAAO,CACL,IAAc,EACd,OAA8B,EAC9B,MAAe,EACf,eAAmC,EACnC,KAAc;QAEd,OAAO,IAAI,iBAAiB,CAC1B,IAAI,CAAC,IAAI,EACT,IAAI,CAAC,MAAM,EACX,IAAI,EACJ,OAAO,EACP,MAAM,EACN,eAAe,EACf,KAAK,CACN,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { PlanDebugger } from './planner-debug.ts';
|
|
2
|
+
import type { CostEstimate, JoinOrConnection, PlannerNode } from './planner-node.ts';
|
|
3
|
+
export declare class PlannerTerminus {
|
|
4
|
+
#private;
|
|
5
|
+
readonly kind: "terminus";
|
|
6
|
+
constructor(input: Exclude<PlannerNode, PlannerTerminus>);
|
|
7
|
+
get pinned(): boolean;
|
|
8
|
+
closestJoinOrSource(): JoinOrConnection;
|
|
9
|
+
propagateConstraints(planDebugger?: PlanDebugger): void;
|
|
10
|
+
estimateCost(planDebugger?: PlanDebugger): CostEstimate;
|
|
11
|
+
/**
|
|
12
|
+
* Propagate unlimiting when a parent join is flipped.
|
|
13
|
+
* Terminus doesn't participate in unlimiting.
|
|
14
|
+
*/
|
|
15
|
+
propagateUnlimitFromFlippedJoin(): void;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=planner-terminus.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-terminus.d.ts","sourceRoot":"","sources":["../../../../../zql/src/planner/planner-terminus.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EACV,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACZ,MAAM,mBAAmB,CAAC;AAE3B,qBAAa,eAAe;;IAC1B,QAAQ,CAAC,IAAI,EAAG,UAAU,CAAU;gBAGxB,KAAK,EAAE,OAAO,CAAC,WAAW,EAAE,eAAe,CAAC;IAIxD,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,mBAAmB,IAAI,gBAAgB;IAIvC,oBAAoB,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,IAAI;IAIvD,YAAY,CAAC,YAAY,CAAC,EAAE,YAAY,GAAG,YAAY;IAKvD;;;OAGG;IACH,+BAA+B,IAAI,IAAI;CAGxC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export class PlannerTerminus {
|
|
2
|
+
kind = 'terminus';
|
|
3
|
+
#input;
|
|
4
|
+
constructor(input) {
|
|
5
|
+
this.#input = input;
|
|
6
|
+
}
|
|
7
|
+
get pinned() {
|
|
8
|
+
return true;
|
|
9
|
+
}
|
|
10
|
+
closestJoinOrSource() {
|
|
11
|
+
return this.#input.closestJoinOrSource();
|
|
12
|
+
}
|
|
13
|
+
propagateConstraints(planDebugger) {
|
|
14
|
+
this.#input.propagateConstraints([], undefined, this, planDebugger);
|
|
15
|
+
}
|
|
16
|
+
estimateCost(planDebugger) {
|
|
17
|
+
// Terminus starts the cost estimation flow with empty branch pattern
|
|
18
|
+
return this.#input.estimateCost(1, [], planDebugger);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Propagate unlimiting when a parent join is flipped.
|
|
22
|
+
* Terminus doesn't participate in unlimiting.
|
|
23
|
+
*/
|
|
24
|
+
propagateUnlimitFromFlippedJoin() {
|
|
25
|
+
// No-op: terminus doesn't need to unlimit anything
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=planner-terminus.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planner-terminus.js","sourceRoot":"","sources":["../../../../../zql/src/planner/planner-terminus.ts"],"names":[],"mappings":"AAOA,MAAM,OAAO,eAAe;IACjB,IAAI,GAAG,UAAmB,CAAC;IAC3B,MAAM,CAAwC;IAEvD,YAAY,KAA4C;QACtD,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;IACtB,CAAC;IAED,IAAI,MAAM;QACR,OAAO,IAAI,CAAC;IACd,CAAC;IAED,mBAAmB;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;IAC3C,CAAC;IAED,oBAAoB,CAAC,YAA2B;QAC9C,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,CAAC,CAAC;IACtE,CAAC;IAED,YAAY,CAAC,YAA2B;QACtC,qEAAqE;QACrE,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC;IACvD,CAAC;IAED;;;OAGG;IACH,+BAA+B;QAC7B,mDAAmD;IACrD,CAAC;CACF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../../zql/src/query/error.ts"],"names":[],"mappings":"AAAA,qBAAa,eAAgB,SAAQ,KAAK;gBAC5B,IAAI,EAAE,YAAY;CAS/B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export class QueryParseError extends Error {
|
|
2
|
+
constructor(opts) {
|
|
3
|
+
super(opts?.cause instanceof Error
|
|
4
|
+
? `Failed to parse arguments for query: ${opts.cause.message}`
|
|
5
|
+
: `Failed to parse arguments for query`, opts);
|
|
6
|
+
this.name = 'QueryParseError';
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=error.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../../../zql/src/query/error.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,eAAgB,SAAQ,KAAK;IACxC,YAAY,IAAkB;QAC5B,KAAK,CACH,IAAI,EAAE,KAAK,YAAY,KAAK;YAC1B,CAAC,CAAC,wCAAwC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE;YAC9D,CAAC,CAAC,qCAAqC,EACzC,IAAI,CACL,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;IAChC,CAAC;CACF"}
|
|
@@ -25,7 +25,7 @@ export interface ExpressionFactory<TSchema extends Schema, TTable extends keyof
|
|
|
25
25
|
}
|
|
26
26
|
export declare class ExpressionBuilder<TSchema extends Schema, TTable extends keyof TSchema['tables'] & string> {
|
|
27
27
|
#private;
|
|
28
|
-
constructor(exists: (relationship: string, cb?: (
|
|
28
|
+
constructor(exists: (relationship: string, cb?: (query: Query<TSchema, TTable>) => Query<TSchema, any>, options?: ExistsOptions) => Condition);
|
|
29
29
|
get eb(): this;
|
|
30
30
|
cmp<TSelector extends NoCompoundTypeSelector<PullTableSchema<TTable, TSchema>>, TOperator extends SimpleOperator>(field: TSelector, op: TOperator, value: GetFilterType<PullTableSchema<TTable, TSchema>, TSelector, TOperator> | ParameterReference): Condition;
|
|
31
31
|
cmp<TSelector extends NoCompoundTypeSelector<PullTableSchema<TTable, TSchema>>>(field: TSelector, value: GetFilterType<PullTableSchema<TTable, TSchema>, TSelector, '='> | ParameterReference): Condition;
|
|
@@ -33,7 +33,7 @@ export declare class ExpressionBuilder<TSchema extends Schema, TTable extends ke
|
|
|
33
33
|
and: typeof and;
|
|
34
34
|
or: typeof or;
|
|
35
35
|
not: typeof not;
|
|
36
|
-
exists: <TRelationship extends AvailableRelationships<TTable, TSchema>>(relationship: TRelationship, cb?: (
|
|
36
|
+
exists: <TRelationship extends AvailableRelationships<TTable, TSchema>>(relationship: TRelationship, cb?: (query: Query<TSchema, DestTableName<TTable, TSchema, TRelationship>>) => Query<TSchema, any>, options?: ExistsOptions) => Condition;
|
|
37
37
|
}
|
|
38
38
|
export declare function and(...conditions: (Condition | undefined)[]): Condition;
|
|
39
39
|
export declare function or(...conditions: (Condition | undefined)[]): Condition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression.d.ts","sourceRoot":"","sources":["../../../../../zql/src/query/expression.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,aAAa,EACb,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,cAAc,EACpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,EACV,sBAAsB,EACtB,aAAa,EACb,aAAa,EACb,aAAa,EACb,sBAAsB,EACtB,eAAe,EACf,KAAK,EACN,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,aAAa,CAAC,IAAI,SAAS,CAAC;CAC9B,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,iBAAiB,CAChC,OAAO,SAAS,MAAM,EACtB,MAAM,SAAS,MAAM,OAAO,CAAC,QAAQ,CAAC,GAAG,MAAM;IAE/C,CAAC,EAAE,EAAE,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;CACrD;AAED,qBAAa,iBAAiB,CAC5B,OAAO,SAAS,MA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AAC;AAEX,MAAM,iBAAiB,GAAG;IACxB,GAAG,uBAAuB;IAC1B,CAAC,QAAQ,CAAC,EAAE,YAAY;IACxB,CAAC,YAAY,CAAC,EAAE,QAAQ;CAChB,CAAC;AAEX,MAAM,UAAU,cAAc,CAC5B,EAAM;IAEN,OAAO,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,eAAe,CAAI,KAAwB;IAClD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAC;AAC5C,CAAC;AAED,SAAS,UAAU,CAAC,UAAuB;IACzC,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC;AAClD,CAAC;AAED,SAAS,WAAW,CAAC,UAAuB;IAC1C,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"named.d.ts","sourceRoot":"","sources":["../../../../../zql/src/query/named.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"named.d.ts","sourceRoot":"","sources":["../../../../../zql/src/query/named.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAC,MAAM,EAAC,MAAM,mCAAmC,CAAC;AAC9D,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAGrD,OAAO,KAAK,EA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GAEG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAEpE"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { QueryParseError } from "./error.js";
|
|
1
2
|
import { newQuery } from "./query-impl.js";
|
|
2
3
|
function normalizeParser(parser) {
|
|
3
4
|
if (parser) {
|
|
@@ -36,7 +37,14 @@ export function withValidation(fn) {
|
|
|
36
37
|
}
|
|
37
38
|
const ret = (context, ...args) => {
|
|
38
39
|
const f = fn;
|
|
39
|
-
|
|
40
|
+
// oxlint-disable-next-line no-explicit-any
|
|
41
|
+
let parsed;
|
|
42
|
+
try {
|
|
43
|
+
parsed = f.parse(args);
|
|
44
|
+
}
|
|
45
|
+
catch (error) {
|
|
46
|
+
throw new QueryParseError({ cause: error });
|
|
47
|
+
}
|
|
40
48
|
return f.takesContext ? f(context, ...parsed) : f(...parsed);
|
|
41
49
|
};
|
|
42
50
|
ret.queryName = fn.queryName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"named.js","sourceRoot":"","sources":["../../../../../zql/src/query/named.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAwBzC,SAAS,eAAe,CACtB,MAA8C;IAE9C,IAAI,MAAM,EAAE,CAAC;QACX,IAAI,OAAO,IAAI,MAAM,EAAE,CAAC;YACtB,OAAO,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnC,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,WAAW,CAKzB,IAAW,EACX,MAAoD,EACpD,EAA+C;IAE/C,MAAM,IAAI,GAAG,eAAe,CAAC,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IAC9C,MAAM,GAAG,GAAQ,CAAC,GAAG,IAAU,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