@rocicorp/zero 1.12.0-canary.6 → 1.12.0-canary.7
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/zero/package.js +10 -10
- package/out/zero/package.js.map +1 -1
- package/out/zero-cache/src/auth/write-authorizer.js +9 -2
- package/out/zero-cache/src/auth/write-authorizer.js.map +1 -1
- package/out/zero-cache/src/server/change-streamer.js +1 -0
- package/out/zero-cache/src/server/change-streamer.js.map +1 -1
- package/out/zero-cache/src/services/change-source/common/replica-restore.js.map +1 -1
- package/out/zero-cache/src/services/change-source/pg/change-source-init.js +17 -9
- package/out/zero-cache/src/services/change-source/pg/change-source-init.js.map +1 -1
- package/out/zero-cache/src/services/change-streamer/server-start-metrics.js +1 -1
- package/out/zero-cache/src/services/change-streamer/server-start-metrics.js.map +1 -1
- package/out/zero-cache/src/services/mutagen/mutagen.js +1 -2
- package/out/zero-cache/src/services/mutagen/mutagen.js.map +1 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.js +19 -2
- package/out/zero-cache/src/services/view-syncer/view-syncer.js.map +1 -1
- package/out/zero-client/src/client/version.js +1 -1
- package/out/zero-protocol/src/inspect-down.d.ts +81 -81
- package/out/zero-protocol/src/up.d.ts +60 -60
- package/package.json +10 -10
- package/out/shared/src/cache.d.ts +0 -22
- package/out/shared/src/cache.d.ts.map +0 -1
- package/out/shared/src/custom-key-map.d.ts +0 -26
- package/out/shared/src/custom-key-map.d.ts.map +0 -1
- package/out/shared/src/custom-key-set.d.ts +0 -25
- package/out/shared/src/custom-key-set.d.ts.map +0 -1
- package/out/shared/src/logging-test-utils.d.ts +0 -12
- package/out/shared/src/logging-test-utils.d.ts.map +0 -1
- package/out/shared/src/queue.d.ts +0 -53
- package/out/shared/src/queue.d.ts.map +0 -1
- package/out/shared/src/ring-buffer.d.ts +0 -42
- package/out/shared/src/ring-buffer.d.ts.map +0 -1
- package/out/shared/src/sorted-entries.d.ts +0 -2
- package/out/shared/src/sorted-entries.d.ts.map +0 -1
- package/out/zero/src/server/change-streamer.d.ts +0 -2
- package/out/zero/src/server/change-streamer.d.ts.map +0 -1
- package/out/zero/src/server/main.d.ts +0 -2
- package/out/zero/src/server/main.d.ts.map +0 -1
- package/out/zero/src/server/reaper.d.ts +0 -2
- package/out/zero/src/server/reaper.d.ts.map +0 -1
- package/out/zero/src/server/replicator.d.ts +0 -2
- package/out/zero/src/server/replicator.d.ts.map +0 -1
- package/out/zero/src/server/syncer.d.ts +0 -2
- package/out/zero/src/server/syncer.d.ts.map +0 -1
- package/out/zero-cache/src/auth/jwt.d.ts +0 -12
- package/out/zero-cache/src/auth/jwt.d.ts.map +0 -1
- package/out/zero-cache/src/auth/load-permissions.d.ts +0 -17
- package/out/zero-cache/src/auth/load-permissions.d.ts.map +0 -1
- package/out/zero-cache/src/auth/write-authorizer.d.ts +0 -28
- package/out/zero-cache/src/auth/write-authorizer.d.ts.map +0 -1
- package/out/zero-cache/src/config/server-context.d.ts +0 -16
- package/out/zero-cache/src/config/server-context.d.ts.map +0 -1
- package/out/zero-cache/src/custom/fetch.d.ts +0 -38
- package/out/zero-cache/src/custom/fetch.d.ts.map +0 -1
- package/out/zero-cache/src/custom/metrics.d.ts +0 -31
- package/out/zero-cache/src/custom/metrics.d.ts.map +0 -1
- package/out/zero-cache/src/custom-queries/transform-query.d.ts +0 -68
- package/out/zero-cache/src/custom-queries/transform-query.d.ts.map +0 -1
- package/out/zero-cache/src/db/create.d.ts +0 -12
- package/out/zero-cache/src/db/create.d.ts.map +0 -1
- package/out/zero-cache/src/db/delete-lite-db.d.ts +0 -2
- package/out/zero-cache/src/db/delete-lite-db.d.ts.map +0 -1
- package/out/zero-cache/src/db/index-predicate.d.ts +0 -4
- package/out/zero-cache/src/db/index-predicate.d.ts.map +0 -1
- package/out/zero-cache/src/db/migration-lite.d.ts +0 -78
- package/out/zero-cache/src/db/migration-lite.d.ts.map +0 -1
- package/out/zero-cache/src/db/migration.d.ts +0 -80
- package/out/zero-cache/src/db/migration.d.ts.map +0 -1
- package/out/zero-cache/src/db/pg-copy-binary.d.ts +0 -101
- package/out/zero-cache/src/db/pg-copy-binary.d.ts.map +0 -1
- package/out/zero-cache/src/db/pg-copy.d.ts +0 -30
- package/out/zero-cache/src/db/pg-copy.d.ts.map +0 -1
- package/out/zero-cache/src/db/pg-type-parser.d.ts +0 -15
- package/out/zero-cache/src/db/pg-type-parser.d.ts.map +0 -1
- package/out/zero-cache/src/db/transaction-pool.d.ts +0 -205
- package/out/zero-cache/src/db/transaction-pool.d.ts.map +0 -1
- package/out/zero-cache/src/db/warmup.d.ts +0 -4
- package/out/zero-cache/src/db/warmup.d.ts.map +0 -1
- package/out/zero-cache/src/observability/events.d.ts +0 -15
- package/out/zero-cache/src/observability/events.d.ts.map +0 -1
- package/out/zero-cache/src/observability/log-throttle.d.ts +0 -44
- package/out/zero-cache/src/observability/log-throttle.d.ts.map +0 -1
- package/out/zero-cache/src/server/anonymous-otel-start.d.ts +0 -21
- package/out/zero-cache/src/server/anonymous-otel-start.d.ts.map +0 -1
- package/out/zero-cache/src/server/change-streamer.d.ts +0 -3
- package/out/zero-cache/src/server/change-streamer.d.ts.map +0 -1
- package/out/zero-cache/src/server/inspector-delegate.d.ts +0 -71
- package/out/zero-cache/src/server/inspector-delegate.d.ts.map +0 -1
- package/out/zero-cache/src/server/main.d.ts +0 -3
- package/out/zero-cache/src/server/main.d.ts.map +0 -1
- package/out/zero-cache/src/server/otel-diag-logger.d.ts +0 -16
- package/out/zero-cache/src/server/otel-diag-logger.d.ts.map +0 -1
- package/out/zero-cache/src/server/otel-start.d.ts +0 -3
- package/out/zero-cache/src/server/otel-start.d.ts.map +0 -1
- package/out/zero-cache/src/server/priority-op.d.ts +0 -8
- package/out/zero-cache/src/server/priority-op.d.ts.map +0 -1
- package/out/zero-cache/src/server/reaper.d.ts +0 -3
- package/out/zero-cache/src/server/reaper.d.ts.map +0 -1
- package/out/zero-cache/src/server/replicator.d.ts +0 -10
- package/out/zero-cache/src/server/replicator.d.ts.map +0 -1
- package/out/zero-cache/src/server/slot-keeper.d.ts +0 -26
- package/out/zero-cache/src/server/slot-keeper.d.ts.map +0 -1
- package/out/zero-cache/src/server/syncer-assigner.d.ts +0 -14
- package/out/zero-cache/src/server/syncer-assigner.d.ts.map +0 -1
- package/out/zero-cache/src/server/syncer.d.ts +0 -3
- package/out/zero-cache/src/server/syncer.d.ts.map +0 -1
- package/out/zero-cache/src/server/worker-dispatcher.d.ts +0 -17
- package/out/zero-cache/src/server/worker-dispatcher.d.ts.map +0 -1
- package/out/zero-cache/src/services/analyze.d.ts +0 -9
- package/out/zero-cache/src/services/analyze.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/change-source.d.ts +0 -39
- package/out/zero-cache/src/services/change-source/change-source.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/common/backfill-manager.d.ts +0 -57
- package/out/zero-cache/src/services/change-source/common/backfill-manager.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/common/change-stream-multiplexer.d.ts +0 -55
- package/out/zero-cache/src/services/change-source/common/change-stream-multiplexer.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/common/init-cleanup.d.ts +0 -24
- package/out/zero-cache/src/services/change-source/common/init-cleanup.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/common/replica-restore.d.ts +0 -140
- package/out/zero-cache/src/services/change-source/common/replica-restore.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/common/replica-schema.d.ts +0 -14
- package/out/zero-cache/src/services/change-source/common/replica-schema.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/custom/change-source.d.ts +0 -25
- package/out/zero-cache/src/services/change-source/custom/change-source.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/backfill-metadata.d.ts +0 -14
- package/out/zero-cache/src/services/change-source/pg/backfill-metadata.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/backfill-stream.d.ts +0 -36
- package/out/zero-cache/src/services/change-source/pg/backfill-stream.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/change-source-init.d.ts +0 -72
- package/out/zero-cache/src/services/change-source/pg/change-source-init.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/change-source.d.ts +0 -127
- package/out/zero-cache/src/services/change-source/pg/change-source.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/fork-request.d.ts +0 -57
- package/out/zero-cache/src/services/change-source/pg/fork-request.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts +0 -155
- package/out/zero-cache/src/services/change-source/pg/initial-sync.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts +0 -17
- package/out/zero-cache/src/services/change-source/pg/logical-replication/binary-reader.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput-parser.d.ts +0 -28
- package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput-parser.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput.types.d.ts +0 -76
- package/out/zero-cache/src/services/change-source/pg/logical-replication/pgoutput.types.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.d.ts +0 -169
- package/out/zero-cache/src/services/change-source/pg/logical-replication/stream.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.d.ts +0 -16
- package/out/zero-cache/src/services/change-source/pg/replication-slot-cleanup-monitor.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/replication-slot-health.d.ts +0 -15
- package/out/zero-cache/src/services/change-source/pg/replication-slot-health.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/replication-slots.d.ts +0 -127
- package/out/zero-cache/src/services/change-source/pg/replication-slots.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts +0 -9
- package/out/zero-cache/src/services/change-source/pg/schema/init.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-source/protocol/backfill-progress.d.ts +0 -68
- package/out/zero-cache/src/services/change-source/protocol/backfill-progress.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/backfill-state-tracker.d.ts +0 -72
- package/out/zero-cache/src/services/change-streamer/backfill-state-tracker.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/backfill-state.d.ts +0 -50
- package/out/zero-cache/src/services/change-streamer/backfill-state.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.d.ts +0 -12
- package/out/zero-cache/src/services/change-streamer/backup-cleanup-monitor-factory.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/backup-monitor.d.ts +0 -57
- package/out/zero-cache/src/services/change-streamer/backup-monitor.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/broadcast.d.ts +0 -98
- package/out/zero-cache/src/services/change-streamer/broadcast.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-log-codec.d.ts +0 -34
- package/out/zero-cache/src/services/change-streamer/change-log-codec.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-log-compare-digest.d.ts +0 -34
- package/out/zero-cache/src/services/change-streamer/change-log-compare-digest.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-log-initializer.d.ts +0 -158
- package/out/zero-cache/src/services/change-streamer/change-log-initializer.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-log-transaction-hash.d.ts +0 -19
- package/out/zero-cache/src/services/change-streamer/change-log-transaction-hash.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts +0 -78
- package/out/zero-cache/src/services/change-streamer/change-streamer-http.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer-service.d.ts +0 -152
- package/out/zero-cache/src/services/change-streamer/change-streamer-service.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts +0 -575
- package/out/zero-cache/src/services/change-streamer/change-streamer.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/drain-tracker.d.ts +0 -24
- package/out/zero-cache/src/services/change-streamer/drain-tracker.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/error-type-enum.d.ts +0 -15
- package/out/zero-cache/src/services/change-streamer/error-type-enum.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/forwarder.d.ts +0 -49
- package/out/zero-cache/src/services/change-streamer/forwarder.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts +0 -80
- package/out/zero-cache/src/services/change-streamer/litestream-sync-requester.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.d.ts +0 -88
- package/out/zero-cache/src/services/change-streamer/litestream3-prometheus-poller.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/replica-poller.d.ts +0 -15
- package/out/zero-cache/src/services/change-streamer/replica-poller.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/restore-admission.d.ts +0 -243
- package/out/zero-cache/src/services/change-streamer/restore-admission.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/schema/init.d.ts +0 -6
- package/out/zero-cache/src/services/change-streamer/schema/init.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/schema/tables.d.ts +0 -152
- package/out/zero-cache/src/services/change-streamer/schema/tables.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/server-start-metrics.d.ts +0 -33
- package/out/zero-cache/src/services/change-streamer/server-start-metrics.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/shard-sampling.d.ts +0 -11
- package/out/zero-cache/src/services/change-streamer/shard-sampling.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/snapshot-message.d.ts +0 -92
- package/out/zero-cache/src/services/change-streamer/snapshot-message.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/snapshot-reservations.d.ts +0 -36
- package/out/zero-cache/src/services/change-streamer/snapshot-reservations.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/snapshot.d.ts +0 -22
- package/out/zero-cache/src/services/change-streamer/snapshot.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-catchup.d.ts +0 -99
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-catchup.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-comparator.d.ts +0 -83
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-comparator.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-purge-scheduler.d.ts +0 -121
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-purge-scheduler.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-read-router.d.ts +0 -73
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-read-router.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-reader.d.ts +0 -62
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-reader.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-writer.d.ts +0 -114
- package/out/zero-cache/src/services/change-streamer/sqlite-change-log-writer.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/storer.d.ts +0 -276
- package/out/zero-cache/src/services/change-streamer/storer.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/subscribe.d.ts +0 -485
- package/out/zero-cache/src/services/change-streamer/subscribe.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/subscriber.d.ts +0 -205
- package/out/zero-cache/src/services/change-streamer/subscriber.d.ts.map +0 -1
- package/out/zero-cache/src/services/change-streamer/upstream-acker.d.ts +0 -52
- package/out/zero-cache/src/services/change-streamer/upstream-acker.d.ts.map +0 -1
- package/out/zero-cache/src/services/limiter/sliding-window-limiter.d.ts +0 -57
- package/out/zero-cache/src/services/limiter/sliding-window-limiter.d.ts.map +0 -1
- package/out/zero-cache/src/services/litestream/commands.d.ts +0 -77
- package/out/zero-cache/src/services/litestream/commands.d.ts.map +0 -1
- package/out/zero-cache/src/services/litestream/litestream-controller.d.ts +0 -78
- package/out/zero-cache/src/services/litestream/litestream-controller.d.ts.map +0 -1
- package/out/zero-cache/src/services/litestream/metrics.d.ts +0 -31
- package/out/zero-cache/src/services/litestream/metrics.d.ts.map +0 -1
- package/out/zero-cache/src/services/litestream/restore-progress.d.ts +0 -24
- package/out/zero-cache/src/services/litestream/restore-progress.d.ts.map +0 -1
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts +0 -40
- package/out/zero-cache/src/services/mutagen/mutagen.d.ts.map +0 -1
- package/out/zero-cache/src/services/mutagen/pusher.d.ts +0 -63
- package/out/zero-cache/src/services/mutagen/pusher.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/change-log-db.d.ts +0 -368
- package/out/zero-cache/src/services/replicator/change-log-db.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/change-log-stream-writer.d.ts +0 -56
- package/out/zero-cache/src/services/replicator/change-log-stream-writer.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/change-processor.d.ts +0 -37
- package/out/zero-cache/src/services/replicator/change-processor.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/drain-handler.d.ts +0 -82
- package/out/zero-cache/src/services/replicator/drain-handler.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/incremental-sync.d.ts +0 -25
- package/out/zero-cache/src/services/replicator/incremental-sync.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/notifier.d.ts +0 -9
- package/out/zero-cache/src/services/replicator/notifier.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/replication-status.d.ts +0 -71
- package/out/zero-cache/src/services/replicator/replication-status.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/replicator.d.ts +0 -86
- package/out/zero-cache/src/services/replicator/replicator.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/reporter/recorder.d.ts +0 -55
- package/out/zero-cache/src/services/replicator/reporter/recorder.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/sqlite-change-log-observability.d.ts +0 -132
- package/out/zero-cache/src/services/replicator/sqlite-change-log-observability.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/sqlite-change-log-purger.d.ts +0 -120
- package/out/zero-cache/src/services/replicator/sqlite-change-log-purger.d.ts.map +0 -1
- package/out/zero-cache/src/services/replicator/write-worker-client.d.ts +0 -111
- package/out/zero-cache/src/services/replicator/write-worker-client.d.ts.map +0 -1
- package/out/zero-cache/src/services/run-ast.d.ts +0 -39
- package/out/zero-cache/src/services/run-ast.d.ts.map +0 -1
- package/out/zero-cache/src/services/runner.d.ts +0 -19
- package/out/zero-cache/src/services/runner.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/active-users-gauge.d.ts +0 -17
- package/out/zero-cache/src/services/view-syncer/active-users-gauge.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/advancement-metrics.d.ts +0 -26
- package/out/zero-cache/src/services/view-syncer/advancement-metrics.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/batch-pacer.d.ts +0 -79
- package/out/zero-cache/src/services/view-syncer/batch-pacer.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts +0 -97
- package/out/zero-cache/src/services/view-syncer/client-handler.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/client-schema.d.ts +0 -18
- package/out/zero-cache/src/services/view-syncer/client-schema.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/connection-context-manager.d.ts +0 -184
- package/out/zero-cache/src/services/view-syncer/connection-context-manager.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts +0 -22
- package/out/zero-cache/src/services/view-syncer/cvr-purger.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts +0 -128
- package/out/zero-cache/src/services/view-syncer/cvr-store.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/cvr.d.ts +0 -294
- package/out/zero-cache/src/services/view-syncer/cvr.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/deferred-writes-budget.d.ts +0 -81
- package/out/zero-cache/src/services/view-syncer/deferred-writes-budget.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts +0 -45
- package/out/zero-cache/src/services/view-syncer/drain-coordinator.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/e2e-serving-lag.d.ts +0 -53
- package/out/zero-cache/src/services/view-syncer/e2e-serving-lag.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/hydration-budget.d.ts +0 -33
- package/out/zero-cache/src/services/view-syncer/hydration-budget.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/hydration-circuit-breaker.d.ts +0 -51
- package/out/zero-cache/src/services/view-syncer/hydration-circuit-breaker.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts +0 -34
- package/out/zero-cache/src/services/view-syncer/inspect-handler.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts +0 -296
- package/out/zero-cache/src/services/view-syncer/pipeline-driver.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/plan-warnings.d.ts +0 -7
- package/out/zero-cache/src/services/view-syncer/plan-warnings.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/push-cost.d.ts +0 -132
- package/out/zero-cache/src/services/view-syncer/push-cost.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/push-cutoff.d.ts +0 -55
- package/out/zero-cache/src/services/view-syncer/push-cutoff.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/query-covering.d.ts +0 -28
- package/out/zero-cache/src/services/view-syncer/query-covering.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/query-shape.d.ts +0 -25
- package/out/zero-cache/src/services/view-syncer/query-shape.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/query-stats.d.ts +0 -89
- package/out/zero-cache/src/services/view-syncer/query-stats.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/row-record-cache.d.ts +0 -90
- package/out/zero-cache/src/services/view-syncer/row-record-cache.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/row-set-signature.d.ts +0 -17
- package/out/zero-cache/src/services/view-syncer/row-set-signature.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts +0 -86
- package/out/zero-cache/src/services/view-syncer/schema/cvr.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/schema/init.d.ts +0 -5
- package/out/zero-cache/src/services/view-syncer/schema/init.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/schema/types.d.ts +0 -563
- package/out/zero-cache/src/services/view-syncer/schema/types.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/snapshot-row-cache.d.ts +0 -95
- package/out/zero-cache/src/services/view-syncer/snapshot-row-cache.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts +0 -420
- package/out/zero-cache/src/services/view-syncer/snapshotter.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/tracer.d.ts +0 -2
- package/out/zero-cache/src/services/view-syncer/tracer.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/ttl-clock.d.ts +0 -10
- package/out/zero-cache/src/services/view-syncer/ttl-clock.d.ts.map +0 -1
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts +0 -133
- package/out/zero-cache/src/services/view-syncer/view-syncer.d.ts.map +0 -1
- package/out/zero-cache/src/types/downstream.d.ts +0 -11
- package/out/zero-cache/src/types/downstream.d.ts.map +0 -1
- package/out/zero-cache/src/types/error-with-level.d.ts +0 -9
- package/out/zero-cache/src/types/error-with-level.d.ts.map +0 -1
- package/out/zero-cache/src/types/pg-patch.d.ts +0 -21
- package/out/zero-cache/src/types/pg-patch.d.ts.map +0 -1
- package/out/zero-cache/src/types/pg-versions.d.ts +0 -3
- package/out/zero-cache/src/types/pg-versions.d.ts.map +0 -1
- package/out/zero-cache/src/types/poke-chunk.d.ts +0 -18
- package/out/zero-cache/src/types/poke-chunk.d.ts.map +0 -1
- package/out/zero-cache/src/types/streams.d.ts +0 -115
- package/out/zero-cache/src/types/streams.d.ts.map +0 -1
- package/out/zero-cache/src/types/subscription.d.ts +0 -197
- package/out/zero-cache/src/types/subscription.d.ts.map +0 -1
- package/out/zero-cache/src/workers/connect-params.d.ts +0 -28
- package/out/zero-cache/src/workers/connect-params.d.ts.map +0 -1
- package/out/zero-cache/src/workers/connection.d.ts +0 -77
- package/out/zero-cache/src/workers/connection.d.ts.map +0 -1
- package/out/zero-cache/src/workers/replicator.d.ts +0 -57
- package/out/zero-cache/src/workers/replicator.d.ts.map +0 -1
- package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts +0 -14
- package/out/zero-cache/src/workers/syncer-ws-message-handler.d.ts.map +0 -1
- package/out/zero-cache/src/workers/syncer.d.ts +0 -67
- package/out/zero-cache/src/workers/syncer.d.ts.map +0 -1
- package/out/zero-events/src/index.d.ts +0 -27
- package/out/zero-events/src/index.d.ts.map +0 -1
- package/out/zero-events/src/json.d.ts +0 -20
- package/out/zero-events/src/json.d.ts.map +0 -1
- package/out/zero-events/src/status.d.ts +0 -144
- package/out/zero-events/src/status.d.ts.map +0 -1
- package/out/zqlite/src/database-storage.d.ts +0 -43
- package/out/zqlite/src/database-storage.d.ts.map +0 -1
- package/out/zqlite/src/explain-queries.d.ts +0 -4
- package/out/zqlite/src/explain-queries.d.ts.map +0 -1
- package/out/zqlite/src/internal/sql-inline.d.ts +0 -13
- package/out/zqlite/src/internal/sql-inline.d.ts.map +0 -1
- package/out/zqlite/src/resolve-scalar-subqueries.d.ts +0 -72
- package/out/zqlite/src/resolve-scalar-subqueries.d.ts.map +0 -1
- package/out/zqlite/src/sqlite-cost-model.d.ts +0 -17
- package/out/zqlite/src/sqlite-cost-model.d.ts.map +0 -1
- package/out/zqlite/src/sqlite-stat-fanout.d.ts +0 -121
- package/out/zqlite/src/sqlite-stat-fanout.d.ts.map +0 -1
|
@@ -1,563 +0,0 @@
|
|
|
1
|
-
import * as v from '../../../../../shared/src/valita.ts';
|
|
2
|
-
import type { QueriesRow } from './cvr.ts';
|
|
3
|
-
export declare const cvrVersionSchema: v.ObjectType<{
|
|
4
|
-
/**
|
|
5
|
-
* The database `stateVersion` with which the rows in the CVR are consistent.
|
|
6
|
-
*/
|
|
7
|
-
stateVersion: v.Type<string>;
|
|
8
|
-
/**
|
|
9
|
-
* `configVersion` is subversion of `stateVersion` that is initially absent for each
|
|
10
|
-
* `stateVersion`, and incremented for configuration changes that affect the contents
|
|
11
|
-
* of the CVR such as:
|
|
12
|
-
*
|
|
13
|
-
* * query set changes
|
|
14
|
-
* * query transformation changes (which may happen for changes
|
|
15
|
-
* in server-side logic or authorization policies)
|
|
16
|
-
*
|
|
17
|
-
* Such configuration changes are always correlated with a change to one or more
|
|
18
|
-
* `/meta/...` records in the CVR, often (but not always) with corresponding
|
|
19
|
-
* patches in `/patches/meta/...`.
|
|
20
|
-
*
|
|
21
|
-
* When the `stateVersion` moves forward, the `minorVersion` is reset to absent.
|
|
22
|
-
* In this manner it behaves like the analogous concept in semantic versioning.
|
|
23
|
-
*/
|
|
24
|
-
configVersion: v.Optional<number>;
|
|
25
|
-
}, undefined>;
|
|
26
|
-
export type CVRVersion = v.Infer<typeof cvrVersionSchema>;
|
|
27
|
-
export declare const EMPTY_CVR_VERSION: CVRVersion;
|
|
28
|
-
export declare function oneAfter(v: NullableCVRVersion): CVRVersion;
|
|
29
|
-
export type NullableCVRVersion = CVRVersion | null;
|
|
30
|
-
export declare function cmpVersions(a: NullableCVRVersion, b: NullableCVRVersion): number;
|
|
31
|
-
export declare function maxVersion(a: CVRVersion, b?: CVRVersion): CVRVersion;
|
|
32
|
-
export declare function versionToCookie(v: CVRVersion): string;
|
|
33
|
-
export declare function versionToNullableCookie(v: NullableCVRVersion): string | null;
|
|
34
|
-
export declare function cookieToVersion(cookie: string | null): NullableCVRVersion;
|
|
35
|
-
export declare const cvrIDSchema: v.ObjectType<{
|
|
36
|
-
id: v.Type<string>;
|
|
37
|
-
}, undefined>;
|
|
38
|
-
export type CvrID = v.Infer<typeof cvrIDSchema>;
|
|
39
|
-
export declare const clientRecordSchema: v.ObjectType<{
|
|
40
|
-
/** The client ID, of which there can be multiple for a client group view. */
|
|
41
|
-
id: v.Type<string>;
|
|
42
|
-
/** The client's desired query IDs. Patch information is stored in the QueryRecord. */
|
|
43
|
-
desiredQueryIDs: v.ArrayType<v.Type<string>>;
|
|
44
|
-
}, undefined>;
|
|
45
|
-
export type ClientRecord = v.Infer<typeof clientRecordSchema>;
|
|
46
|
-
export declare const baseQueryRecordSchema: v.ObjectType<{
|
|
47
|
-
/** The client-specified ID used to identify this query. Typically a hash. */
|
|
48
|
-
id: v.Type<string>;
|
|
49
|
-
/**
|
|
50
|
-
* The hash of the query after server-side transformations, which include:
|
|
51
|
-
*
|
|
52
|
-
* * Normalization (which may differ from what the client does)
|
|
53
|
-
* * Query "expansion" to include primary keys and query-execution-related columns
|
|
54
|
-
* * Authorization transforms
|
|
55
|
-
*
|
|
56
|
-
* Transformations depend on conditions that are independent of the db state version,
|
|
57
|
-
* such as server-side logic and authorization policies. As such, the version of a CVR
|
|
58
|
-
* version may need to be advanced independent of db state changes. This is done
|
|
59
|
-
* via the `minorVersion` counter of the CVRVersion object, which is used to account
|
|
60
|
-
* for both changes to the query set and changes to query transformations (which are
|
|
61
|
-
* effectively remove-old-query + add-new-query).
|
|
62
|
-
*
|
|
63
|
-
* Note that the transformed AST itself is **not** stored, as the result of the previous
|
|
64
|
-
* transformation is not useful in and of itself. If the current transformation results in
|
|
65
|
-
* a different hash than that of the transformation used for the last version of the CVR,
|
|
66
|
-
* it is simply handled by invalidating the existing rows, re-executed the query with
|
|
67
|
-
* the new transformation, and advancing the CVR's `minorVersion` and this query's
|
|
68
|
-
* `transformationVersion`.
|
|
69
|
-
*
|
|
70
|
-
* Note that the transformationHash is only stored when the query has reached the "gotten"
|
|
71
|
-
* state. If the query is in the "desired" but not yet "gotten" state, the field is absent.
|
|
72
|
-
*/
|
|
73
|
-
transformationHash: v.Optional<string>;
|
|
74
|
-
/**
|
|
75
|
-
* The CVR version corresponding to the `transformationHash`. This essentially tracks when
|
|
76
|
-
* this version of the query was effectively added to the CVR (as opposed to the
|
|
77
|
-
* `patchVersion`, which is simply when the client was notified that its query was added
|
|
78
|
-
* to the gotten set). Catchup of clients from old CVR versions require executing all
|
|
79
|
-
* queries with a newer `transformationVersion`.
|
|
80
|
-
*/
|
|
81
|
-
transformationVersion: v.Optional<{
|
|
82
|
-
stateVersion: string;
|
|
83
|
-
configVersion?: number | undefined;
|
|
84
|
-
}>;
|
|
85
|
-
}, undefined>;
|
|
86
|
-
/**
|
|
87
|
-
* Internal queries track rows in the database for internal use, such as the
|
|
88
|
-
* `lastMutationID`s in the `zero.clients` table. They participate in the standard
|
|
89
|
-
* invalidation / update logic for row contents, but not in the desired/got or
|
|
90
|
-
* size-based quota logic for client-requested queries.
|
|
91
|
-
*/
|
|
92
|
-
export declare const internalQueryRecordSchema: v.ObjectType<Omit<{
|
|
93
|
-
/** The client-specified ID used to identify this query. Typically a hash. */
|
|
94
|
-
id: v.Type<string>;
|
|
95
|
-
/**
|
|
96
|
-
* The hash of the query after server-side transformations, which include:
|
|
97
|
-
*
|
|
98
|
-
* * Normalization (which may differ from what the client does)
|
|
99
|
-
* * Query "expansion" to include primary keys and query-execution-related columns
|
|
100
|
-
* * Authorization transforms
|
|
101
|
-
*
|
|
102
|
-
* Transformations depend on conditions that are independent of the db state version,
|
|
103
|
-
* such as server-side logic and authorization policies. As such, the version of a CVR
|
|
104
|
-
* version may need to be advanced independent of db state changes. This is done
|
|
105
|
-
* via the `minorVersion` counter of the CVRVersion object, which is used to account
|
|
106
|
-
* for both changes to the query set and changes to query transformations (which are
|
|
107
|
-
* effectively remove-old-query + add-new-query).
|
|
108
|
-
*
|
|
109
|
-
* Note that the transformed AST itself is **not** stored, as the result of the previous
|
|
110
|
-
* transformation is not useful in and of itself. If the current transformation results in
|
|
111
|
-
* a different hash than that of the transformation used for the last version of the CVR,
|
|
112
|
-
* it is simply handled by invalidating the existing rows, re-executed the query with
|
|
113
|
-
* the new transformation, and advancing the CVR's `minorVersion` and this query's
|
|
114
|
-
* `transformationVersion`.
|
|
115
|
-
*
|
|
116
|
-
* Note that the transformationHash is only stored when the query has reached the "gotten"
|
|
117
|
-
* state. If the query is in the "desired" but not yet "gotten" state, the field is absent.
|
|
118
|
-
*/
|
|
119
|
-
transformationHash: v.Optional<string>;
|
|
120
|
-
/**
|
|
121
|
-
* The CVR version corresponding to the `transformationHash`. This essentially tracks when
|
|
122
|
-
* this version of the query was effectively added to the CVR (as opposed to the
|
|
123
|
-
* `patchVersion`, which is simply when the client was notified that its query was added
|
|
124
|
-
* to the gotten set). Catchup of clients from old CVR versions require executing all
|
|
125
|
-
* queries with a newer `transformationVersion`.
|
|
126
|
-
*/
|
|
127
|
-
transformationVersion: v.Optional<{
|
|
128
|
-
stateVersion: string;
|
|
129
|
-
configVersion?: number | undefined;
|
|
130
|
-
}>;
|
|
131
|
-
}, "ast" | "type"> & {
|
|
132
|
-
type: v.Type<"internal">;
|
|
133
|
-
ast: v.Type<import("../../../../../zero-protocol/src/ast.ts").AST>;
|
|
134
|
-
}, undefined>;
|
|
135
|
-
export type InternalQueryRecord = v.Infer<typeof internalQueryRecordSchema>;
|
|
136
|
-
export declare const clientQueryRecordSchema: v.ObjectType<Omit<Omit<{
|
|
137
|
-
/** The client-specified ID used to identify this query. Typically a hash. */
|
|
138
|
-
id: v.Type<string>;
|
|
139
|
-
/**
|
|
140
|
-
* The hash of the query after server-side transformations, which include:
|
|
141
|
-
*
|
|
142
|
-
* * Normalization (which may differ from what the client does)
|
|
143
|
-
* * Query "expansion" to include primary keys and query-execution-related columns
|
|
144
|
-
* * Authorization transforms
|
|
145
|
-
*
|
|
146
|
-
* Transformations depend on conditions that are independent of the db state version,
|
|
147
|
-
* such as server-side logic and authorization policies. As such, the version of a CVR
|
|
148
|
-
* version may need to be advanced independent of db state changes. This is done
|
|
149
|
-
* via the `minorVersion` counter of the CVRVersion object, which is used to account
|
|
150
|
-
* for both changes to the query set and changes to query transformations (which are
|
|
151
|
-
* effectively remove-old-query + add-new-query).
|
|
152
|
-
*
|
|
153
|
-
* Note that the transformed AST itself is **not** stored, as the result of the previous
|
|
154
|
-
* transformation is not useful in and of itself. If the current transformation results in
|
|
155
|
-
* a different hash than that of the transformation used for the last version of the CVR,
|
|
156
|
-
* it is simply handled by invalidating the existing rows, re-executed the query with
|
|
157
|
-
* the new transformation, and advancing the CVR's `minorVersion` and this query's
|
|
158
|
-
* `transformationVersion`.
|
|
159
|
-
*
|
|
160
|
-
* Note that the transformationHash is only stored when the query has reached the "gotten"
|
|
161
|
-
* state. If the query is in the "desired" but not yet "gotten" state, the field is absent.
|
|
162
|
-
*/
|
|
163
|
-
transformationHash: v.Optional<string>;
|
|
164
|
-
/**
|
|
165
|
-
* The CVR version corresponding to the `transformationHash`. This essentially tracks when
|
|
166
|
-
* this version of the query was effectively added to the CVR (as opposed to the
|
|
167
|
-
* `patchVersion`, which is simply when the client was notified that its query was added
|
|
168
|
-
* to the gotten set). Catchup of clients from old CVR versions require executing all
|
|
169
|
-
* queries with a newer `transformationVersion`.
|
|
170
|
-
*/
|
|
171
|
-
transformationVersion: v.Optional<{
|
|
172
|
-
stateVersion: string;
|
|
173
|
-
configVersion?: number | undefined;
|
|
174
|
-
}>;
|
|
175
|
-
}, "clientState" | "patchVersion"> & {
|
|
176
|
-
/**
|
|
177
|
-
* The client state for this query, which includes the inactivatedAt, ttl and
|
|
178
|
-
* version. The client state is stored in a record with the client ID as the
|
|
179
|
-
* key.
|
|
180
|
-
*/
|
|
181
|
-
clientState: v.Type<Record<string, {
|
|
182
|
-
inactivatedAt?: import("../ttl-clock.ts").TTLClock | undefined;
|
|
183
|
-
ttl: number;
|
|
184
|
-
version: {
|
|
185
|
-
stateVersion: string;
|
|
186
|
-
configVersion?: number | undefined;
|
|
187
|
-
};
|
|
188
|
-
}>>;
|
|
189
|
-
patchVersion: v.Optional<{
|
|
190
|
-
stateVersion: string;
|
|
191
|
-
configVersion?: number | undefined;
|
|
192
|
-
}>;
|
|
193
|
-
}, "ast" | "type"> & {
|
|
194
|
-
type: v.Type<"client">;
|
|
195
|
-
/** The original AST as supplied by the client. */
|
|
196
|
-
ast: v.Type<import("../../../../../zero-protocol/src/ast.ts").AST>;
|
|
197
|
-
}, undefined>;
|
|
198
|
-
export type ClientQueryRecord = v.Infer<typeof clientQueryRecordSchema>;
|
|
199
|
-
export declare const customQueryRecordSchema: v.ObjectType<Omit<Omit<{
|
|
200
|
-
/** The client-specified ID used to identify this query. Typically a hash. */
|
|
201
|
-
id: v.Type<string>;
|
|
202
|
-
/**
|
|
203
|
-
* The hash of the query after server-side transformations, which include:
|
|
204
|
-
*
|
|
205
|
-
* * Normalization (which may differ from what the client does)
|
|
206
|
-
* * Query "expansion" to include primary keys and query-execution-related columns
|
|
207
|
-
* * Authorization transforms
|
|
208
|
-
*
|
|
209
|
-
* Transformations depend on conditions that are independent of the db state version,
|
|
210
|
-
* such as server-side logic and authorization policies. As such, the version of a CVR
|
|
211
|
-
* version may need to be advanced independent of db state changes. This is done
|
|
212
|
-
* via the `minorVersion` counter of the CVRVersion object, which is used to account
|
|
213
|
-
* for both changes to the query set and changes to query transformations (which are
|
|
214
|
-
* effectively remove-old-query + add-new-query).
|
|
215
|
-
*
|
|
216
|
-
* Note that the transformed AST itself is **not** stored, as the result of the previous
|
|
217
|
-
* transformation is not useful in and of itself. If the current transformation results in
|
|
218
|
-
* a different hash than that of the transformation used for the last version of the CVR,
|
|
219
|
-
* it is simply handled by invalidating the existing rows, re-executed the query with
|
|
220
|
-
* the new transformation, and advancing the CVR's `minorVersion` and this query's
|
|
221
|
-
* `transformationVersion`.
|
|
222
|
-
*
|
|
223
|
-
* Note that the transformationHash is only stored when the query has reached the "gotten"
|
|
224
|
-
* state. If the query is in the "desired" but not yet "gotten" state, the field is absent.
|
|
225
|
-
*/
|
|
226
|
-
transformationHash: v.Optional<string>;
|
|
227
|
-
/**
|
|
228
|
-
* The CVR version corresponding to the `transformationHash`. This essentially tracks when
|
|
229
|
-
* this version of the query was effectively added to the CVR (as opposed to the
|
|
230
|
-
* `patchVersion`, which is simply when the client was notified that its query was added
|
|
231
|
-
* to the gotten set). Catchup of clients from old CVR versions require executing all
|
|
232
|
-
* queries with a newer `transformationVersion`.
|
|
233
|
-
*/
|
|
234
|
-
transformationVersion: v.Optional<{
|
|
235
|
-
stateVersion: string;
|
|
236
|
-
configVersion?: number | undefined;
|
|
237
|
-
}>;
|
|
238
|
-
}, "clientState" | "patchVersion"> & {
|
|
239
|
-
/**
|
|
240
|
-
* The client state for this query, which includes the inactivatedAt, ttl and
|
|
241
|
-
* version. The client state is stored in a record with the client ID as the
|
|
242
|
-
* key.
|
|
243
|
-
*/
|
|
244
|
-
clientState: v.Type<Record<string, {
|
|
245
|
-
inactivatedAt?: import("../ttl-clock.ts").TTLClock | undefined;
|
|
246
|
-
ttl: number;
|
|
247
|
-
version: {
|
|
248
|
-
stateVersion: string;
|
|
249
|
-
configVersion?: number | undefined;
|
|
250
|
-
};
|
|
251
|
-
}>>;
|
|
252
|
-
patchVersion: v.Optional<{
|
|
253
|
-
stateVersion: string;
|
|
254
|
-
configVersion?: number | undefined;
|
|
255
|
-
}>;
|
|
256
|
-
}, "args" | "name" | "type"> & {
|
|
257
|
-
type: v.Type<"custom">;
|
|
258
|
-
name: v.Type<string>;
|
|
259
|
-
args: v.Type<readonly import("../../../../../shared/src/json.ts").ReadonlyJSONValue[]>;
|
|
260
|
-
}, undefined>;
|
|
261
|
-
export type CustomQueryRecord = v.Infer<typeof customQueryRecordSchema>;
|
|
262
|
-
export declare const queryRecordSchema: v.UnionType<[v.ObjectType<Omit<Omit<{
|
|
263
|
-
/** The client-specified ID used to identify this query. Typically a hash. */
|
|
264
|
-
id: v.Type<string>;
|
|
265
|
-
/**
|
|
266
|
-
* The hash of the query after server-side transformations, which include:
|
|
267
|
-
*
|
|
268
|
-
* * Normalization (which may differ from what the client does)
|
|
269
|
-
* * Query "expansion" to include primary keys and query-execution-related columns
|
|
270
|
-
* * Authorization transforms
|
|
271
|
-
*
|
|
272
|
-
* Transformations depend on conditions that are independent of the db state version,
|
|
273
|
-
* such as server-side logic and authorization policies. As such, the version of a CVR
|
|
274
|
-
* version may need to be advanced independent of db state changes. This is done
|
|
275
|
-
* via the `minorVersion` counter of the CVRVersion object, which is used to account
|
|
276
|
-
* for both changes to the query set and changes to query transformations (which are
|
|
277
|
-
* effectively remove-old-query + add-new-query).
|
|
278
|
-
*
|
|
279
|
-
* Note that the transformed AST itself is **not** stored, as the result of the previous
|
|
280
|
-
* transformation is not useful in and of itself. If the current transformation results in
|
|
281
|
-
* a different hash than that of the transformation used for the last version of the CVR,
|
|
282
|
-
* it is simply handled by invalidating the existing rows, re-executed the query with
|
|
283
|
-
* the new transformation, and advancing the CVR's `minorVersion` and this query's
|
|
284
|
-
* `transformationVersion`.
|
|
285
|
-
*
|
|
286
|
-
* Note that the transformationHash is only stored when the query has reached the "gotten"
|
|
287
|
-
* state. If the query is in the "desired" but not yet "gotten" state, the field is absent.
|
|
288
|
-
*/
|
|
289
|
-
transformationHash: v.Optional<string>;
|
|
290
|
-
/**
|
|
291
|
-
* The CVR version corresponding to the `transformationHash`. This essentially tracks when
|
|
292
|
-
* this version of the query was effectively added to the CVR (as opposed to the
|
|
293
|
-
* `patchVersion`, which is simply when the client was notified that its query was added
|
|
294
|
-
* to the gotten set). Catchup of clients from old CVR versions require executing all
|
|
295
|
-
* queries with a newer `transformationVersion`.
|
|
296
|
-
*/
|
|
297
|
-
transformationVersion: v.Optional<{
|
|
298
|
-
stateVersion: string;
|
|
299
|
-
configVersion?: number | undefined;
|
|
300
|
-
}>;
|
|
301
|
-
}, "clientState" | "patchVersion"> & {
|
|
302
|
-
/**
|
|
303
|
-
* The client state for this query, which includes the inactivatedAt, ttl and
|
|
304
|
-
* version. The client state is stored in a record with the client ID as the
|
|
305
|
-
* key.
|
|
306
|
-
*/
|
|
307
|
-
clientState: v.Type<Record<string, {
|
|
308
|
-
inactivatedAt?: import("../ttl-clock.ts").TTLClock | undefined;
|
|
309
|
-
ttl: number;
|
|
310
|
-
version: {
|
|
311
|
-
stateVersion: string;
|
|
312
|
-
configVersion?: number | undefined;
|
|
313
|
-
};
|
|
314
|
-
}>>;
|
|
315
|
-
patchVersion: v.Optional<{
|
|
316
|
-
stateVersion: string;
|
|
317
|
-
configVersion?: number | undefined;
|
|
318
|
-
}>;
|
|
319
|
-
}, "ast" | "type"> & {
|
|
320
|
-
type: v.Type<"client">;
|
|
321
|
-
/** The original AST as supplied by the client. */
|
|
322
|
-
ast: v.Type<import("../../../../../zero-protocol/src/ast.ts").AST>;
|
|
323
|
-
}, undefined>, v.ObjectType<Omit<Omit<{
|
|
324
|
-
/** The client-specified ID used to identify this query. Typically a hash. */
|
|
325
|
-
id: v.Type<string>;
|
|
326
|
-
/**
|
|
327
|
-
* The hash of the query after server-side transformations, which include:
|
|
328
|
-
*
|
|
329
|
-
* * Normalization (which may differ from what the client does)
|
|
330
|
-
* * Query "expansion" to include primary keys and query-execution-related columns
|
|
331
|
-
* * Authorization transforms
|
|
332
|
-
*
|
|
333
|
-
* Transformations depend on conditions that are independent of the db state version,
|
|
334
|
-
* such as server-side logic and authorization policies. As such, the version of a CVR
|
|
335
|
-
* version may need to be advanced independent of db state changes. This is done
|
|
336
|
-
* via the `minorVersion` counter of the CVRVersion object, which is used to account
|
|
337
|
-
* for both changes to the query set and changes to query transformations (which are
|
|
338
|
-
* effectively remove-old-query + add-new-query).
|
|
339
|
-
*
|
|
340
|
-
* Note that the transformed AST itself is **not** stored, as the result of the previous
|
|
341
|
-
* transformation is not useful in and of itself. If the current transformation results in
|
|
342
|
-
* a different hash than that of the transformation used for the last version of the CVR,
|
|
343
|
-
* it is simply handled by invalidating the existing rows, re-executed the query with
|
|
344
|
-
* the new transformation, and advancing the CVR's `minorVersion` and this query's
|
|
345
|
-
* `transformationVersion`.
|
|
346
|
-
*
|
|
347
|
-
* Note that the transformationHash is only stored when the query has reached the "gotten"
|
|
348
|
-
* state. If the query is in the "desired" but not yet "gotten" state, the field is absent.
|
|
349
|
-
*/
|
|
350
|
-
transformationHash: v.Optional<string>;
|
|
351
|
-
/**
|
|
352
|
-
* The CVR version corresponding to the `transformationHash`. This essentially tracks when
|
|
353
|
-
* this version of the query was effectively added to the CVR (as opposed to the
|
|
354
|
-
* `patchVersion`, which is simply when the client was notified that its query was added
|
|
355
|
-
* to the gotten set). Catchup of clients from old CVR versions require executing all
|
|
356
|
-
* queries with a newer `transformationVersion`.
|
|
357
|
-
*/
|
|
358
|
-
transformationVersion: v.Optional<{
|
|
359
|
-
stateVersion: string;
|
|
360
|
-
configVersion?: number | undefined;
|
|
361
|
-
}>;
|
|
362
|
-
}, "clientState" | "patchVersion"> & {
|
|
363
|
-
/**
|
|
364
|
-
* The client state for this query, which includes the inactivatedAt, ttl and
|
|
365
|
-
* version. The client state is stored in a record with the client ID as the
|
|
366
|
-
* key.
|
|
367
|
-
*/
|
|
368
|
-
clientState: v.Type<Record<string, {
|
|
369
|
-
inactivatedAt?: import("../ttl-clock.ts").TTLClock | undefined;
|
|
370
|
-
ttl: number;
|
|
371
|
-
version: {
|
|
372
|
-
stateVersion: string;
|
|
373
|
-
configVersion?: number | undefined;
|
|
374
|
-
};
|
|
375
|
-
}>>;
|
|
376
|
-
patchVersion: v.Optional<{
|
|
377
|
-
stateVersion: string;
|
|
378
|
-
configVersion?: number | undefined;
|
|
379
|
-
}>;
|
|
380
|
-
}, "args" | "name" | "type"> & {
|
|
381
|
-
type: v.Type<"custom">;
|
|
382
|
-
name: v.Type<string>;
|
|
383
|
-
args: v.Type<readonly import("../../../../../shared/src/json.ts").ReadonlyJSONValue[]>;
|
|
384
|
-
}, undefined>, v.ObjectType<Omit<{
|
|
385
|
-
/** The client-specified ID used to identify this query. Typically a hash. */
|
|
386
|
-
id: v.Type<string>;
|
|
387
|
-
/**
|
|
388
|
-
* The hash of the query after server-side transformations, which include:
|
|
389
|
-
*
|
|
390
|
-
* * Normalization (which may differ from what the client does)
|
|
391
|
-
* * Query "expansion" to include primary keys and query-execution-related columns
|
|
392
|
-
* * Authorization transforms
|
|
393
|
-
*
|
|
394
|
-
* Transformations depend on conditions that are independent of the db state version,
|
|
395
|
-
* such as server-side logic and authorization policies. As such, the version of a CVR
|
|
396
|
-
* version may need to be advanced independent of db state changes. This is done
|
|
397
|
-
* via the `minorVersion` counter of the CVRVersion object, which is used to account
|
|
398
|
-
* for both changes to the query set and changes to query transformations (which are
|
|
399
|
-
* effectively remove-old-query + add-new-query).
|
|
400
|
-
*
|
|
401
|
-
* Note that the transformed AST itself is **not** stored, as the result of the previous
|
|
402
|
-
* transformation is not useful in and of itself. If the current transformation results in
|
|
403
|
-
* a different hash than that of the transformation used for the last version of the CVR,
|
|
404
|
-
* it is simply handled by invalidating the existing rows, re-executed the query with
|
|
405
|
-
* the new transformation, and advancing the CVR's `minorVersion` and this query's
|
|
406
|
-
* `transformationVersion`.
|
|
407
|
-
*
|
|
408
|
-
* Note that the transformationHash is only stored when the query has reached the "gotten"
|
|
409
|
-
* state. If the query is in the "desired" but not yet "gotten" state, the field is absent.
|
|
410
|
-
*/
|
|
411
|
-
transformationHash: v.Optional<string>;
|
|
412
|
-
/**
|
|
413
|
-
* The CVR version corresponding to the `transformationHash`. This essentially tracks when
|
|
414
|
-
* this version of the query was effectively added to the CVR (as opposed to the
|
|
415
|
-
* `patchVersion`, which is simply when the client was notified that its query was added
|
|
416
|
-
* to the gotten set). Catchup of clients from old CVR versions require executing all
|
|
417
|
-
* queries with a newer `transformationVersion`.
|
|
418
|
-
*/
|
|
419
|
-
transformationVersion: v.Optional<{
|
|
420
|
-
stateVersion: string;
|
|
421
|
-
configVersion?: number | undefined;
|
|
422
|
-
}>;
|
|
423
|
-
}, "ast" | "type"> & {
|
|
424
|
-
type: v.Type<"internal">;
|
|
425
|
-
ast: v.Type<import("../../../../../zero-protocol/src/ast.ts").AST>;
|
|
426
|
-
}, undefined>]>;
|
|
427
|
-
export type QueryRecord = v.Infer<typeof queryRecordSchema>;
|
|
428
|
-
export declare const rowIDSchema: v.ObjectType<{
|
|
429
|
-
schema: v.Type<string>;
|
|
430
|
-
table: v.Type<string>;
|
|
431
|
-
rowKey: v.Type<Record<string, import("../../../../../shared/src/bigint-json.ts").JSONValue>>;
|
|
432
|
-
}, undefined>;
|
|
433
|
-
export type RowID = v.Infer<typeof rowIDSchema>;
|
|
434
|
-
export declare const rowRecordSchema: v.ObjectType<Omit<{
|
|
435
|
-
/**
|
|
436
|
-
* CVR records store the CVRVersion at which the record was last patched into
|
|
437
|
-
* the CVR, which corresponds with a patch row that is cleaned up when the
|
|
438
|
-
* record is changed (updated, deleted, and re-added in the case of rows).
|
|
439
|
-
*
|
|
440
|
-
* Tombstones are stored for row records but not for config records. This means
|
|
441
|
-
* that "orphaned" delete patches for config records may exist, and therefore
|
|
442
|
-
* scans of config patches must always run until the end of the list. On the
|
|
443
|
-
* contrary, for row patches, the row record tombstones allow cleanup of delete
|
|
444
|
-
* patches.
|
|
445
|
-
*/
|
|
446
|
-
patchVersion: v.ObjectType<{
|
|
447
|
-
/**
|
|
448
|
-
* The database `stateVersion` with which the rows in the CVR are consistent.
|
|
449
|
-
*/
|
|
450
|
-
stateVersion: v.Type<string>;
|
|
451
|
-
/**
|
|
452
|
-
* `configVersion` is subversion of `stateVersion` that is initially absent for each
|
|
453
|
-
* `stateVersion`, and incremented for configuration changes that affect the contents
|
|
454
|
-
* of the CVR such as:
|
|
455
|
-
*
|
|
456
|
-
* * query set changes
|
|
457
|
-
* * query transformation changes (which may happen for changes
|
|
458
|
-
* in server-side logic or authorization policies)
|
|
459
|
-
*
|
|
460
|
-
* Such configuration changes are always correlated with a change to one or more
|
|
461
|
-
* `/meta/...` records in the CVR, often (but not always) with corresponding
|
|
462
|
-
* patches in `/patches/meta/...`.
|
|
463
|
-
*
|
|
464
|
-
* When the `stateVersion` moves forward, the `minorVersion` is reset to absent.
|
|
465
|
-
* In this manner it behaves like the analogous concept in semantic versioning.
|
|
466
|
-
*/
|
|
467
|
-
configVersion: v.Optional<number>;
|
|
468
|
-
}, undefined>;
|
|
469
|
-
}, "id" | "refCounts" | "rowVersion"> & {
|
|
470
|
-
id: v.ObjectType<{
|
|
471
|
-
schema: v.Type<string>;
|
|
472
|
-
table: v.Type<string>;
|
|
473
|
-
rowKey: v.Type<Record<string, import("../../../../../shared/src/bigint-json.ts").JSONValue>>;
|
|
474
|
-
}, undefined>;
|
|
475
|
-
rowVersion: v.Type<string>;
|
|
476
|
-
refCounts: v.UnionType<[v.Type<null>, v.Type<Record<string, number>>]>;
|
|
477
|
-
}, undefined>;
|
|
478
|
-
export type RowRecord = v.Infer<typeof rowRecordSchema>;
|
|
479
|
-
export declare const patchSchema: v.ObjectType<{
|
|
480
|
-
type: v.Type<"query" | "row">;
|
|
481
|
-
op: v.Type<"del" | "put">;
|
|
482
|
-
}, undefined>;
|
|
483
|
-
export declare const putRowPatchSchema: v.ObjectType<Omit<{
|
|
484
|
-
type: v.Type<"query" | "row">;
|
|
485
|
-
op: v.Type<"del" | "put">;
|
|
486
|
-
}, "id" | "op" | "rowVersion" | "type"> & {
|
|
487
|
-
type: v.Type<"row">;
|
|
488
|
-
op: v.Type<"put">;
|
|
489
|
-
id: v.ObjectType<{
|
|
490
|
-
schema: v.Type<string>;
|
|
491
|
-
table: v.Type<string>;
|
|
492
|
-
rowKey: v.Type<Record<string, import("../../../../../shared/src/bigint-json.ts").JSONValue>>;
|
|
493
|
-
}, undefined>;
|
|
494
|
-
rowVersion: v.Type<string>;
|
|
495
|
-
}, undefined>;
|
|
496
|
-
export type PutRowPatch = v.Infer<typeof putRowPatchSchema>;
|
|
497
|
-
export declare const delRowPatchSchema: v.ObjectType<Omit<{
|
|
498
|
-
type: v.Type<"query" | "row">;
|
|
499
|
-
op: v.Type<"del" | "put">;
|
|
500
|
-
}, "id" | "op" | "type"> & {
|
|
501
|
-
type: v.Type<"row">;
|
|
502
|
-
op: v.Type<"del">;
|
|
503
|
-
id: v.ObjectType<{
|
|
504
|
-
schema: v.Type<string>;
|
|
505
|
-
table: v.Type<string>;
|
|
506
|
-
rowKey: v.Type<Record<string, import("../../../../../shared/src/bigint-json.ts").JSONValue>>;
|
|
507
|
-
}, undefined>;
|
|
508
|
-
}, undefined>;
|
|
509
|
-
export type DelRowPatch = v.Infer<typeof delRowPatchSchema>;
|
|
510
|
-
export declare const rowPatchSchema: v.UnionType<[v.ObjectType<Omit<{
|
|
511
|
-
type: v.Type<"query" | "row">;
|
|
512
|
-
op: v.Type<"del" | "put">;
|
|
513
|
-
}, "id" | "op" | "rowVersion" | "type"> & {
|
|
514
|
-
type: v.Type<"row">;
|
|
515
|
-
op: v.Type<"put">;
|
|
516
|
-
id: v.ObjectType<{
|
|
517
|
-
schema: v.Type<string>;
|
|
518
|
-
table: v.Type<string>;
|
|
519
|
-
rowKey: v.Type<Record<string, import("../../../../../shared/src/bigint-json.ts").JSONValue>>;
|
|
520
|
-
}, undefined>;
|
|
521
|
-
rowVersion: v.Type<string>;
|
|
522
|
-
}, undefined>, v.ObjectType<Omit<{
|
|
523
|
-
type: v.Type<"query" | "row">;
|
|
524
|
-
op: v.Type<"del" | "put">;
|
|
525
|
-
}, "id" | "op" | "type"> & {
|
|
526
|
-
type: v.Type<"row">;
|
|
527
|
-
op: v.Type<"del">;
|
|
528
|
-
id: v.ObjectType<{
|
|
529
|
-
schema: v.Type<string>;
|
|
530
|
-
table: v.Type<string>;
|
|
531
|
-
rowKey: v.Type<Record<string, import("../../../../../shared/src/bigint-json.ts").JSONValue>>;
|
|
532
|
-
}, undefined>;
|
|
533
|
-
}, undefined>]>;
|
|
534
|
-
export type RowPatch = v.Infer<typeof rowPatchSchema>;
|
|
535
|
-
export declare const queryPatchSchema: v.ObjectType<Omit<{
|
|
536
|
-
type: v.Type<"query" | "row">;
|
|
537
|
-
op: v.Type<"del" | "put">;
|
|
538
|
-
}, "clientID" | "id" | "type"> & {
|
|
539
|
-
type: v.Type<"query">;
|
|
540
|
-
id: v.Type<string>;
|
|
541
|
-
clientID: v.Optional<string>;
|
|
542
|
-
}, undefined>;
|
|
543
|
-
export type QueryPatch = v.Infer<typeof queryPatchSchema>;
|
|
544
|
-
export type PutQueryPatch = QueryPatch & {
|
|
545
|
-
op: 'put';
|
|
546
|
-
};
|
|
547
|
-
export type DelQueryPatch = QueryPatch & {
|
|
548
|
-
op: 'del';
|
|
549
|
-
};
|
|
550
|
-
export declare const metadataPatchSchema: v.ObjectType<Omit<{
|
|
551
|
-
type: v.Type<"query" | "row">;
|
|
552
|
-
op: v.Type<"del" | "put">;
|
|
553
|
-
}, "clientID" | "id" | "type"> & {
|
|
554
|
-
type: v.Type<"query">;
|
|
555
|
-
id: v.Type<string>;
|
|
556
|
-
clientID: v.Optional<string>;
|
|
557
|
-
}, undefined>;
|
|
558
|
-
export type MetadataPatch = v.Infer<typeof metadataPatchSchema>;
|
|
559
|
-
export declare function versionString(v: CVRVersion): string;
|
|
560
|
-
export declare function versionFromString(str: string): CVRVersion;
|
|
561
|
-
export declare function queryRecordToQueryRow(clientGroupID: string, query: QueryRecord, rowSetSignature: string | null): QueriesRow;
|
|
562
|
-
export declare const maybeVersionString: (v: CVRVersion | undefined) => string | null;
|
|
563
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../../../zero-cache/src/services/view-syncer/schema/types.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The default maximum number of entries retained by a {@link SnapshotRowCache}.
|
|
3
|
-
*
|
|
4
|
-
* Each entry is a raw SQLite row (or the list of rows conflicting with
|
|
5
|
-
* a row on its unique keys) read while computing a snapshot diff. A
|
|
6
|
-
* replicated transaction of N rows produces up to 2N entries (the new value
|
|
7
|
-
* and the previous value(s) of each row), so the cache should be large enough
|
|
8
|
-
* to hold the largest transactions that are commonly replicated in order for
|
|
9
|
-
* all of the client groups on a worker to share the reads.
|
|
10
|
-
*/
|
|
11
|
-
export declare const DEFAULT_MAX_SNAPSHOT_ROW_CACHE_ENTRIES = 50000;
|
|
12
|
-
/**
|
|
13
|
-
* How a statement's results are read: a single row (`Statement.get()`) or
|
|
14
|
-
* all rows (`Statement.all()`).
|
|
15
|
-
*/
|
|
16
|
-
export type ReadMode = 'get' | 'all';
|
|
17
|
-
/**
|
|
18
|
-
* The maximum number of distinct SQL statements interned by a
|
|
19
|
-
* {@link SnapshotRowCache} before it is cleared. There is one per table and
|
|
20
|
-
* lookup shape, so this is only reached after many schema changes.
|
|
21
|
-
*/
|
|
22
|
-
export declare const MAX_INTERNED_STATEMENTS = 10000;
|
|
23
|
-
/**
|
|
24
|
-
* A worker-wide, bounded cache of the rows that a `Snapshotter` reads from
|
|
25
|
-
* replica snapshots when computing the diff between two versions of the
|
|
26
|
-
* replica.
|
|
27
|
-
*
|
|
28
|
-
* Every client group (i.e. view-syncer) on a sync worker computes its own
|
|
29
|
-
* diff from the shared `_zero.changeLog2`, and each change in the diff costs
|
|
30
|
-
* two SQLite reads: the new value of the row (from the `curr` snapshot) and
|
|
31
|
-
* the previous value(s) that it replaces (from the `prev` snapshot). The
|
|
32
|
-
* reads for a given change are identical for every client group that
|
|
33
|
-
* traverses it, so a replicated transaction of N rows costs N × 2 × (client
|
|
34
|
-
* groups) reads per worker, most of which are redundant. This cache lets the
|
|
35
|
-
* client groups on a worker share those reads.
|
|
36
|
-
*
|
|
37
|
-
* ### Keys
|
|
38
|
-
*
|
|
39
|
-
* Entries are keyed by the exact SQL statement and arguments of the read
|
|
40
|
-
* (which encodes the table, the selected columns and the lookup keys), plus
|
|
41
|
-
* a `tag` supplied by the caller that pins the result to a version of the
|
|
42
|
-
* replica:
|
|
43
|
-
*
|
|
44
|
-
* - The new value of a row is the row as of the `stateVersion` recorded in
|
|
45
|
-
* its change log entry (its `_0_version` is asserted to equal that
|
|
46
|
-
* version), and is tagged with that `stateVersion`. It is thus shareable
|
|
47
|
-
* by all client groups regardless of the snapshots they are advancing
|
|
48
|
-
* between.
|
|
49
|
-
* - Previous values are read from the `prev` snapshot at its version, and
|
|
50
|
-
* are tagged with that version (and, when the result can depend on the
|
|
51
|
-
* changes applied to the snapshot before the read, the `curr` version
|
|
52
|
-
* as well). See `Diff` in `snapshotter.ts` for the details.
|
|
53
|
-
*
|
|
54
|
-
* Because every key includes the version(s) that the result depends on,
|
|
55
|
-
* entries never go stale and are never invalidated; they are only evicted.
|
|
56
|
-
*
|
|
57
|
-
* ### Eviction
|
|
58
|
-
*
|
|
59
|
-
* The cache is bounded by entry count and evicts in insertion (FIFO) order
|
|
60
|
-
* rather than by recency. Diffs are traversed in change log order by every
|
|
61
|
-
* client group, so the entries that will not be needed again are those that
|
|
62
|
-
* were inserted the earliest (all groups have moved past them), while the
|
|
63
|
-
* most recently inserted entries are the ones that the trailing groups have
|
|
64
|
-
* yet to reach. Refreshing an entry on a hit would evict exactly the wrong
|
|
65
|
-
* entries when a trailing group catches up.
|
|
66
|
-
*
|
|
67
|
-
* ### Sharing
|
|
68
|
-
*
|
|
69
|
-
* Cached values are shared by reference across client groups and must
|
|
70
|
-
* therefore never be mutated by callers.
|
|
71
|
-
*/
|
|
72
|
-
export declare class SnapshotRowCache {
|
|
73
|
-
#private;
|
|
74
|
-
constructor(maxEntries?: number);
|
|
75
|
-
get size(): number;
|
|
76
|
-
get maxEntries(): number;
|
|
77
|
-
stats(): {
|
|
78
|
-
hits: number;
|
|
79
|
-
misses: number;
|
|
80
|
-
size: number;
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Returns the cached result of the read identified by `tag`, `sql`, `mode`
|
|
84
|
-
* and `args`, or performs the read via `read()`, caching and returning its
|
|
85
|
-
* result. `undefined` results (i.e. a missing row) are not cached.
|
|
86
|
-
*
|
|
87
|
-
* `mode` is part of the key because the same statement can be read both
|
|
88
|
-
* ways: for a table whose only unique key is its primary key, `getRow()`
|
|
89
|
-
* and `getRows()` produce identical SQL, args and tags, but the former
|
|
90
|
-
* caches a row and the latter an array of rows.
|
|
91
|
-
*/
|
|
92
|
-
getOrRead<T>(tag: string, sql: string, mode: ReadMode, args: unknown[], read: () => T): T;
|
|
93
|
-
clear(): void;
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=snapshot-row-cache.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot-row-cache.d.ts","sourceRoot":"","sources":["../../../../../../zero-cache/src/services/view-syncer/snapshot-row-cache.ts"],"names":[],"mappings":"AAMA;;;;;;;;;GASG;AACH,eAAO,MAAM,sCAAsC,QAAS,CAAC;AAwB7D;;;GAGG;AACH,MAAM,MAAM,QAAQ,GAAG,KAAK,GAAG,KAAK,CAAC;AAErC;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,QAAS,CAAC;AAK9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,qBAAa,gBAAgB;;IAmB3B,YAAY,UAAU,SAAyC,EAE9D;IAED,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,UAAU,IAAI,MAAM,CAEvB;IAED,KAAK,IAAI;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAEpD;IAED;;;;;;;;;OASG;IACH,SAAS,CAAC,CAAC,EACT,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,QAAQ,EACd,IAAI,EAAE,OAAO,EAAE,EACf,IAAI,EAAE,MAAM,CAAC,GACZ,CAAC,CAoBH;IAED,KAAK,IAAI,IAAI,CAIZ;CAsBF"}
|