@rocicorp/zero 0.12.2025012601 → 0.12.2025012800
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/advanced.js +2 -2
- package/out/{chunk-F5QR3K72.js → chunk-424PT5DM.js} +1 -1
- package/out/{chunk-JZD6FXRT.js → chunk-MJYDJPXG.js} +37 -43
- package/out/{chunk-JZD6FXRT.js.map → chunk-MJYDJPXG.js.map} +3 -3
- package/out/{chunk-I5GSZARI.js → chunk-QAAJZ32T.js} +1 -1
- package/out/{chunk-I5GSZARI.js.map → chunk-QAAJZ32T.js.map} +1 -1
- package/out/datadog/src/mod.d.ts +1 -1
- package/out/react.js +1 -1
- package/out/react.js.map +1 -1
- package/out/replicache/src/btree/diff.d.ts +2 -2
- package/out/replicache/src/btree/node.d.ts +8 -8
- package/out/replicache/src/btree/read.d.ts +6 -6
- package/out/replicache/src/btree/write.d.ts +7 -7
- package/out/replicache/src/call-default-fetch.d.ts +1 -1
- package/out/replicache/src/config.d.ts +1 -1
- package/out/replicache/src/connection-loop-delegates.d.ts +2 -2
- package/out/replicache/src/connection-loop.d.ts +1 -1
- package/out/replicache/src/cookies.d.ts +2 -2
- package/out/replicache/src/dag/chunk.d.ts +1 -1
- package/out/replicache/src/dag/gc.d.ts +2 -2
- package/out/replicache/src/dag/key.d.ts +2 -2
- package/out/replicache/src/dag/lazy-store.d.ts +5 -5
- package/out/replicache/src/dag/store-impl.d.ts +5 -5
- package/out/replicache/src/dag/store.d.ts +3 -3
- package/out/replicache/src/dag/visitor.d.ts +3 -3
- package/out/replicache/src/db/commit.d.ts +8 -8
- package/out/replicache/src/db/index.d.ts +7 -7
- package/out/replicache/src/db/read.d.ts +8 -8
- package/out/replicache/src/db/rebase.d.ts +7 -7
- package/out/replicache/src/db/scan.d.ts +1 -1
- package/out/replicache/src/db/write.d.ts +14 -14
- package/out/replicache/src/filter-async-iterable.d.ts +1 -1
- package/out/replicache/src/format-version.d.ts +2 -2
- package/out/replicache/src/frozen-json.d.ts +2 -2
- package/out/replicache/src/get-default-puller.d.ts +1 -1
- package/out/replicache/src/get-default-pusher.d.ts +1 -1
- package/out/replicache/src/hash.d.ts +1 -1
- package/out/replicache/src/impl.d.ts +3 -3
- package/out/replicache/src/index-defs.d.ts +1 -1
- package/out/replicache/src/kv/idb-store-with-mem-fallback.d.ts +1 -1
- package/out/replicache/src/kv/idb-store.d.ts +1 -1
- package/out/replicache/src/kv/idb-store.d.ts.map +1 -1
- package/out/replicache/src/kv/mem-store.d.ts +1 -1
- package/out/replicache/src/kv/read-impl.d.ts +2 -2
- package/out/replicache/src/kv/store.d.ts +1 -1
- package/out/replicache/src/kv/write-impl-base.d.ts +3 -3
- package/out/replicache/src/kv/write-impl.d.ts +3 -3
- package/out/replicache/src/merge-async-iterables.d.ts +1 -1
- package/out/replicache/src/mod.d.ts +36 -36
- package/out/replicache/src/mutation-recovery.d.ts +8 -8
- package/out/replicache/src/new-client-channel.d.ts +1 -1
- package/out/replicache/src/on-persist-channel.d.ts +1 -1
- package/out/replicache/src/patch-operation.d.ts +1 -1
- package/out/replicache/src/pending-mutations.d.ts +3 -3
- package/out/replicache/src/persist/client-gc.d.ts +3 -3
- package/out/replicache/src/persist/client-group-gc.d.ts +2 -2
- package/out/replicache/src/persist/client-groups.d.ts +5 -5
- package/out/replicache/src/persist/clients.d.ts +9 -9
- package/out/replicache/src/persist/collect-idb-databases.d.ts +3 -3
- package/out/replicache/src/persist/gather-mem-only-visitor.d.ts +4 -4
- package/out/replicache/src/persist/gather-not-cached-visitor.d.ts +5 -5
- package/out/replicache/src/persist/heartbeat.d.ts +3 -3
- package/out/replicache/src/persist/idb-databases-store.d.ts +1 -1
- package/out/replicache/src/persist/persist.d.ts +6 -6
- package/out/replicache/src/persist/refresh.d.ts +7 -7
- package/out/replicache/src/process-scheduler.d.ts +1 -1
- package/out/replicache/src/puller.d.ts +6 -6
- package/out/replicache/src/pusher.d.ts +3 -3
- package/out/replicache/src/replicache-impl.d.ts +12 -12
- package/out/replicache/src/replicache-options.d.ts +5 -5
- package/out/replicache/src/replicache.d.ts +10 -10
- package/out/replicache/src/scan-iterator.d.ts +6 -6
- package/out/replicache/src/scan-options.d.ts +2 -2
- package/out/replicache/src/subscriptions.d.ts +7 -7
- package/out/replicache/src/subscriptions.d.ts.map +1 -1
- package/out/replicache/src/sync/diff.d.ts +6 -6
- package/out/replicache/src/sync/ids.d.ts +1 -1
- package/out/replicache/src/sync/patch.d.ts +2 -2
- package/out/replicache/src/sync/pull.d.ts +11 -11
- package/out/replicache/src/sync/push.d.ts +4 -4
- package/out/replicache/src/sync/request-id.d.ts +1 -1
- package/out/replicache/src/transactions.d.ts +9 -9
- package/out/replicache/src/types.d.ts +5 -5
- package/out/shared/src/btree-set.js +1 -1
- package/out/shared/src/deep-clone.d.ts +1 -1
- package/out/shared/src/iterables.js +1 -1
- package/out/shared/src/json-schema.d.ts +1 -1
- package/out/shared/src/json-schema.js +3 -3
- package/out/shared/src/json.js +3 -3
- package/out/shared/src/options.d.ts +1 -1
- package/out/shared/src/options.js +3 -3
- package/out/shared/src/queue.js +1 -1
- package/out/shared/src/random-values.d.ts +1 -1
- package/out/shared/src/random-values.d.ts.map +1 -1
- package/out/shared/src/sleep.js +1 -1
- package/out/solid.js +3 -3
- package/out/solid.js.map +1 -1
- package/out/zero/src/advanced.d.ts +1 -1
- package/out/zero/src/build-schema.d.ts +1 -1
- package/out/zero/src/build-schema.js +1 -1
- package/out/zero/src/change-protocol.d.ts +1 -1
- package/out/zero/src/change-protocol.js +1 -1
- package/out/zero/src/cli.d.ts +1 -1
- package/out/zero/src/cli.js +1 -1
- package/out/zero/src/react.d.ts +1 -1
- package/out/zero/src/server/change-streamer.d.ts +1 -1
- package/out/zero/src/server/change-streamer.js +1 -1
- package/out/zero/src/server/main.d.ts +1 -1
- package/out/zero/src/server/main.js +1 -1
- package/out/zero/src/server/multi/main.d.ts +1 -1
- package/out/zero/src/server/multi/main.js +1 -1
- package/out/zero/src/server/replicator.d.ts +1 -1
- package/out/zero/src/server/replicator.js +1 -1
- package/out/zero/src/server/syncer.d.ts +1 -1
- package/out/zero/src/server/syncer.js +1 -1
- package/out/zero/src/solid.d.ts +1 -1
- package/out/zero/src/zero-cache-dev.js +3 -3
- package/out/zero/src/zero.d.ts +1 -1
- package/out/zero-advanced/src/mod.d.ts +8 -8
- package/out/zero-advanced/src/mod.d.ts.map +1 -1
- package/out/zero-cache/src/auth/jwt.d.ts +1 -1
- package/out/zero-cache/src/auth/load-schema.d.ts +3 -3
- package/out/zero-cache/src/auth/load-schema.d.ts.map +1 -1
- package/out/zero-cache/src/auth/load-schema.js +3 -3
- package/out/zero-cache/src/auth/load-schema.js.map +1 -1
- package/out/zero-cache/src/auth/read-authorizer.d.ts +2 -2
- package/out/zero-cache/src/auth/read-authorizer.d.ts.map +1 -1
- package/out/zero-cache/src/auth/read-authorizer.js +3 -3
- package/out/zero-cache/src/auth/read-authorizer.js.map +1 -1
- package/out/zero-cache/src/auth/write-authorizer.d.ts +5 -5
- package/out/zero-cache/src/auth/write-authorizer.js +14 -14
- package/out/zero-cache/src/config/zero-config.d.ts +2 -2
- package/out/zero-cache/src/config/zero-config.js +6 -6
- package/out/zero-cache/src/db/create.d.ts +1 -1
- package/out/zero-cache/src/db/create.js +1 -1
- package/out/zero-cache/src/db/lite-tables.d.ts +2 -2
- package/out/zero-cache/src/db/lite-tables.js +5 -5
- package/out/zero-cache/src/db/migration-lite.d.ts +2 -2
- package/out/zero-cache/src/db/migration-lite.js +4 -4
- package/out/zero-cache/src/db/migration.d.ts +2 -2
- package/out/zero-cache/src/db/migration.js +3 -3
- package/out/zero-cache/src/db/pg-to-lite.d.ts +2 -2
- package/out/zero-cache/src/db/pg-to-lite.js +5 -5
- package/out/zero-cache/src/db/short-lived-client.d.ts +1 -1
- package/out/zero-cache/src/db/short-lived-client.js +1 -1
- package/out/zero-cache/src/db/specs.d.ts +4 -4
- package/out/zero-cache/src/db/specs.js +3 -3
- package/out/zero-cache/src/db/statements.d.ts +2 -2
- package/out/zero-cache/src/db/statements.js +2 -2
- package/out/zero-cache/src/db/transaction-pool.d.ts +4 -4
- package/out/zero-cache/src/db/transaction-pool.js +3 -3
- package/out/zero-cache/src/server/change-streamer.d.ts +1 -1
- package/out/zero-cache/src/server/change-streamer.js +13 -13
- package/out/zero-cache/src/server/logging.d.ts +1 -1
- package/out/zero-cache/src/server/logging.js +2 -2
- package/out/zero-cache/src/server/main.d.ts +1 -1
- package/out/zero-cache/src/server/main.js +13 -13
- package/out/zero-cache/src/server/multi/config.d.ts +2 -2
- package/out/zero-cache/src/server/multi/config.js +3 -3
- package/out/zero-cache/src/server/multi/main.d.ts +1 -1
- package/out/zero-cache/src/server/multi/main.js +8 -8
- package/out/zero-cache/src/server/multi/runtime.js +1 -1
- package/out/zero-cache/src/server/multi/tenant-dispatcher.d.ts +2 -2
- package/out/zero-cache/src/server/multi/tenant-dispatcher.js +2 -2
- package/out/zero-cache/src/server/replicator.d.ts +1 -1
- package/out/zero-cache/src/server/replicator.js +10 -10
- package/out/zero-cache/src/server/syncer.d.ts +1 -1
- package/out/zero-cache/src/server/syncer.js +21 -21
- package/out/zero-cache/src/services/change-source/pg/change-source.d.ts +8 -8
- package/out/zero-cache/src/services/change-source/pg/change-source.js +24 -24
- package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts +2 -2
- package/out/zero-cache/src/services/change-source/pg/initial-sync.js +15 -15
- package/out/zero-cache/src/services/change-source/pg/lsn.d.ts +2 -2
- package/out/zero-cache/src/services/change-source/pg/lsn.js +2 -2
- package/out/zero-cache/src/services/change-source/pg/schema/ddl.d.ts +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/ddl.js +3 -3
- package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts +2 -2
- package/out/zero-cache/src/services/change-source/pg/schema/init.js +3 -3
- package/out/zero-cache/src/services/change-source/pg/schema/published.d.ts +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/published.js +3 -3
- package/out/zero-cache/src/services/change-source/pg/schema/shard.d.ts +4 -4
- package/out/zero-cache/src/services/change-source/pg/schema/shard.js +7 -7
- package/out/zero-cache/src/services/change-source/pg/schema/validation.d.ts +1 -1
- package/out/zero-cache/src/services/change-source/pg/schema/validation.js +4 -4
- package/out/zero-cache/src/services/change-source/pg/sync-schema.d.ts +2 -2
- package/out/zero-cache/src/services/change-source/pg/sync-schema.js +3 -3
- package/out/zero-cache/src/services/change-source/protocol/current/control.d.ts +1 -1
- package/out/zero-cache/src/services/change-source/protocol/current/control.js +1 -1
- package/out/zero-cache/src/services/change-source/protocol/current/data.d.ts +14 -14
- package/out/zero-cache/src/services/change-source/protocol/current/data.js +3 -3
- package/out/zero-cache/src/services/change-source/protocol/current/downstream.d.ts +16 -16
- package/out/zero-cache/src/services/change-source/protocol/current/downstream.js +4 -4
- package/out/zero-cache/src/services/change-source/protocol/current/mod.d.ts +6 -6
- package/out/zero-cache/src/services/change-source/protocol/current/mod.js +6 -6
- package/out/zero-cache/src/services/change-source/protocol/current/status.d.ts +1 -1
- package/out/zero-cache/src/services/change-source/protocol/current/status.js +1 -1
- package/out/zero-cache/src/services/change-source/protocol/current/upstream.d.ts +1 -1
- package/out/zero-cache/src/services/change-source/protocol/current/upstream.js +2 -2
- package/out/zero-cache/src/services/change-source/protocol/mod.d.ts +1 -1
- package/out/zero-cache/src/services/change-source/protocol/mod.js +1 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts +4 -4
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.js +7 -7
- package/out/zero-cache/src/services/change-streamer/change-streamer-service.d.ts +6 -6
- package/out/zero-cache/src/services/change-streamer/change-streamer-service.js +13 -13
- package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts +10 -10
- package/out/zero-cache/src/services/change-streamer/change-streamer.js +3 -3
- package/out/zero-cache/src/services/change-streamer/forwarder.d.ts +2 -2
- package/out/zero-cache/src/services/change-streamer/forwarder.js +2 -2
- package/out/zero-cache/src/services/change-streamer/schema/init.d.ts +1 -1
- package/out/zero-cache/src/services/change-streamer/schema/init.js +2 -2
- package/out/zero-cache/src/services/change-streamer/schema/tables.d.ts +3 -3
- package/out/zero-cache/src/services/change-streamer/schema/tables.js +2 -2
- package/out/zero-cache/src/services/change-streamer/storer.d.ts +6 -6
- package/out/zero-cache/src/services/change-streamer/storer.js +9 -9
- package/out/zero-cache/src/services/change-streamer/subscriber.d.ts +5 -5
- package/out/zero-cache/src/services/change-streamer/subscriber.js +5 -5
- package/out/zero-cache/src/services/dispatcher/connect-params.d.ts +1 -1
- package/out/zero-cache/src/services/dispatcher/connect-params.js +3 -3
- package/out/zero-cache/src/services/dispatcher/sync-dispatcher.d.ts +2 -2
- package/out/zero-cache/src/services/dispatcher/sync-dispatcher.js +4 -4
- package/out/zero-cache/src/services/dispatcher/websocket-handoff.d.ts +2 -2
- package/out/zero-cache/src/services/dispatcher/websocket-handoff.js +3 -3
- package/out/zero-cache/src/services/http-service.d.ts +1 -1
- package/out/zero-cache/src/services/http-service.js +2 -2
- package/out/zero-cache/src/services/life-cycle.d.ts +2 -2
- package/out/zero-cache/src/services/life-cycle.js +2 -2
- package/out/zero-cache/src/services/limiter/sliding-window-limiter.js +1 -1
- package/out/zero-cache/src/services/litestream/commands.d.ts +1 -1
- package/out/zero-cache/src/services/litestream/commands.js +2 -2
- package/out/zero-cache/src/services/mutagen/mutagen.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 +14 -14
- package/out/zero-cache/src/services/replicator/change-processor.d.ts +23 -0
- package/out/zero-cache/src/services/replicator/change-processor.d.ts.map +1 -0
- package/out/zero-cache/src/services/replicator/change-processor.js +415 -0
- package/out/zero-cache/src/services/replicator/change-processor.js.map +1 -0
- package/out/zero-cache/src/services/replicator/incremental-sync.d.ts +5 -27
- package/out/zero-cache/src/services/replicator/incremental-sync.d.ts.map +1 -1
- package/out/zero-cache/src/services/replicator/incremental-sync.js +9 -421
- package/out/zero-cache/src/services/replicator/incremental-sync.js.map +1 -1
- package/out/zero-cache/src/services/replicator/notifier.d.ts +2 -2
- package/out/zero-cache/src/services/replicator/notifier.js +1 -1
- package/out/zero-cache/src/services/replicator/replicator.d.ts +5 -5
- package/out/zero-cache/src/services/replicator/replicator.js +3 -3
- package/out/zero-cache/src/services/replicator/schema/change-log.d.ts +6 -6
- package/out/zero-cache/src/services/replicator/schema/change-log.js +4 -4
- package/out/zero-cache/src/services/replicator/schema/replication-state.d.ts +3 -3
- package/out/zero-cache/src/services/replicator/schema/replication-state.js +3 -3
- package/out/zero-cache/src/services/runner.d.ts +1 -1
- package/out/zero-cache/src/services/running-state.d.ts +1 -1
- package/out/zero-cache/src/services/running-state.js +2 -2
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts +7 -7
- package/out/zero-cache/src/services/view-syncer/client-handler.js +9 -9
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts +6 -6
- package/out/zero-cache/src/services/view-syncer/cvr-store.js +17 -17
- package/out/zero-cache/src/services/view-syncer/cvr.d.ts +6 -6
- package/out/zero-cache/src/services/view-syncer/cvr.js +8 -8
- package/out/zero-cache/src/services/view-syncer/database-storage.d.ts +2 -2
- package/out/zero-cache/src/services/view-syncer/database-storage.js +1 -1
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.js +1 -1
- package/out/zero-cache/src/services/view-syncer/key-columns.d.ts +2 -2
- package/out/zero-cache/src/services/view-syncer/key-columns.js +3 -3
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts +6 -6
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.js +8 -8
- package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts +2 -2
- package/out/zero-cache/src/services/view-syncer/schema/cvr.js +4 -4
- package/out/zero-cache/src/services/view-syncer/schema/init.d.ts +1 -1
- package/out/zero-cache/src/services/view-syncer/schema/init.js +2 -2
- package/out/zero-cache/src/services/view-syncer/schema/types.d.ts +12 -12
- package/out/zero-cache/src/services/view-syncer/schema/types.js +4 -4
- package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts +5 -5
- package/out/zero-cache/src/services/view-syncer/snapshotter.js +12 -12
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +9 -9
- package/out/zero-cache/src/services/view-syncer/view-syncer.js +20 -20
- package/out/zero-cache/src/types/bigint-json.d.ts +1 -1
- package/out/zero-cache/src/types/bigint-json.js +1 -1
- package/out/zero-cache/src/types/error-for-client.d.ts +1 -1
- package/out/zero-cache/src/types/lexi-version.js +2 -2
- package/out/zero-cache/src/types/lite.d.ts +4 -4
- package/out/zero-cache/src/types/lite.js +2 -2
- package/out/zero-cache/src/types/pg.d.ts +3 -3
- package/out/zero-cache/src/types/pg.js +2 -2
- package/out/zero-cache/src/types/row-key.d.ts +1 -1
- package/out/zero-cache/src/types/row-key.js +3 -3
- package/out/zero-cache/src/types/schema-versions.d.ts +1 -1
- package/out/zero-cache/src/types/schema-versions.js +2 -2
- package/out/zero-cache/src/types/streams.d.ts +2 -2
- package/out/zero-cache/src/types/streams.js +4 -4
- package/out/zero-cache/src/types/subscription.d.ts +1 -1
- package/out/zero-cache/src/types/timeout.js +1 -1
- package/out/zero-cache/src/workers/connection.d.ts +5 -5
- package/out/zero-cache/src/workers/connection.js +9 -9
- package/out/zero-cache/src/workers/replicator.d.ts +5 -5
- package/out/zero-cache/src/workers/replicator.js +4 -4
- package/out/zero-cache/src/workers/syncer.d.ts +8 -8
- package/out/zero-cache/src/workers/syncer.js +10 -10
- package/out/zero-client/src/client/context.d.ts +6 -6
- package/out/zero-client/src/client/crud.d.ts +6 -6
- package/out/zero-client/src/client/crud.d.ts.map +1 -1
- package/out/zero-client/src/client/keys.d.ts +2 -2
- package/out/zero-client/src/client/log-options.d.ts +2 -2
- package/out/zero-client/src/client/log-options.d.ts.map +1 -1
- package/out/zero-client/src/client/metrics.d.ts +2 -2
- package/out/zero-client/src/client/options.d.ts +3 -3
- package/out/zero-client/src/client/query-manager.d.ts +6 -6
- package/out/zero-client/src/client/reload-error-handler.d.ts +1 -1
- package/out/zero-client/src/client/replicache-types.d.ts +1 -1
- package/out/zero-client/src/client/server-error.d.ts +2 -2
- package/out/zero-client/src/client/server-option.d.ts +1 -1
- package/out/zero-client/src/client/zero-poke-handler.d.ts +4 -4
- package/out/zero-client/src/client/zero-poke-handler.d.ts.map +1 -1
- package/out/zero-client/src/client/zero.d.ts +12 -12
- package/out/zero-client/src/mod.d.ts +17 -17
- package/out/zero-client/src/mod.d.ts.map +1 -1
- package/out/zero-client/src/util/socket.d.ts +1 -1
- package/out/zero-protocol/src/ast-hash.d.ts +1 -1
- package/out/zero-protocol/src/ast-hash.js +2 -2
- package/out/zero-protocol/src/ast.d.ts +2 -2
- package/out/zero-protocol/src/ast.js +5 -5
- package/out/zero-protocol/src/change-desired-queries.d.ts +3 -3
- package/out/zero-protocol/src/change-desired-queries.js +2 -2
- package/out/zero-protocol/src/clients-patch.d.ts +1 -1
- package/out/zero-protocol/src/clients-patch.js +1 -1
- package/out/zero-protocol/src/connect.d.ts +3 -3
- package/out/zero-protocol/src/connect.js +2 -2
- package/out/zero-protocol/src/data.d.ts +3 -3
- package/out/zero-protocol/src/data.js +2 -2
- package/out/zero-protocol/src/delete-clients.d.ts +1 -1
- package/out/zero-protocol/src/delete-clients.js +1 -1
- package/out/zero-protocol/src/down.d.ts +6 -6
- package/out/zero-protocol/src/down.js +7 -7
- package/out/zero-protocol/src/error.d.ts +1 -1
- package/out/zero-protocol/src/error.js +2 -2
- package/out/zero-protocol/src/mod.d.ts +14 -14
- package/out/zero-protocol/src/mod.js +14 -14
- package/out/zero-protocol/src/ping.d.ts +1 -1
- package/out/zero-protocol/src/ping.js +1 -1
- package/out/zero-protocol/src/poke.d.ts +9 -9
- package/out/zero-protocol/src/poke.js +5 -5
- package/out/zero-protocol/src/pong.d.ts +1 -1
- package/out/zero-protocol/src/pong.js +1 -1
- package/out/zero-protocol/src/primary-key.d.ts +1 -1
- package/out/zero-protocol/src/primary-key.js +1 -1
- package/out/zero-protocol/src/protocol-version.js +1 -1
- package/out/zero-protocol/src/pull.d.ts +1 -1
- package/out/zero-protocol/src/pull.js +2 -2
- package/out/zero-protocol/src/push.d.ts +26 -26
- package/out/zero-protocol/src/push.js +5 -5
- package/out/zero-protocol/src/queries-patch.d.ts +4 -4
- package/out/zero-protocol/src/queries-patch.js +2 -2
- package/out/zero-protocol/src/row-patch.d.ts +5 -5
- package/out/zero-protocol/src/row-patch.js +4 -4
- package/out/zero-protocol/src/up.d.ts +7 -7
- package/out/zero-protocol/src/up.js +7 -7
- package/out/zero-protocol/src/up.js.map +1 -1
- package/out/zero-protocol/src/version.d.ts +1 -1
- package/out/zero-protocol/src/version.js +1 -1
- package/out/zero-protocol/src/warm.d.ts +1 -1
- package/out/zero-protocol/src/warm.js +1 -1
- package/out/zero-react/src/mod.d.ts +8 -8
- package/out/zero-react/src/use-query.d.ts +4 -4
- package/out/zero-react/src/use-zero.d.ts +2 -2
- package/out/zero-schema/src/build-schema-options.d.ts +1 -1
- package/out/zero-schema/src/build-schema-options.js +1 -1
- package/out/zero-schema/src/build-schema.js +5 -5
- package/out/zero-schema/src/build-schema.js.map +1 -1
- package/out/zero-schema/src/builder/relationship-builder.d.ts +2 -2
- package/out/zero-schema/src/builder/schema-builder.d.ts +3 -3
- package/out/zero-schema/src/builder/schema-builder.js +1 -1
- package/out/zero-schema/src/builder/table-builder.d.ts +3 -3
- package/out/zero-schema/src/compiled-permissions.d.ts +18 -18
- package/out/zero-schema/src/compiled-permissions.js +2 -2
- package/out/zero-schema/src/mod.d.ts +4 -4
- package/out/zero-schema/src/mod.d.ts.map +1 -1
- package/out/zero-schema/src/permissions.d.ts +5 -5
- package/out/zero-schema/src/schema-config.d.ts +4 -4
- package/out/zero-schema/src/schema-config.d.ts.map +1 -1
- package/out/zero-schema/src/schema-config.js +4 -4
- package/out/zero-schema/src/schema-config.js.map +1 -1
- package/out/zero-schema/src/table-schema.d.ts +1 -1
- package/out/zero-solid/src/create-zero.d.ts +2 -2
- package/out/zero-solid/src/create-zero.d.ts.map +1 -1
- package/out/zero-solid/src/mod.d.ts +2 -2
- package/out/zero-solid/src/solid-view.d.ts +3 -3
- package/out/zero-solid/src/use-query.d.ts +3 -3
- package/out/zero-solid/src/use-query.d.ts.map +1 -1
- package/out/zero.js +3 -3
- package/out/zql/src/builder/builder.d.ts +7 -7
- package/out/zql/src/builder/builder.js +10 -10
- package/out/zql/src/builder/filter.d.ts +2 -2
- package/out/zql/src/builder/filter.js +2 -2
- package/out/zql/src/builder/like.d.ts +1 -1
- package/out/zql/src/builder/like.js +1 -1
- package/out/zql/src/ivm/array-view.d.ts +4 -4
- package/out/zql/src/ivm/array-view.js +2 -2
- package/out/zql/src/ivm/change.d.ts +2 -2
- package/out/zql/src/ivm/constraint.d.ts +2 -2
- package/out/zql/src/ivm/constraint.js +3 -3
- package/out/zql/src/ivm/data.d.ts +3 -3
- package/out/zql/src/ivm/data.js +1 -1
- package/out/zql/src/ivm/exists.d.ts +6 -6
- package/out/zql/src/ivm/exists.js +7 -7
- package/out/zql/src/ivm/fan-in.d.ts +6 -6
- package/out/zql/src/ivm/fan-in.js +4 -4
- package/out/zql/src/ivm/fan-out.d.ts +5 -5
- package/out/zql/src/ivm/filter-push.d.ts +3 -3
- package/out/zql/src/ivm/filter-push.d.ts.map +1 -1
- package/out/zql/src/ivm/filter-push.js +2 -2
- package/out/zql/src/ivm/filter-push.js.map +1 -1
- package/out/zql/src/ivm/filter.d.ts +5 -5
- package/out/zql/src/ivm/filter.js +2 -2
- package/out/zql/src/ivm/join.d.ts +7 -7
- package/out/zql/src/ivm/join.js +4 -4
- package/out/zql/src/ivm/maybe-split-and-push-edit-change.d.ts +3 -3
- package/out/zql/src/ivm/memory-source.d.ts +11 -11
- package/out/zql/src/ivm/memory-source.js +9 -9
- package/out/zql/src/ivm/memory-storage.d.ts +3 -3
- package/out/zql/src/ivm/operator.d.ts +7 -7
- package/out/zql/src/ivm/operator.js +1 -1
- package/out/zql/src/ivm/schema.d.ts +4 -4
- package/out/zql/src/ivm/skip.d.ts +6 -6
- package/out/zql/src/ivm/skip.js +2 -2
- package/out/zql/src/ivm/source.d.ts +3 -3
- package/out/zql/src/ivm/take.d.ts +6 -6
- package/out/zql/src/ivm/take.js +8 -8
- package/out/zql/src/ivm/view-apply-change.d.ts +3 -3
- package/out/zql/src/ivm/view-apply-change.js +2 -2
- package/out/zql/src/ivm/view.d.ts +4 -4
- package/out/zql/src/query/auth-query.d.ts +7 -7
- package/out/zql/src/query/auth-query.js +2 -2
- package/out/zql/src/query/dnf.d.ts +1 -1
- package/out/zql/src/query/dnf.js +2 -2
- package/out/zql/src/query/expression.d.ts +3 -4
- package/out/zql/src/query/expression.d.ts.map +1 -1
- package/out/zql/src/query/expression.js +2 -2
- 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 +7 -7
- package/out/zql/src/query/query-impl.js.map +1 -1
- package/out/zql/src/query/query-internal.d.ts +4 -4
- package/out/zql/src/query/query.d.ts +7 -10
- package/out/zql/src/query/query.d.ts.map +1 -1
- package/out/zql/src/query/typed-view.d.ts +1 -1
- package/out/zqlite/src/db.js +2 -2
- package/out/zqlite/src/internal/statement-cache.d.ts +1 -1
- package/out/zqlite/src/internal/statement-cache.d.ts.map +1 -1
- package/out/zqlite/src/internal/statement-cache.js +1 -1
- package/out/zqlite/src/internal/statement-cache.js.map +1 -1
- package/out/zqlite/src/table-source.d.ts +6 -6
- package/out/zqlite/src/table-source.js +11 -11
- package/package.json +4 -4
- /package/out/{chunk-F5QR3K72.js.map → chunk-424PT5DM.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LogContext } from '@rocicorp/logger';
|
|
2
|
-
import * as v from '../../../shared/src/valita.
|
|
3
|
-
import type { Database as Db } from '../../../zqlite/src/db.
|
|
2
|
+
import * as v from '../../../shared/src/valita.ts';
|
|
3
|
+
import type { Database as Db } from '../../../zqlite/src/db.ts';
|
|
4
4
|
type Operations = (log: LogContext, tx: Db) => Promise<void> | void;
|
|
5
5
|
/**
|
|
6
6
|
* Encapsulates the logic for setting up or upgrading to a new schema. After the
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { assert } from
|
|
2
|
-
import { randInt } from
|
|
3
|
-
import * as v from
|
|
4
|
-
import { Database } from
|
|
1
|
+
import { assert } from "../../../shared/src/asserts.js";
|
|
2
|
+
import { randInt } from "../../../shared/src/rand.js";
|
|
3
|
+
import * as v from "../../../shared/src/valita.js";
|
|
4
|
+
import { Database } from "../../../zqlite/src/db.js";
|
|
5
5
|
/**
|
|
6
6
|
* Ensures that the schema is compatible with the current code, updating and
|
|
7
7
|
* migrating the schema if necessary.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { LogContext } from '@rocicorp/logger';
|
|
2
2
|
import type postgres from 'postgres';
|
|
3
|
-
import * as v from '../../../shared/src/valita.
|
|
4
|
-
import type { PostgresDB, PostgresTransaction } from '../types/pg.
|
|
3
|
+
import * as v from '../../../shared/src/valita.ts';
|
|
4
|
+
import type { PostgresDB, PostgresTransaction } from '../types/pg.ts';
|
|
5
5
|
type Operations = (log: LogContext, tx: PostgresTransaction) => Promise<void>;
|
|
6
6
|
/**
|
|
7
7
|
* Encapsulates the logic for setting up or upgrading to a new schema. After the
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { assert } from
|
|
2
|
-
import { randInt } from
|
|
3
|
-
import * as v from
|
|
1
|
+
import { assert } from "../../../shared/src/asserts.js";
|
|
2
|
+
import { randInt } from "../../../shared/src/rand.js";
|
|
3
|
+
import * as v from "../../../shared/src/valita.js";
|
|
4
4
|
/**
|
|
5
5
|
* Ensures that the schema is compatible with the current code, updating and
|
|
6
6
|
* migrating the schema if necessary.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LogContext } from '@rocicorp/logger';
|
|
2
|
-
import { type LiteTypeString } from '../types/lite.
|
|
3
|
-
import { type ColumnSpec, type IndexSpec, type LiteIndexSpec, type LiteTableSpec, type TableSpec } from './specs.
|
|
2
|
+
import { type LiteTypeString } from '../types/lite.ts';
|
|
3
|
+
import { type ColumnSpec, type IndexSpec, type LiteIndexSpec, type LiteTableSpec, type TableSpec } from './specs.ts';
|
|
4
4
|
export declare const ZERO_VERSION_COLUMN_SPEC: ColumnSpec;
|
|
5
5
|
export declare function warnIfDataTypeSupported(lc: LogContext, liteTypeString: LiteTypeString, table: string, column: string): void;
|
|
6
6
|
export declare function mapPostgresToLiteColumn(table: string, column: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ZERO_VERSION_COLUMN_NAME } from
|
|
2
|
-
import { dataTypeToZqlValueType, liteTypeString, upstreamDataType, } from
|
|
3
|
-
import { liteTableName } from
|
|
4
|
-
import * as PostgresTypeClass from
|
|
5
|
-
import {} from
|
|
1
|
+
import { ZERO_VERSION_COLUMN_NAME } from "../services/replicator/schema/replication-state.js";
|
|
2
|
+
import { dataTypeToZqlValueType, liteTypeString, upstreamDataType, } from "../types/lite.js";
|
|
3
|
+
import { liteTableName } from "../types/names.js";
|
|
4
|
+
import * as PostgresTypeClass from "./postgres-type-class-enum.js";
|
|
5
|
+
import {} from "./specs.js";
|
|
6
6
|
export const ZERO_VERSION_COLUMN_SPEC = {
|
|
7
7
|
pos: Number.MAX_SAFE_INTEGER, // i.e. last
|
|
8
8
|
characterMaximumLength: null,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { DeepReadonly } from '../../../shared/src/json.
|
|
2
|
-
import * as v from '../../../shared/src/valita.
|
|
3
|
-
import type { PrimaryKey } from '../../../zero-protocol/src/primary-key.
|
|
4
|
-
import type { SchemaValue } from '../../../zero-schema/src/table-schema.
|
|
1
|
+
import type { DeepReadonly } from '../../../shared/src/json.ts';
|
|
2
|
+
import * as v from '../../../shared/src/valita.ts';
|
|
3
|
+
import type { PrimaryKey } from '../../../zero-protocol/src/primary-key.ts';
|
|
4
|
+
import type { SchemaValue } from '../../../zero-schema/src/table-schema.ts';
|
|
5
5
|
export declare const pgTypeClassSchema: v.UnionType<[v.Type<"b">, v.Type<"c">, v.Type<"d">, v.Type<"e">, v.Type<"p">, v.Type<"r">, v.Type<"m">]>;
|
|
6
6
|
export declare const pgReplicaIdentitySchema: v.UnionType<[v.Type<"d">, v.Type<"n">, v.Type<"f">, v.Type<"i">]>;
|
|
7
7
|
export declare const columnSpec: v.ObjectType<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as v from
|
|
2
|
-
import * as PostgresReplicaIdentity from
|
|
3
|
-
import * as PostgresTypeClass from
|
|
1
|
+
import * as v from "../../../shared/src/valita.js";
|
|
2
|
+
import * as PostgresReplicaIdentity from "./postgres-replica-identity-enum.js";
|
|
3
|
+
import * as PostgresTypeClass from "./postgres-type-class-enum.js";
|
|
4
4
|
export const pgTypeClassSchema = v.union(v.literal(PostgresTypeClass.Base), v.literal(PostgresTypeClass.Composite), v.literal(PostgresTypeClass.Domain), v.literal(PostgresTypeClass.Enum), v.literal(PostgresTypeClass.Pseudo), v.literal(PostgresTypeClass.Range), v.literal(PostgresTypeClass.Multirange));
|
|
5
5
|
export const pgReplicaIdentitySchema = v.union(v.literal(PostgresReplicaIdentity.Default), v.literal(PostgresReplicaIdentity.Nothing), v.literal(PostgresReplicaIdentity.Full), v.literal(PostgresReplicaIdentity.Index));
|
|
6
6
|
export const columnSpec = v.object({
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { RunResult } from '@rocicorp/zero-sqlite3';
|
|
2
|
-
import { Database } from '../../../zqlite/src/db.
|
|
3
|
-
import { StatementCache } from '../../../zqlite/src/internal/statement-cache.
|
|
2
|
+
import { Database } from '../../../zqlite/src/db.ts';
|
|
3
|
+
import { StatementCache } from '../../../zqlite/src/internal/statement-cache.ts';
|
|
4
4
|
/**
|
|
5
5
|
* A stateless wrapper around a {@link StatementCache} that facilitates single-line
|
|
6
6
|
* `printf()` style invocations of cached prepared statement operations.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Database } from
|
|
2
|
-
import { StatementCache } from
|
|
1
|
+
import { Database } from "../../../zqlite/src/db.js";
|
|
2
|
+
import { StatementCache } from "../../../zqlite/src/internal/statement-cache.js";
|
|
3
3
|
/**
|
|
4
4
|
* A stateless wrapper around a {@link StatementCache} that facilitates single-line
|
|
5
5
|
* `printf()` style invocations of cached prepared statement operations.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { LogContext } from '@rocicorp/logger';
|
|
2
2
|
import type postgres from 'postgres';
|
|
3
|
-
import type { Enum } from '../../../shared/src/enum.
|
|
4
|
-
import type { PostgresDB, PostgresTransaction } from '../types/pg.
|
|
5
|
-
import * as Mode from './mode-enum.
|
|
3
|
+
import type { Enum } from '../../../shared/src/enum.ts';
|
|
4
|
+
import type { PostgresDB, PostgresTransaction } from '../types/pg.ts';
|
|
5
|
+
import * as Mode from './mode-enum.ts';
|
|
6
6
|
type Mode = Enum<typeof Mode>;
|
|
7
7
|
type MaybePromise<T> = Promise<T> | T;
|
|
8
8
|
export type Statement = postgres.PendingQuery<(postgres.Row & Iterable<postgres.Row>)[]> | postgres.PendingQuery<postgres.Row[]>;
|
|
@@ -59,7 +59,7 @@ export declare class TransactionPool {
|
|
|
59
59
|
* Returns an object that can be used to add more parameters.
|
|
60
60
|
*/
|
|
61
61
|
addLoggingContext(key: string, value: string): {
|
|
62
|
-
addLoggingContext: (key: string, value: string) => any;
|
|
62
|
+
addLoggingContext: (key: string, value: string) => /*elided*/ any;
|
|
63
63
|
};
|
|
64
64
|
/**
|
|
65
65
|
* Returns a promise that:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { resolver } from '@rocicorp/resolver';
|
|
2
|
-
import { assert } from
|
|
3
|
-
import { Queue } from
|
|
4
|
-
import * as Mode from
|
|
2
|
+
import { assert } from "../../../shared/src/asserts.js";
|
|
3
|
+
import { Queue } from "../../../shared/src/queue.js";
|
|
4
|
+
import * as Mode from "./mode-enum.js";
|
|
5
5
|
/**
|
|
6
6
|
* A TransactionPool is a pool of one or more {@link postgres.TransactionSql}
|
|
7
7
|
* objects that participate in processing a dynamic queue of tasks.
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { assert } from
|
|
2
|
-
import { must } from
|
|
3
|
-
import { DatabaseInitError } from
|
|
4
|
-
import { getZeroConfig } from
|
|
5
|
-
import { deleteLiteDB } from
|
|
6
|
-
import { initializeChangeSource } from
|
|
7
|
-
import { ChangeStreamerHttpServer } from
|
|
8
|
-
import { initializeStreamer } from
|
|
9
|
-
import { AutoResetSignal } from
|
|
10
|
-
import { exitAfter, runUntilKilled } from
|
|
11
|
-
import { pgClient } from
|
|
12
|
-
import { parentWorker, singleProcessMode, } from
|
|
13
|
-
import { createLogContext } from
|
|
1
|
+
import { assert } from "../../../shared/src/asserts.js";
|
|
2
|
+
import { must } from "../../../shared/src/must.js";
|
|
3
|
+
import { DatabaseInitError } from "../../../zqlite/src/db.js";
|
|
4
|
+
import { getZeroConfig } from "../config/zero-config.js";
|
|
5
|
+
import { deleteLiteDB } from "../db/delete-lite-db.js";
|
|
6
|
+
import { initializeChangeSource } from "../services/change-source/pg/change-source.js";
|
|
7
|
+
import { ChangeStreamerHttpServer } from "../services/change-streamer/change-streamer-http.js";
|
|
8
|
+
import { initializeStreamer } from "../services/change-streamer/change-streamer-service.js";
|
|
9
|
+
import { AutoResetSignal } from "../services/change-streamer/schema/tables.js";
|
|
10
|
+
import { exitAfter, runUntilKilled } from "../services/life-cycle.js";
|
|
11
|
+
import { pgClient } from "../types/pg.js";
|
|
12
|
+
import { parentWorker, singleProcessMode, } from "../types/processes.js";
|
|
13
|
+
import { createLogContext } from "./logging.js";
|
|
14
14
|
export default async function runWorker(parent, env) {
|
|
15
15
|
const config = getZeroConfig(env);
|
|
16
16
|
const port = config.changeStreamerPort ?? config.port + 1;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LogContext } from '@rocicorp/logger';
|
|
2
|
-
import { type ZeroConfig } from '../config/zero-config.
|
|
2
|
+
import { type ZeroConfig } from '../config/zero-config.ts';
|
|
3
3
|
export declare function createLogContext(config: Pick<ZeroConfig, 'log' | 'tenantID'>, context: {
|
|
4
4
|
worker: string;
|
|
5
5
|
}): LogContext;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { LogContext, consoleLogSink, } from '@rocicorp/logger';
|
|
2
2
|
import { pid } from 'node:process';
|
|
3
|
-
import {} from
|
|
4
|
-
import { stringify } from
|
|
3
|
+
import {} from "../config/zero-config.js";
|
|
4
|
+
import { stringify } from "../types/bigint-json.js";
|
|
5
5
|
function createLogSink(config) {
|
|
6
6
|
return config.format === 'json' ? consoleJsonLogSink : consoleLogSink;
|
|
7
7
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { resolver } from '@rocicorp/resolver';
|
|
2
2
|
import { availableParallelism } from 'node:os';
|
|
3
3
|
import path from 'node:path';
|
|
4
|
-
import { must } from
|
|
5
|
-
import { getZeroConfig } from
|
|
6
|
-
import { getSubscriberContext } from
|
|
7
|
-
import { SyncDispatcher } from
|
|
8
|
-
import { installWebSocketHandoff } from
|
|
9
|
-
import { exitAfter, ProcessManager, runUntilKilled, } from
|
|
10
|
-
import { restoreReplica, startReplicaBackupProcess, } from
|
|
11
|
-
import { initViewSyncerSchema } from
|
|
12
|
-
import { pgClient } from
|
|
13
|
-
import { childWorker, parentWorker, singleProcessMode, } from
|
|
14
|
-
import { orTimeout } from
|
|
15
|
-
import { createNotifierFrom, handleSubscriptionsFrom, subscribeTo, } from
|
|
16
|
-
import { createLogContext } from
|
|
4
|
+
import { must } from "../../../shared/src/must.js";
|
|
5
|
+
import { getZeroConfig } from "../config/zero-config.js";
|
|
6
|
+
import { getSubscriberContext } from "../services/change-streamer/change-streamer-http.js";
|
|
7
|
+
import { SyncDispatcher } from "../services/dispatcher/sync-dispatcher.js";
|
|
8
|
+
import { installWebSocketHandoff } from "../services/dispatcher/websocket-handoff.js";
|
|
9
|
+
import { exitAfter, ProcessManager, runUntilKilled, } from "../services/life-cycle.js";
|
|
10
|
+
import { restoreReplica, startReplicaBackupProcess, } from "../services/litestream/commands.js";
|
|
11
|
+
import { initViewSyncerSchema } from "../services/view-syncer/schema/init.js";
|
|
12
|
+
import { pgClient } from "../types/pg.js";
|
|
13
|
+
import { childWorker, parentWorker, singleProcessMode, } from "../types/processes.js";
|
|
14
|
+
import { orTimeout } from "../types/timeout.js";
|
|
15
|
+
import { createNotifierFrom, handleSubscriptionsFrom, subscribeTo, } from "../workers/replicator.js";
|
|
16
|
+
import { createLogContext } from "./logging.js";
|
|
17
17
|
export default async function runWorker(parent, env) {
|
|
18
18
|
const startMs = Date.now();
|
|
19
19
|
const config = getZeroConfig(env);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Config } from '../../../../shared/src/options.
|
|
2
|
-
import * as v from '../../../../shared/src/valita.
|
|
1
|
+
import { type Config } from '../../../../shared/src/options.ts';
|
|
2
|
+
import * as v from '../../../../shared/src/valita.ts';
|
|
3
3
|
export declare const multiConfigSchema: {
|
|
4
4
|
tenantsJSON: {
|
|
5
5
|
type: v.Optional<string>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { envSchema, parseOptionsAdvanced, } from
|
|
2
|
-
import * as v from
|
|
3
|
-
import { zeroOptions } from
|
|
1
|
+
import { envSchema, parseOptionsAdvanced, } from "../../../../shared/src/options.js";
|
|
2
|
+
import * as v from "../../../../shared/src/valita.js";
|
|
3
|
+
import { zeroOptions } from "../../config/zero-config.js";
|
|
4
4
|
const ENV_VAR_PREFIX = 'ZERO_';
|
|
5
5
|
export const multiConfigSchema = {
|
|
6
6
|
...zeroOptions,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import 'dotenv/config';
|
|
2
|
-
import { type Worker } from '../../types/processes.
|
|
2
|
+
import { type Worker } from '../../types/processes.ts';
|
|
3
3
|
export default function runWorker(parent: Worker | null, env: NodeJS.ProcessEnv): Promise<void>;
|
|
4
4
|
//# sourceMappingURL=main.d.ts.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import 'dotenv/config'; // Imports ENV variables from .env
|
|
2
|
-
import { assert } from
|
|
3
|
-
import { exitAfter, ProcessManager, runUntilKilled, } from
|
|
4
|
-
import { childWorker, parentWorker, singleProcessMode, } from
|
|
5
|
-
import { orTimeout } from
|
|
6
|
-
import { createLogContext } from
|
|
7
|
-
import { getMultiZeroConfig } from
|
|
8
|
-
import { getTaskID } from
|
|
9
|
-
import { TenantDispatcher } from
|
|
2
|
+
import { assert } from "../../../../shared/src/asserts.js";
|
|
3
|
+
import { exitAfter, ProcessManager, runUntilKilled, } from "../../services/life-cycle.js";
|
|
4
|
+
import { childWorker, parentWorker, singleProcessMode, } from "../../types/processes.js";
|
|
5
|
+
import { orTimeout } from "../../types/timeout.js";
|
|
6
|
+
import { createLogContext } from "../logging.js";
|
|
7
|
+
import { getMultiZeroConfig } from "./config.js";
|
|
8
|
+
import { getTaskID } from "./runtime.js";
|
|
9
|
+
import { TenantDispatcher } from "./tenant-dispatcher.js";
|
|
10
10
|
export default async function runWorker(parent, env) {
|
|
11
11
|
const startMs = Date.now();
|
|
12
12
|
const { config, env: baseEnv } = getMultiZeroConfig(env);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { nanoid } from 'nanoid';
|
|
2
|
-
import * as v from
|
|
2
|
+
import * as v from "../../../../shared/src/valita.js";
|
|
3
3
|
// https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint-v4-response.html
|
|
4
4
|
const containerMetadataSchema = v.object({ ['TaskARN']: v.string() });
|
|
5
5
|
export async function getTaskID(lc) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LogContext } from '@rocicorp/logger';
|
|
2
|
-
import { HttpService, type Options } from '../../services/http-service.
|
|
3
|
-
import type { Worker } from '../../types/processes.
|
|
2
|
+
import { HttpService, type Options } from '../../services/http-service.ts';
|
|
3
|
+
import type { Worker } from '../../types/processes.ts';
|
|
4
4
|
type Tenant = {
|
|
5
5
|
id: string;
|
|
6
6
|
host?: string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { installWebSocketHandoff } from
|
|
2
|
-
import { HttpService } from
|
|
1
|
+
import { installWebSocketHandoff } from "../../services/dispatcher/websocket-handoff.js";
|
|
2
|
+
import { HttpService } from "../../services/http-service.js";
|
|
3
3
|
export class TenantDispatcher extends HttpService {
|
|
4
4
|
id = 'tenant-dispatcher';
|
|
5
5
|
#tenants;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { pid } from 'node:process';
|
|
2
|
-
import { assert } from
|
|
3
|
-
import { must } from
|
|
4
|
-
import * as v from
|
|
5
|
-
import { getZeroConfig } from
|
|
6
|
-
import { ChangeStreamerHttpClient } from
|
|
7
|
-
import { exitAfter, runUntilKilled } from
|
|
8
|
-
import { ReplicatorService, } from
|
|
9
|
-
import { parentWorker, singleProcessMode, } from
|
|
10
|
-
import { replicaFileModeSchema, setUpMessageHandlers, setupReplica, } from
|
|
11
|
-
import { createLogContext } from
|
|
2
|
+
import { assert } from "../../../shared/src/asserts.js";
|
|
3
|
+
import { must } from "../../../shared/src/must.js";
|
|
4
|
+
import * as v from "../../../shared/src/valita.js";
|
|
5
|
+
import { getZeroConfig } from "../config/zero-config.js";
|
|
6
|
+
import { ChangeStreamerHttpClient } from "../services/change-streamer/change-streamer-http.js";
|
|
7
|
+
import { exitAfter, runUntilKilled } from "../services/life-cycle.js";
|
|
8
|
+
import { ReplicatorService, } from "../services/replicator/replicator.js";
|
|
9
|
+
import { parentWorker, singleProcessMode, } from "../types/processes.js";
|
|
10
|
+
import { replicaFileModeSchema, setUpMessageHandlers, setupReplica, } from "../workers/replicator.js";
|
|
11
|
+
import { createLogContext } from "./logging.js";
|
|
12
12
|
export default async function runWorker(parent, env, ...args) {
|
|
13
13
|
assert(args.length > 0, `replicator mode not specified`);
|
|
14
14
|
const fileMode = v.parse(args[0], replicaFileModeSchema);
|
|
@@ -5,27 +5,27 @@ import { ATTR_SERVICE_NAME, ATTR_SERVICE_VERSION, } from '@opentelemetry/semanti
|
|
|
5
5
|
import { tmpdir } from 'node:os';
|
|
6
6
|
import path from 'node:path';
|
|
7
7
|
import { pid } from 'node:process';
|
|
8
|
-
import { NoopSpanExporter } from
|
|
9
|
-
import { version } from
|
|
10
|
-
import { assert } from
|
|
11
|
-
import { must } from
|
|
12
|
-
import { randInt } from
|
|
13
|
-
import * as v from
|
|
14
|
-
import { getSchema } from
|
|
15
|
-
import { getZeroConfig } from
|
|
16
|
-
import { exitAfter, runUntilKilled } from
|
|
17
|
-
import { MutagenService } from
|
|
18
|
-
import { DatabaseStorage } from
|
|
19
|
-
import { DrainCoordinator } from
|
|
20
|
-
import { PipelineDriver } from
|
|
21
|
-
import { Snapshotter } from
|
|
22
|
-
import { ViewSyncerService } from
|
|
23
|
-
import { pgClient } from
|
|
24
|
-
import { parentWorker, singleProcessMode, } from
|
|
25
|
-
import { Subscription } from
|
|
26
|
-
import { replicaFileModeSchema, replicaFileName } from
|
|
27
|
-
import { Syncer } from
|
|
28
|
-
import { createLogContext } from
|
|
8
|
+
import { NoopSpanExporter } from "../../../otel/src/noop-span-exporter.js";
|
|
9
|
+
import { version } from "../../../otel/src/version.js";
|
|
10
|
+
import { assert } from "../../../shared/src/asserts.js";
|
|
11
|
+
import { must } from "../../../shared/src/must.js";
|
|
12
|
+
import { randInt } from "../../../shared/src/rand.js";
|
|
13
|
+
import * as v from "../../../shared/src/valita.js";
|
|
14
|
+
import { getSchema } from "../auth/load-schema.js";
|
|
15
|
+
import { getZeroConfig } from "../config/zero-config.js";
|
|
16
|
+
import { exitAfter, runUntilKilled } from "../services/life-cycle.js";
|
|
17
|
+
import { MutagenService } from "../services/mutagen/mutagen.js";
|
|
18
|
+
import { DatabaseStorage } from "../services/view-syncer/database-storage.js";
|
|
19
|
+
import { DrainCoordinator } from "../services/view-syncer/drain-coordinator.js";
|
|
20
|
+
import { PipelineDriver } from "../services/view-syncer/pipeline-driver.js";
|
|
21
|
+
import { Snapshotter } from "../services/view-syncer/snapshotter.js";
|
|
22
|
+
import { ViewSyncerService } from "../services/view-syncer/view-syncer.js";
|
|
23
|
+
import { pgClient } from "../types/pg.js";
|
|
24
|
+
import { parentWorker, singleProcessMode, } from "../types/processes.js";
|
|
25
|
+
import { Subscription } from "../types/subscription.js";
|
|
26
|
+
import { replicaFileModeSchema, replicaFileName } from "../workers/replicator.js";
|
|
27
|
+
import { Syncer } from "../workers/syncer.js";
|
|
28
|
+
import { createLogContext } from "./logging.js";
|
|
29
29
|
function randomID() {
|
|
30
30
|
return randInt(1, Number.MAX_SAFE_INTEGER).toString(36);
|
|
31
31
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { LogContext } from '@rocicorp/logger';
|
|
2
2
|
import { LogicalReplicationService } from 'pg-logical-replication';
|
|
3
|
-
import type { MessageRelation } from 'pg-logical-replication/dist/output-plugins/pgoutput/pgoutput.types.
|
|
4
|
-
import type { PublishedTableSpec } from '../../../db/specs.
|
|
5
|
-
import { type LexiVersion } from '../../../types/lexi-version.
|
|
6
|
-
import type { ChangeSource } from '../../change-streamer/change-streamer-service.
|
|
7
|
-
import { type ReplicationConfig } from '../../change-streamer/schema/tables.
|
|
8
|
-
import { type InitialSyncOptions } from './initial-sync.
|
|
9
|
-
import { type PublishedSchema } from './schema/published.
|
|
10
|
-
import type { ShardConfig } from './shard-config.
|
|
3
|
+
import type { MessageRelation } from 'pg-logical-replication/dist/output-plugins/pgoutput/pgoutput.types.ts';
|
|
4
|
+
import type { PublishedTableSpec } from '../../../db/specs.ts';
|
|
5
|
+
import { type LexiVersion } from '../../../types/lexi-version.ts';
|
|
6
|
+
import type { ChangeSource } from '../../change-streamer/change-streamer-service.ts';
|
|
7
|
+
import { type ReplicationConfig } from '../../change-streamer/schema/tables.ts';
|
|
8
|
+
import { type InitialSyncOptions } from './initial-sync.ts';
|
|
9
|
+
import { type PublishedSchema } from './schema/published.ts';
|
|
10
|
+
import type { ShardConfig } from './shard-config.ts';
|
|
11
11
|
/**
|
|
12
12
|
* Initializes a Postgres change source, including the initial sync of the
|
|
13
13
|
* replica, before streaming changes from the corresponding logical replication
|
|
@@ -4,30 +4,30 @@ import { LogContext } from '@rocicorp/logger';
|
|
|
4
4
|
import { resolver } from '@rocicorp/resolver';
|
|
5
5
|
import { LogicalReplicationService, Pgoutput, PgoutputPlugin, } from 'pg-logical-replication';
|
|
6
6
|
import { DatabaseError } from 'pg-protocol';
|
|
7
|
-
import { AbortError } from
|
|
8
|
-
import { assert } from
|
|
9
|
-
import { deepEqual } from
|
|
10
|
-
import { must } from
|
|
11
|
-
import { intersection, symmetricDifferences, } from
|
|
12
|
-
import { sleep } from
|
|
13
|
-
import * as v from
|
|
14
|
-
import { Database } from
|
|
15
|
-
import { ShortLivedClient } from
|
|
16
|
-
import { StatementRunner } from
|
|
17
|
-
import { stringify } from
|
|
18
|
-
import { oneAfter } from
|
|
19
|
-
import { pgClient, registerPostgresTypeParsers, } from
|
|
20
|
-
import { Subscription } from
|
|
21
|
-
import { AutoResetSignal, } from
|
|
22
|
-
import { getSubscriptionState } from
|
|
23
|
-
import { replicationSlot } from
|
|
24
|
-
import { fromLexiVersion, toLexiVersion } from
|
|
25
|
-
import { replicationEventSchema } from
|
|
26
|
-
import { updateShardSchema } from
|
|
27
|
-
import { getPublicationInfo } from
|
|
28
|
-
import { getInternalShardConfig, INTERNAL_PUBLICATION_PREFIX, replicaIdentitiesForTablesWithoutPrimaryKeys, } from
|
|
29
|
-
import { validate } from
|
|
30
|
-
import { initSyncSchema } from
|
|
7
|
+
import { AbortError } from "../../../../../shared/src/abort-error.js";
|
|
8
|
+
import { assert } from "../../../../../shared/src/asserts.js";
|
|
9
|
+
import { deepEqual } from "../../../../../shared/src/json.js";
|
|
10
|
+
import { must } from "../../../../../shared/src/must.js";
|
|
11
|
+
import { intersection, symmetricDifferences, } from "../../../../../shared/src/set-utils.js";
|
|
12
|
+
import { sleep } from "../../../../../shared/src/sleep.js";
|
|
13
|
+
import * as v from "../../../../../shared/src/valita.js";
|
|
14
|
+
import { Database } from "../../../../../zqlite/src/db.js";
|
|
15
|
+
import { ShortLivedClient } from "../../../db/short-lived-client.js";
|
|
16
|
+
import { StatementRunner } from "../../../db/statements.js";
|
|
17
|
+
import { stringify } from "../../../types/bigint-json.js";
|
|
18
|
+
import { oneAfter } from "../../../types/lexi-version.js";
|
|
19
|
+
import { pgClient, registerPostgresTypeParsers, } from "../../../types/pg.js";
|
|
20
|
+
import { Subscription } from "../../../types/subscription.js";
|
|
21
|
+
import { AutoResetSignal, } from "../../change-streamer/schema/tables.js";
|
|
22
|
+
import { getSubscriptionState } from "../../replicator/schema/replication-state.js";
|
|
23
|
+
import { replicationSlot } from "./initial-sync.js";
|
|
24
|
+
import { fromLexiVersion, toLexiVersion } from "./lsn.js";
|
|
25
|
+
import { replicationEventSchema } from "./schema/ddl.js";
|
|
26
|
+
import { updateShardSchema } from "./schema/init.js";
|
|
27
|
+
import { getPublicationInfo } from "./schema/published.js";
|
|
28
|
+
import { getInternalShardConfig, INTERNAL_PUBLICATION_PREFIX, replicaIdentitiesForTablesWithoutPrimaryKeys, } from "./schema/shard.js";
|
|
29
|
+
import { validate } from "./schema/validation.js";
|
|
30
|
+
import { initSyncSchema } from "./sync-schema.js";
|
|
31
31
|
// BigInt support from LogicalReplicationService.
|
|
32
32
|
registerPostgresTypeParsers();
|
|
33
33
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { LogContext } from '@rocicorp/logger';
|
|
2
|
-
import { Database } from '../../../../../zqlite/src/db.
|
|
3
|
-
import type { ShardConfig } from './shard-config.
|
|
2
|
+
import { Database } from '../../../../../zqlite/src/db.ts';
|
|
3
|
+
import type { ShardConfig } from './shard-config.ts';
|
|
4
4
|
export type InitialSyncOptions = {
|
|
5
5
|
tableCopyWorkers: number;
|
|
6
6
|
rowBatchSize: number;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { PG_INSUFFICIENT_PRIVILEGE } from '@drdgvhbh/postgres-error-codes';
|
|
2
2
|
import postgres from 'postgres';
|
|
3
|
-
import { Database } from
|
|
4
|
-
import { createIndexStatement, createTableStatement, } from
|
|
5
|
-
import * as Mode from
|
|
6
|
-
import { mapPostgresToLite, mapPostgresToLiteIndex, } from
|
|
7
|
-
import { importSnapshot, TransactionPool } from
|
|
8
|
-
import { liteValues } from
|
|
9
|
-
import { liteTableName } from
|
|
10
|
-
import { pgClient } from
|
|
11
|
-
import { id } from
|
|
12
|
-
import { initChangeLog } from
|
|
13
|
-
import { initReplicationState, ZERO_VERSION_COLUMN_NAME, } from
|
|
14
|
-
import { toLexiVersion } from
|
|
15
|
-
import { initShardSchema } from
|
|
16
|
-
import { getPublicationInfo } from
|
|
17
|
-
import { getInternalShardConfig, setInitialSchema, validatePublications, } from
|
|
3
|
+
import { Database } from "../../../../../zqlite/src/db.js";
|
|
4
|
+
import { createIndexStatement, createTableStatement, } from "../../../db/create.js";
|
|
5
|
+
import * as Mode from "../../../db/mode-enum.js";
|
|
6
|
+
import { mapPostgresToLite, mapPostgresToLiteIndex, } from "../../../db/pg-to-lite.js";
|
|
7
|
+
import { importSnapshot, TransactionPool } from "../../../db/transaction-pool.js";
|
|
8
|
+
import { liteValues } from "../../../types/lite.js";
|
|
9
|
+
import { liteTableName } from "../../../types/names.js";
|
|
10
|
+
import { pgClient } from "../../../types/pg.js";
|
|
11
|
+
import { id } from "../../../types/sql.js";
|
|
12
|
+
import { initChangeLog } from "../../replicator/schema/change-log.js";
|
|
13
|
+
import { initReplicationState, ZERO_VERSION_COLUMN_NAME, } from "../../replicator/schema/replication-state.js";
|
|
14
|
+
import { toLexiVersion } from "./lsn.js";
|
|
15
|
+
import { initShardSchema } from "./schema/init.js";
|
|
16
|
+
import { getPublicationInfo } from "./schema/published.js";
|
|
17
|
+
import { getInternalShardConfig, setInitialSchema, validatePublications, } from "./schema/shard.js";
|
|
18
18
|
// https://www.postgresql.org/docs/current/warm-standby.html#STREAMING-REPLICATION-SLOTS-MANIPULATION
|
|
19
19
|
const ALLOWED_SHARD_ID_CHARACTERS = /^[a-z0-9_]+$/;
|
|
20
20
|
export function replicationSlot(shardID) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type LexiVersion } from '../../../types/lexi-version.
|
|
2
|
-
import type { Change } from '../protocol/current/data.
|
|
1
|
+
import { type LexiVersion } from '../../../types/lexi-version.ts';
|
|
2
|
+
import type { Change } from '../protocol/current/data.ts';
|
|
3
3
|
/**
|
|
4
4
|
* Parsing and conversion utilities for the pg_lsn Type, which represents
|
|
5
5
|
* the "Log Sequence Number" used as a monotonic progress marker for logical
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assert } from
|
|
2
|
-
import { versionFromLexi, versionToLexi, } from
|
|
1
|
+
import { assert } from "../../../../../shared/src/asserts.js";
|
|
2
|
+
import { versionFromLexi, versionToLexi, } from "../../../types/lexi-version.js";
|
|
3
3
|
export function toLexiVersion(lsn) {
|
|
4
4
|
const parts = lsn.split('/');
|
|
5
5
|
assert(parts.length === 2, `Malformed LSN: "${lsn}"`);
|