@bastani/atomic 0.10.11-alpha.3 → 0.10.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +208 -0
- package/dist/_shared/dist-KOELCESV.js +2 -2
- package/dist/_shared/fork-row-index-UAUAQRD5.js +2 -2
- package/dist/_shared/lib-4PES5P4V.js +2 -2
- package/dist/_shared/mode-interactive-sdk-7KXUFI2F.js +4 -4
- package/dist/_shared/mode-rpc-sdk-IOPGDYR4.js +4 -4
- package/dist/_shared/mode-shared-2QJSCUM6.js +4 -4
- package/dist/_shared/p1a-prewarm-XIU57JHF.js +3 -3
- package/dist/_shared/p1b-elig-TVB5CBLL.js +22 -6
- package/dist/_shared/p1b-elig-TVB5CBLL.js.map +1 -1
- package/dist/_shared/p2-shell-main-B2WIALFD.js +6 -3
- package/dist/_shared/p2-shell-main-B2WIALFD.js.map +1 -1
- package/dist/_shared/runtime-O4KCSG4C.js +2 -2
- package/dist/_shared/sdk-B5LEWGGI.js +899 -515
- package/dist/_shared/sdk-B5LEWGGI.js.map +1 -1
- package/dist/_shared/session-data-AHTU7IS6.js +2 -2
- package/dist/_shared/session-manager-list-2BLEEZVG.js +1 -1
- package/dist/_shared/{startup-0-0-EZUKEP4Q.js → startup-0-0-XJJDOIEC.js} +6 -12
- package/dist/_shared/{startup-0-0-EZUKEP4Q.js.map → startup-0-0-XJJDOIEC.js.map} +1 -1
- package/dist/_shared/{startup-0-1-RTOHJFDJ.js → startup-0-1-M6OWAYHH.js} +354 -103
- package/dist/_shared/startup-0-1-M6OWAYHH.js.map +1 -0
- package/dist/_shared/startup-0-2-5QHPCEON.js +18 -9
- package/dist/_shared/startup-0-2-5QHPCEON.js.map +1 -1
- package/dist/_shared/startup-0-3-4ZYBYQNM.js +4 -4
- package/dist/_shared/startup-0-4-ZMJV547D.js +4 -4
- package/dist/_shared/startup-0-5-YDW47QX6.js +4 -4
- package/dist/_shared/startup-10-0-TDQNBDDL.js +4 -4
- package/dist/_shared/startup-12-0-55AAXBJZ.js +1 -1
- package/dist/_shared/startup-14-0-MLX36RBG.js +2 -2
- package/dist/_shared/startup-15-0-YUKGAC63.js +2 -2
- package/dist/_shared/startup-15-1-4S7FLMNG.js +4 -4
- package/dist/_shared/startup-8-0-34CBHPZH.js +2114 -235
- package/dist/_shared/startup-8-0-34CBHPZH.js.map +1 -1
- package/dist/_shared/startup-8-1-LZFXSD3Z.js +12 -12
- package/dist/_shared/storage-command-7MGXLJGZ.js +6 -6
- package/dist/_shared/storage-command-7MGXLJGZ.js.map +1 -1
- package/dist/_shared/storage-status-K7PX2RXA.js +2 -2
- package/dist/_shared/task-unsaved-answer-VJ2KTB4V.js +2 -2
- package/dist/_shared/team-DOQKICG2.js +1 -1
- package/dist/_shared/tree-outline-MUEPK5B7.js +2 -2
- package/dist/builtin/intercom/CHANGELOG.md +65 -0
- package/dist/builtin/intercom/broker/broker.bundle.mjs +1020 -108
- package/dist/builtin/intercom/broker/client.ts +8 -0
- package/dist/builtin/intercom/broker/database-wake-up-bus.ts +91 -14
- package/dist/builtin/intercom/broker/multinode-router.ts +102 -17
- package/dist/builtin/intercom/broker/multinode-state-store.ts +41 -2
- package/dist/builtin/intercom/broker/send-order-gate.ts +5 -2
- package/dist/builtin/intercom/broker/sql-add-column.ts +22 -1
- package/dist/builtin/intercom/broker/sql-lease-store.ts +304 -48
- package/dist/builtin/intercom/broker/sql-outbox-store.ts +541 -50
- package/dist/builtin/intercom/broker/sql-restoring-reservation-store.ts +239 -8
- package/dist/builtin/intercom/broker/sql-retention.ts +11 -2
- package/dist/builtin/intercom/broker/sql-schema.ts +42 -8
- package/dist/builtin/intercom/index.bundle.mjs +13 -2
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/index.bundle.mjs +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +20 -0
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/skills/skill-creator/eval-viewer/generate_review.py +8 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/index.bundle.mjs +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/cli/args.js +2 -2
- package/dist/cli/auth-cli.code.js +2 -2
- package/dist/cli/auth-cli.impl.js +3 -3
- package/dist/cli/auth-cli.js +3 -3
- package/dist/cli/blueprint-command.code.js +1 -1
- package/dist/cli/blueprint-command.impl.js +3 -3
- package/dist/cli/blueprint-command.js +3 -3
- package/dist/cli/intercom-command.code.js +2 -2
- package/dist/cli/intercom-command.impl.js +3 -3
- package/dist/cli/intercom-command.js +3 -3
- package/dist/cli/list-models.code.js +2 -2
- package/dist/cli/list-models.impl.js +3 -3
- package/dist/cli/list-models.js +3 -3
- package/dist/cli/session-picker.code.js +1 -1
- package/dist/cli/session-picker.impl.js +3 -3
- package/dist/cli/session-picker.js +3 -3
- package/dist/cli/startup-ui.code.js +1 -1
- package/dist/cli/startup-ui.impl.js +3 -3
- package/dist/cli/startup-ui.js +3 -3
- package/dist/cli/storage-command.impl.js +3 -3
- package/dist/cli/storage-command.js +3 -3
- package/dist/cli/storage-search-session.code.js +1 -1
- package/dist/cli/storage-search-session.impl.js +3 -3
- package/dist/cli/storage-search-session.js +3 -3
- package/dist/cli/team-command.code.js +1 -1
- package/dist/cli/team-command.impl.js +3 -3
- package/dist/cli/team-command.js +3 -3
- package/dist/cli.js +2 -2
- package/dist/core/debug.impl.js +3 -3
- package/dist/core/debug.js +3 -3
- package/dist/core/export-html/card-projection.impl.js +3 -3
- package/dist/core/export-html/card-projection.js +3 -3
- package/dist/core/export-html/index.code.js +4 -4
- package/dist/core/export-html/index.code.js.map +1 -1
- package/dist/core/export-html/index.impl.js +3 -3
- package/dist/core/export-html/index.js +3 -3
- package/dist/core/export-html/json-spans.impl.js +3 -3
- package/dist/core/export-html/json-spans.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.impl.js +3 -3
- package/dist/core/export-html/oversized-render-inputs.js +3 -3
- package/dist/core/export-html/tool-renderer.impl.js +3 -3
- package/dist/core/export-html/tool-renderer.js +3 -3
- package/dist/core/extensions/jiti-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-loader.js +3 -3
- package/dist/core/extensions/jiti-static-loader.impl.js +3 -3
- package/dist/core/extensions/jiti-static-loader.js +3 -3
- package/dist/core/extensions/loader-host-modules.code.js +1 -1
- package/dist/core/extensions/loader-host-modules.impl.js +3 -3
- package/dist/core/extensions/loader-host-modules.js +3 -3
- package/dist/core/extensions/loader-virtual-modules.js +1 -1
- package/dist/core/extensions/runner-context.js +1 -1
- package/dist/core/intercom-broker-control-host.impl.js +3 -3
- package/dist/core/intercom-broker-control-host.js +3 -3
- package/dist/core/intercom-broker-control.code.js +3 -3
- package/dist/core/intercom-broker-control.impl.js +3 -3
- package/dist/core/intercom-broker-control.js +3 -3
- package/dist/core/package-manager-storage-adapters.impl.js +3 -3
- package/dist/core/package-manager-storage-adapters.js +3 -3
- package/dist/core/process-start-token.d.ts +5 -4
- package/dist/core/sdk.code.js +2 -2
- package/dist/core/sdk.impl.js +3 -3
- package/dist/core/sdk.js +3 -3
- package/dist/core/session-manager-core.js +4 -4
- package/dist/core/session-manager-list.impl.js +3 -3
- package/dist/core/session-manager-list.js +3 -3
- package/dist/core/session-manager.code.js +1 -1
- package/dist/core/session-manager.impl.js +3 -3
- package/dist/core/session-manager.js +3 -3
- package/dist/core/session-storage.impl.js +3 -3
- package/dist/core/session-storage.js +3 -3
- package/dist/core/storage/database.d.ts +6 -0
- package/dist/core/storage/database.js.map +1 -1
- package/dist/core/storage/fenced-paths.d.ts +7 -6
- package/dist/core/storage/fenced-paths.js +7 -6
- package/dist/core/storage/fenced-paths.js.map +1 -1
- package/dist/core/storage/index.js +2 -2
- package/dist/core/storage/node-sqlite-thread.js +209 -19
- package/dist/core/storage/node-sqlite-thread.js.map +1 -1
- package/dist/core/storage/node-sqlite.js +435 -71
- package/dist/core/storage/node-sqlite.js.map +1 -1
- package/dist/core/storage/offline-snapshot-file.impl.js +3 -3
- package/dist/core/storage/offline-snapshot-file.js +3 -3
- package/dist/core/storage/provider.js +2 -2
- package/dist/core/storage/schema-catalog.d.ts +69 -7
- package/dist/core/storage/schema-catalog.js +352 -61
- package/dist/core/storage/schema-catalog.js.map +1 -1
- package/dist/core/storage/selection.js +2 -2
- package/dist/core/storage/session/branch-fork-source.code.js +2 -2
- package/dist/core/storage/session/branch-fork-source.impl.js +3 -3
- package/dist/core/storage/session/branch-fork-source.js +3 -3
- package/dist/core/storage/session/card-view.impl.js +3 -3
- package/dist/core/storage/session/card-view.js +3 -3
- package/dist/core/storage/session/child-reader.code.js +3 -3
- package/dist/core/storage/session/child-reader.impl.js +3 -3
- package/dist/core/storage/session/child-reader.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.impl.js +3 -3
- package/dist/core/storage/session/chunked-resume-projection.js +3 -3
- package/dist/core/storage/session/expanded-child-details.code.js +2 -2
- package/dist/core/storage/session/expanded-child-details.impl.js +3 -3
- package/dist/core/storage/session/expanded-child-details.js +3 -3
- package/dist/core/storage/session/fork-detach.d.ts +11 -1
- package/dist/core/storage/session/fork-row-bytes.impl.js +3 -3
- package/dist/core/storage/session/fork-row-bytes.js +3 -3
- package/dist/core/storage/session/fork-row-index.impl.js +3 -3
- package/dist/core/storage/session/fork-row-index.js +3 -3
- package/dist/core/storage/session/fork-staging.code.js +1 -1
- package/dist/core/storage/session/fork-staging.impl.js +3 -3
- package/dist/core/storage/session/fork-staging.js +3 -3
- package/dist/core/storage/session/fork-sweep.js +31 -7
- package/dist/core/storage/session/fork-sweep.js.map +1 -1
- package/dist/core/storage/session/fork-window.code.js +3 -3
- package/dist/core/storage/session/fork-window.impl.js +3 -3
- package/dist/core/storage/session/fork-window.js +3 -3
- package/dist/core/storage/session/history-pages.impl.js +3 -3
- package/dist/core/storage/session/history-pages.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.impl.js +3 -3
- package/dist/core/storage/session/jsonl-entry-projection.js +3 -3
- package/dist/core/storage/session/jsonl-session-lock.d.ts +100 -0
- package/dist/core/storage/session/jsonl-session-store.d.ts +41 -23
- package/dist/core/storage/session/jsonl-session-store.impl.js +3 -3
- package/dist/core/storage/session/jsonl-session-store.js +3 -3
- package/dist/core/storage/session/memory-session-store.impl.js +3 -3
- package/dist/core/storage/session/memory-session-store.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.code.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.impl.js +3 -3
- package/dist/core/storage/session/pinned-branch-resume.js +3 -3
- package/dist/core/storage/session/released-history-files.code.js +8 -8
- package/dist/core/storage/session/released-history-files.code.js.map +1 -1
- package/dist/core/storage/session/released-history-files.impl.js +3 -3
- package/dist/core/storage/session/released-history-files.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.impl.js +3 -3
- package/dist/core/storage/session/resident-fork-rows.js +3 -3
- package/dist/core/storage/session/session-resume.impl.js +3 -3
- package/dist/core/storage/session/session-resume.js +3 -3
- package/dist/core/storage/session/session-search-index.d.ts +9 -1
- package/dist/core/storage/session/snapshot-cut.impl.js +3 -3
- package/dist/core/storage/session/snapshot-cut.js +3 -3
- package/dist/core/storage/session/snapshot-history.code.js +3 -3
- package/dist/core/storage/session/snapshot-history.impl.js +3 -3
- package/dist/core/storage/session/snapshot-history.js +3 -3
- package/dist/core/storage/session/sql-session-store.d.ts +51 -7
- package/dist/core/storage/session/sql-session-store.impl.js +3 -3
- package/dist/core/storage/session/sql-session-store.js +3 -3
- package/dist/core/storage/session/tree-outline.impl.js +3 -3
- package/dist/core/storage/session/tree-outline.js +3 -3
- package/dist/core/storage/session/tree-presentation.impl.js +3 -3
- package/dist/core/storage/session/tree-presentation.js +3 -3
- package/dist/core/storage/sqlite-facade.d.ts +6 -0
- package/dist/core/storage/sqlite-facade.js +309 -33
- package/dist/core/storage/sqlite-facade.js.map +1 -1
- package/dist/core/storage/sqlite-open-batch.js +10 -0
- package/dist/core/storage/sqlite-open-batch.js.map +1 -0
- package/dist/core/storage/storage-status.impl.js +3 -3
- package/dist/core/storage/storage-status.js +3 -3
- package/dist/core/storage/team.impl.js +3 -3
- package/dist/core/storage/team.js +3 -3
- package/dist/core/structured-output/index.impl.js +3 -3
- package/dist/core/structured-output/index.js +3 -3
- package/dist/core/tasks/task-completion-entry.impl.js +3 -3
- package/dist/core/tasks/task-completion-entry.js +3 -3
- package/dist/core/tasks/task-file-history.code.js +3 -3
- package/dist/core/tasks/task-file-history.impl.js +3 -3
- package/dist/core/tasks/task-file-history.js +3 -3
- package/dist/core/tasks/task-reference-archive.code.js +3 -3
- package/dist/core/tasks/task-reference-archive.js +3 -3
- package/dist/core/tasks/task-reference-identity.js +3 -3
- package/dist/core/tasks/task-reference-stream.impl.js +3 -3
- package/dist/core/tasks/task-reference-stream.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.impl.js +3 -3
- package/dist/core/tasks/task-unsaved-answer.js +3 -3
- package/dist/core/tasks/task-view-source.impl.js +3 -3
- package/dist/core/tasks/task-view-source.js +3 -3
- package/dist/core/tools/read-url.code.js +2 -2
- package/dist/core/tools/read-url.impl.js +3 -3
- package/dist/core/tools/read-url.js +3 -3
- package/dist/core/worktree-snapshot/blob-store.d.ts +5 -3
- package/dist/core/worktree-snapshot/blob-store.js +151 -21
- package/dist/core/worktree-snapshot/blob-store.js.map +1 -1
- package/dist/core/worktree-snapshot/errors.code.js +2 -2
- package/dist/core/worktree-snapshot/errors.impl.js +3 -3
- package/dist/core/worktree-snapshot/errors.js +3 -3
- package/dist/core/worktree-snapshot/fork-snapshot-index.js +158 -41
- package/dist/core/worktree-snapshot/fork-snapshot-index.js.map +1 -1
- package/dist/core/worktree-snapshot/session-index-reset.impl.js +3 -3
- package/dist/core/worktree-snapshot/session-index-reset.js +3 -3
- package/dist/extensions/codemode/execute.code.js +1 -1
- package/dist/extensions/codemode/execute.impl.js +3 -3
- package/dist/extensions/codemode/execute.js +3 -3
- package/dist/extensions/codemode/renderer.code.js +1 -1
- package/dist/extensions/codemode/renderer.impl.js +3 -3
- package/dist/extensions/codemode/renderer.js +3 -3
- package/dist/extensions/mcp/cli.code.js +1 -1
- package/dist/extensions/mcp/cli.impl.js +3 -3
- package/dist/extensions/mcp/cli.js +3 -3
- package/dist/extensions/mcp/cli.lazy.code.js +2 -2
- package/dist/extensions/mcp/cli.lazy.impl.js +3 -3
- package/dist/extensions/mcp/cli.lazy.js +3 -3
- package/dist/extensions/mcp/runtime.impl.js +3 -3
- package/dist/extensions/mcp/runtime.js +3 -3
- package/dist/index.js +2 -2
- package/dist/main-first-time-setup.code.js +1 -1
- package/dist/main-first-time-setup.impl.js +3 -3
- package/dist/main-first-time-setup.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.code.js +2 -2
- package/dist/modes/interactive/components/stored-tree-view.impl.js +3 -3
- package/dist/modes/interactive/components/stored-tree-view.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.impl.js +3 -3
- package/dist/modes/interactive/components/user-message-selector-archive.js +3 -3
- package/dist/package-manager-cli.code.js +4 -4
- package/dist/package-manager-cli.impl.js +3 -3
- package/dist/package-manager-cli.js +3 -3
- package/dist/rpc-entry.js +1 -1
- package/dist/startup-files.json +1 -1
- package/dist/startup-stages/3.js +1 -1
- package/dist/startup-stages/5.js +1 -1
- package/dist/utils/startup-database-spare.code.js +2 -2
- package/dist/utils/startup-database-spare.impl.js +3 -3
- package/dist/utils/startup-database-spare.js +3 -3
- package/dist/utils/tools-manager.code.js +1 -1
- package/dist/utils/tools-manager.impl.js +3 -3
- package/dist/utils/tools-manager.js +3 -3
- package/docs/changelog.mdx +77 -0
- package/docs/storage/jsonl.md +3 -3
- package/package.json +8 -8
- package/dist/_shared/startup-0-1-RTOHJFDJ.js.map +0 -1
|
@@ -6,7 +6,7 @@ try {
|
|
|
6
6
|
} catch (error) {
|
|
7
7
|
const root = new URL("../../", import.meta.url);
|
|
8
8
|
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
9
|
-
const key = `${root.href}#0.10.11
|
|
9
|
+
const key = `${root.href}#0.10.11`;
|
|
10
10
|
let release = releases.get(key);
|
|
11
11
|
if (release === undefined) {
|
|
12
12
|
const current = (async () => {
|
|
@@ -27,8 +27,8 @@ try {
|
|
|
27
27
|
release = current;
|
|
28
28
|
}
|
|
29
29
|
const running = await release;
|
|
30
|
-
if (running === undefined || running.version === "0.10.11
|
|
31
|
-
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11
|
|
30
|
+
if (running === undefined || running.version === "0.10.11") throw error;
|
|
31
|
+
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11 while this session was running; restart it to keep using session storage.", {
|
|
32
32
|
cause: error,
|
|
33
33
|
});
|
|
34
34
|
}
|
|
@@ -6,7 +6,7 @@ try {
|
|
|
6
6
|
} catch (error) {
|
|
7
7
|
const root = new URL("../../", import.meta.url);
|
|
8
8
|
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
9
|
-
const key = `${root.href}#0.10.11
|
|
9
|
+
const key = `${root.href}#0.10.11`;
|
|
10
10
|
let release = releases.get(key);
|
|
11
11
|
if (release === undefined) {
|
|
12
12
|
const current = (async () => {
|
|
@@ -27,8 +27,8 @@ try {
|
|
|
27
27
|
release = current;
|
|
28
28
|
}
|
|
29
29
|
const running = await release;
|
|
30
|
-
if (running === undefined || running.version === "0.10.11
|
|
31
|
-
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11
|
|
30
|
+
if (running === undefined || running.version === "0.10.11") throw error;
|
|
31
|
+
throw new Error((typeof running.name === "string" ? running.name : "atomic") + " was updated to 0.10.11 while this session was running; restart it to keep using session storage.", {
|
|
32
32
|
cause: error,
|
|
33
33
|
});
|
|
34
34
|
}
|
|
@@ -443,7 +443,7 @@ function __atomicOnDemandFailed(error, feature) {
|
|
|
443
443
|
return (async () => {
|
|
444
444
|
const root = new URL("../../", import.meta.url);
|
|
445
445
|
const releases = (globalThis[Symbol.for("atomic.in-place-update-release.v1")] ??= new Map());
|
|
446
|
-
const key = `${root.href}#0.10.11
|
|
446
|
+
const key = `${root.href}#0.10.11`;
|
|
447
447
|
let release = releases.get(key);
|
|
448
448
|
if (release === undefined) {
|
|
449
449
|
const current = (async () => {
|
|
@@ -471,7 +471,7 @@ function __atomicOnDemandFailed(error, feature) {
|
|
|
471
471
|
} catch {
|
|
472
472
|
// No installation to read, as in a bundle of the package: the release the process runs decides.
|
|
473
473
|
}
|
|
474
|
-
const updatedTo = typeof installed === "string" && installed !== "0.10.11
|
|
474
|
+
const updatedTo = typeof installed === "string" && installed !== "0.10.11" ? installed : running !== undefined && running.version !== "0.10.11" ? "0.10.11" : undefined;
|
|
475
475
|
if (updatedTo === undefined) throw error;
|
|
476
476
|
const application = typeof running?.name === "string" ? running.name : "atomic";
|
|
477
477
|
const restart = new Error(`${application} was updated to ${updatedTo} while this session was running; restart it to keep using ${feature}.`, {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SqliteDatabase, SqliteExecutor } from "./database.js";
|
|
2
|
+
import type { SequencedStatement } from "./statement-sequence.js";
|
|
2
3
|
/**
|
|
3
4
|
* What a schema held when one open read it: its relations, triggers and columns, and on PostgreSQL the versions its
|
|
4
5
|
* ledger records. Only a positive answer is final: the schema only moves forward, so what existed then still exists,
|
|
@@ -43,7 +44,7 @@ export interface SqliteSchemaStamp {
|
|
|
43
44
|
* @internal Stamps each of `stamps`, in the transaction `tx` that ran their setups, with the schema version as that
|
|
44
45
|
* transaction leaves it: a later open believes their revisions until the schema changes again (#6560). Creates the
|
|
45
46
|
* stamps table first, unless `options.tableExists`, so its own creation is part of the version recorded. With
|
|
46
|
-
* `options.last`, the stamps are the transaction's last
|
|
47
|
+
* `options.last`, the stamps are the transaction's last statements: where its connection is pipelined, they go out with
|
|
47
48
|
* its commit. SQLite only; every stamp must share a ledger.
|
|
48
49
|
*/
|
|
49
50
|
export declare function recordSqliteSchemaStamps(tx: SqliteExecutor, stamps: readonly SqliteSchemaStamp[], options?: {
|
|
@@ -57,6 +58,56 @@ export declare function recordSqliteSchemaStamps(tx: SqliteExecutor, stamps: rea
|
|
|
57
58
|
* when a read fails: the stores then check each object themselves.
|
|
58
59
|
*/
|
|
59
60
|
export declare function readStorageSchemaCatalog(database: SqliteDatabase, ledger: string): Promise<StorageSchemaCatalog | undefined>;
|
|
61
|
+
/** @internal Context passed to a queued SQLite schema setup inside an open's single write transaction (#6709). */
|
|
62
|
+
export interface SqliteSchemaBatchContext {
|
|
63
|
+
/** The write transaction executor. */
|
|
64
|
+
readonly tx: SqliteExecutor;
|
|
65
|
+
/** The live schema catalog read at the start of the write transaction, authoritative under the write lock. */
|
|
66
|
+
readonly catalog: StorageSchemaCatalog | undefined;
|
|
67
|
+
/**
|
|
68
|
+
* Queues a SQLite write statement or multi-statement SQL script to run in order inside the transaction. Consecutive
|
|
69
|
+
* queued writes go out together to the connection thread, and the final run goes out with `COMMIT`. When
|
|
70
|
+
* `options.ignoreError` returns true for a statement's failure, that error is ignored.
|
|
71
|
+
*/
|
|
72
|
+
enqueue(statement: string | SequencedStatement, options?: {
|
|
73
|
+
readonly ignoreError?: (error: unknown) => boolean;
|
|
74
|
+
}): void;
|
|
75
|
+
/** Executes any writes queued so far; call before issuing a read on `tx` that depends on them. */
|
|
76
|
+
flushWrites(): Promise<void>;
|
|
77
|
+
/** Notes that this transaction added `column` to `table`, so a later queued setup does not add it again. */
|
|
78
|
+
noteColumnAdded(table: string, column: string): void;
|
|
79
|
+
/** Whether `table` already has `column` in `catalog` or added earlier in this transaction. */
|
|
80
|
+
hasColumn(table: string, column: string): boolean;
|
|
81
|
+
/** Notes that this transaction created `table`. */
|
|
82
|
+
noteTableCreated(table: string): void;
|
|
83
|
+
/** Whether `table` was created earlier in this transaction. */
|
|
84
|
+
createdTable(table: string): boolean;
|
|
85
|
+
/** Whether `table` already existed in `catalog` before this transaction began. */
|
|
86
|
+
tableExisted(table: string): boolean;
|
|
87
|
+
}
|
|
88
|
+
/** @internal A SQLite schema setup queued inside an open scope (`withStorageSchemaCatalog`) to run in one transaction. */
|
|
89
|
+
export interface SqliteSchemaBatchSetup {
|
|
90
|
+
/** Stamp recorded for this setup once the batched transaction commits, when the store uses SQLite schema stamps. */
|
|
91
|
+
readonly stamp?: SqliteSchemaStamp;
|
|
92
|
+
/** Whether the schema already holds everything this setup creates (for DDL-only setups without row seeds). */
|
|
93
|
+
readonly verify?: (catalog: StorageSchemaCatalog) => boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Checks outside any write lock whether another host completed this setup while we waited on `tryMaintenance`.
|
|
96
|
+
* Throwing (such as `StorageSchemaVersionError` for a newer build's database) immediately rejects the open.
|
|
97
|
+
*/
|
|
98
|
+
readonly done?: (catalog: StorageSchemaCatalog, stamps: ReadonlyMap<string, number> | undefined) => boolean | Promise<boolean>;
|
|
99
|
+
/** Reset any mutable per-attempt JS state before each transaction attempt or retry. */
|
|
100
|
+
readonly reset?: () => void;
|
|
101
|
+
/** Runs this setup inside the batched write transaction. */
|
|
102
|
+
readonly run: (context: SqliteSchemaBatchContext) => Promise<void> | void;
|
|
103
|
+
/**
|
|
104
|
+
* Optional setup (such as an FTS5 search index): if the transaction fails, the open retries with optional setups
|
|
105
|
+
* isolated in savepoints, calling `onFailure` instead of failing the open.
|
|
106
|
+
*/
|
|
107
|
+
readonly optional?: boolean;
|
|
108
|
+
/** Called when an optional setup fails and its savepoint rolls back. */
|
|
109
|
+
readonly onFailure?: () => void;
|
|
110
|
+
}
|
|
60
111
|
/** @internal How the end of an open stamps a store's setup: see {@link restampStorageSchemaAtOpenEnd}. */
|
|
61
112
|
export interface SchemaStampAtOpenEnd {
|
|
62
113
|
/**
|
|
@@ -79,8 +130,9 @@ export interface SchemaStampAtOpenEnd {
|
|
|
79
130
|
/**
|
|
80
131
|
* Runs `body`, an open of one or more stores on `database`, with one catalog read for all of them: the schema checks
|
|
81
132
|
* of the stores it opens ({@link schemaCatalogOf}) answer from it, so an open whose schema is current runs no schema
|
|
82
|
-
* transaction and takes no lock. Opens on `database` that overlap share the read.
|
|
83
|
-
*
|
|
133
|
+
* transaction and takes no lock. Opens on `database` that overlap share the read. On SQLite, setups queued inside the
|
|
134
|
+
* open ({@link queueSqliteSchemaSetup}) run in one write transaction before the root open returns (#6709). `views` are
|
|
135
|
+
* other handles on the same connection, such as a borrowed view, whose checks answer from the same read.
|
|
84
136
|
*/
|
|
85
137
|
export declare function withStorageSchemaCatalog<T>(database: SqliteDatabase, ledger: string, body: () => Promise<T>, views?: readonly SqliteDatabase[]): Promise<T>;
|
|
86
138
|
/**
|
|
@@ -105,15 +157,25 @@ export declare function schemaCatalogOf(database: SqliteDatabase, ledger?: strin
|
|
|
105
157
|
* question reads them after the open's catalog, and only where it holds their table.
|
|
106
158
|
*/
|
|
107
159
|
export declare function sqliteSchemaStampsOf(database: SqliteDatabase, ledger: string): Promise<ReadonlyMap<string, number> | undefined>;
|
|
160
|
+
/**
|
|
161
|
+
* @internal Queues `setup` into the active SQLite open scope (`withStorageSchemaCatalog`) so that all needed setups of
|
|
162
|
+
* the open execute in one write transaction before the open returns (#6709). Returns `false` outside a SQLite open
|
|
163
|
+
* scope (or for a different `ledger`), in which case the caller runs `setup` immediately.
|
|
164
|
+
*/
|
|
165
|
+
export declare function queueSqliteSchemaSetup(database: SqliteDatabase, ledger: string | undefined, setup: SqliteSchemaBatchSetup): boolean;
|
|
166
|
+
/**
|
|
167
|
+
* @internal Executes and commits any SQLite schema setups queued so far in the active open scope, before the open
|
|
168
|
+
* needs their committed tables or evaluated outcomes (#6709). No-op when nothing is queued or outside a SQLite open.
|
|
169
|
+
*/
|
|
170
|
+
export declare function flushStorageSchemaSetups(database: SqliteDatabase, ledger?: string): Promise<void>;
|
|
108
171
|
/**
|
|
109
172
|
* @internal Tells the open of `database` in progress that it checked `setup`, the schema setup `stamp` names, without
|
|
110
173
|
* its stamp (SQLite only): it ran it in a transaction that stamped it, found every object it creates in the
|
|
111
174
|
* catalog (with `verify`), or leaves it to the end (`deferred`). A schema change later in the same open, such as the
|
|
112
175
|
* next store's setup or a column it adds, leaves a stamp behind the schema version, and a store found in the catalog has
|
|
113
|
-
* none that is current, so the next open would check it again. The open's end
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
* nothing is kept, outside such an open: the caller then runs `setup` as it would without stamps.
|
|
176
|
+
* none that is current, so the next open would check it again. The open's end checks or runs them in one transaction
|
|
177
|
+
* and stamps them all with the version it leaves: the next open of a current schema then takes no write lock and answers
|
|
178
|
+
* every such store from its stamp (#6560, #6709). False, and nothing is kept, outside such an open.
|
|
117
179
|
*/
|
|
118
180
|
export declare function restampStorageSchemaAtOpenEnd(database: SqliteDatabase, stamp: SqliteSchemaStamp, setup: (tx: SqliteExecutor) => Promise<unknown>, options?: SchemaStampAtOpenEnd): boolean;
|
|
119
181
|
//# sourceMappingURL=schema-catalog.d.ts.map
|