@cchistory/lite 0.4.5 → 0.5.0
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/INSTALL.md +1 -1
- package/apps/lite-cli/dist/agent-contract.d.ts +4 -5
- package/apps/lite-cli/dist/agent-contract.d.ts.map +1 -1
- package/apps/lite-cli/dist/agent-contract.js +32 -25
- package/apps/lite-cli/dist/agent-contract.js.map +1 -1
- package/apps/lite-cli/dist/bin.js +3 -3
- package/apps/lite-cli/dist/bin.js.map +1 -1
- package/apps/lite-cli/dist/index.d.ts.map +1 -1
- package/apps/lite-cli/dist/index.js +147 -66
- package/apps/lite-cli/dist/index.js.map +1 -1
- package/apps/lite-cli/dist/index.test.js +76 -60
- package/apps/lite-cli/dist/index.test.js.map +1 -1
- package/apps/lite-cli/dist/query.d.ts +4 -1
- package/apps/lite-cli/dist/query.d.ts.map +1 -1
- package/apps/lite-cli/dist/query.js +45 -29
- package/apps/lite-cli/dist/query.js.map +1 -1
- package/apps/lite-cli/dist/resource-errors.d.ts +3 -0
- package/apps/lite-cli/dist/resource-errors.d.ts.map +1 -0
- package/apps/lite-cli/dist/resource-errors.js +17 -0
- package/apps/lite-cli/dist/resource-errors.js.map +1 -0
- package/apps/lite-cli/dist/shell.d.ts +12 -2
- package/apps/lite-cli/dist/shell.d.ts.map +1 -1
- package/apps/lite-cli/dist/shell.js +129 -57
- package/apps/lite-cli/dist/shell.js.map +1 -1
- package/apps/lite-cli/dist/sql-query.test.d.ts +2 -0
- package/apps/lite-cli/dist/sql-query.test.d.ts.map +1 -0
- package/apps/lite-cli/dist/sql-query.test.js +290 -0
- package/apps/lite-cli/dist/sql-query.test.js.map +1 -0
- package/apps/lite-cli/dist/version.d.ts +1 -1
- package/apps/lite-cli/dist/version.js +1 -1
- package/apps/lite-tui/dist/bin.js +3 -3
- package/apps/lite-tui/dist/bin.js.map +1 -1
- package/apps/lite-tui/dist/index.d.ts.map +1 -1
- package/apps/lite-tui/dist/index.js +2 -2
- package/apps/lite-tui/dist/index.js.map +1 -1
- package/apps/lite-tui/dist/index.test.js +5 -3
- package/apps/lite-tui/dist/index.test.js.map +1 -1
- package/apps/lite-tui/dist/render.d.ts +1 -1
- package/apps/lite-tui/dist/version.d.ts +1 -1
- package/apps/lite-tui/dist/version.js +1 -1
- package/bin/cchistory-lite-tui.mjs +3 -3
- package/bin/cchistory-lite.mjs +3 -3
- package/docs/guide/for-agents.md +65 -46
- package/docs/guide/lite.md +49 -11
- package/docs/guide/queries/latest-sessions.sql +4 -0
- package/docs/guide/queries/latest-turns.sql +1 -0
- package/docs/guide/queries/list-sessions.sql +2 -0
- package/docs/guide/query.md +153 -0
- package/node_modules/@cchistory/canonical/dist/directory-scope.d.ts +7 -0
- package/node_modules/@cchistory/canonical/dist/directory-scope.d.ts.map +1 -1
- package/node_modules/@cchistory/canonical/dist/directory-scope.js +11 -0
- package/node_modules/@cchistory/canonical/dist/directory-scope.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/index.d.ts +5 -1
- package/node_modules/@cchistory/canonical/dist/index.d.ts.map +1 -1
- package/node_modules/@cchistory/canonical/dist/index.js +5 -1
- package/node_modules/@cchistory/canonical/dist/index.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/query.d.ts +15 -0
- package/node_modules/@cchistory/canonical/dist/query.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/query.js +208 -0
- package/node_modules/@cchistory/canonical/dist/query.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-family.d.ts +1 -0
- package/node_modules/@cchistory/canonical/dist/session-family.d.ts.map +1 -1
- package/node_modules/@cchistory/canonical/dist/session-family.js +3 -0
- package/node_modules/@cchistory/canonical/dist/session-family.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/session-family.test.js +61 -0
- package/node_modules/@cchistory/canonical/dist/session-family.test.js.map +1 -1
- package/node_modules/@cchistory/canonical/dist/session-interpreter.d.ts +30 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.js +713 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.js.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.test.d.ts +2 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.test.d.ts.map +1 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.test.js +56 -0
- package/node_modules/@cchistory/canonical/dist/session-interpreter.test.js.map +1 -0
- package/node_modules/@cchistory/canonical/package.json +1 -1
- package/node_modules/@cchistory/domain/dist/evidence-atoms.d.ts +7 -0
- package/node_modules/@cchistory/domain/dist/evidence-atoms.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/evidence-atoms.js +36 -0
- package/node_modules/@cchistory/domain/dist/evidence-atoms.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/evidence-values.d.ts +26 -0
- package/node_modules/@cchistory/domain/dist/evidence-values.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/evidence-values.js +80 -0
- package/node_modules/@cchistory/domain/dist/evidence-values.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/index.d.ts +6 -0
- package/node_modules/@cchistory/domain/dist/index.d.ts.map +1 -1
- package/node_modules/@cchistory/domain/dist/index.js +5 -0
- package/node_modules/@cchistory/domain/dist/index.js.map +1 -1
- package/node_modules/@cchistory/domain/dist/masks.d.ts +31 -0
- package/node_modules/@cchistory/domain/dist/masks.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/masks.js +342 -0
- package/node_modules/@cchistory/domain/dist/masks.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/parsed-session.d.ts +58 -0
- package/node_modules/@cchistory/domain/dist/parsed-session.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/parsed-session.js +2 -0
- package/node_modules/@cchistory/domain/dist/parsed-session.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/query.d.ts +67 -0
- package/node_modules/@cchistory/domain/dist/query.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/query.js +2 -0
- package/node_modules/@cchistory/domain/dist/query.js.map +1 -0
- package/node_modules/@cchistory/domain/dist/token-evidence.d.ts +14 -0
- package/node_modules/@cchistory/domain/dist/token-evidence.d.ts.map +1 -0
- package/node_modules/@cchistory/domain/dist/token-evidence.js +247 -0
- package/node_modules/@cchistory/domain/dist/token-evidence.js.map +1 -0
- package/node_modules/@cchistory/domain/package.json +1 -1
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.d.ts +0 -1
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.d.ts.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.js +0 -1
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/index.d.ts +30 -9
- package/node_modules/@cchistory/live-runtime/dist/index.d.ts.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/index.js +263 -142
- package/node_modules/@cchistory/live-runtime/dist/index.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/index.test.js +177 -20
- package/node_modules/@cchistory/live-runtime/dist/index.test.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.d.ts +16 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.js +55 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.js +192 -0
- package/node_modules/@cchistory/live-runtime/dist/preparation-metadata.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.d.ts +21 -22
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.d.ts.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.js +53 -41
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.test.js +266 -57
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.test.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/selective-query.d.ts +47 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.js +15 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.test.js +166 -0
- package/node_modules/@cchistory/live-runtime/dist/selective-query.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.d.ts +37 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.js +301 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.test.js +67 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-query.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-worker.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-worker.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-worker.js +14 -0
- package/node_modules/@cchistory/live-runtime/dist/sql-worker.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/system-memory.d.ts +13 -10
- package/node_modules/@cchistory/live-runtime/dist/system-memory.d.ts.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/system-memory.js +61 -34
- package/node_modules/@cchistory/live-runtime/dist/system-memory.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/system-memory.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/system-memory.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/system-memory.test.js +76 -0
- package/node_modules/@cchistory/live-runtime/dist/system-memory.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/package.json +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/core/discovery.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/factories.d.ts +2 -4
- package/node_modules/@cchistory/source-adapters/dist/core/factories.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/factories.js +1 -23
- package/node_modules/@cchistory/source-adapters/dist/core/factories.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.d.ts +25 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.js +80 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.js +122 -0
- package/node_modules/@cchistory/source-adapters/dist/core/file-read-plan.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.d.ts +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.js +2 -11
- package/node_modules/@cchistory/source-adapters/dist/core/git-project.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts +2 -1
- package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/parser.js +4 -4
- package/node_modules/@cchistory/source-adapters/dist/core/parser.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/probe.d.ts +8 -6
- package/node_modules/@cchistory/source-adapters/dist/core/probe.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/probe.js +54 -36
- package/node_modules/@cchistory/source-adapters/dist/core/probe.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/projections.d.ts +2 -28
- package/node_modules/@cchistory/source-adapters/dist/core/projections.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/projections.js +2 -695
- package/node_modules/@cchistory/source-adapters/dist/core/projections.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/projections.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/core/projections.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.d.ts +18 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.js +27 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.js +75 -0
- package/node_modules/@cchistory/source-adapters/dist/core/read-budget.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.d.ts +6 -0
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/session-grouping.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/source-identity.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.d.ts +1 -13
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.js +1 -246
- package/node_modules/@cchistory/source-adapters/dist/core/token-usage.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/tokens.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/tokens.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.d.ts +1 -25
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.js +1 -79
- package/node_modules/@cchistory/source-adapters/dist/core/type-guards.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/types.d.ts +6 -35
- package/node_modules/@cchistory/source-adapters/dist/core/types.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.d.ts +2 -1
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.js +14 -10
- package/node_modules/@cchistory/source-adapters/dist/core/vscode-state.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/index.d.ts +6 -0
- package/node_modules/@cchistory/source-adapters/dist/index.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/index.js +4 -0
- package/node_modules/@cchistory/source-adapters/dist/index.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts +2 -0
- package/node_modules/@cchistory/source-adapters/dist/index.test.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/index.test.js +2 -0
- package/node_modules/@cchistory/source-adapters/dist/index.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/masks.d.ts +1 -30
- package/node_modules/@cchistory/source-adapters/dist/masks.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/masks.js +1 -341
- package/node_modules/@cchistory/source-adapters/dist/masks.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/accio.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/amp.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/antigravity.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/claude.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/codebuddy.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.d.ts +14 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.js +103 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex/activity-evidence.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/codex.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.d.ts +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.js +5 -3
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor/runtime.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor-agent.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/cursor.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/factory-droid.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/gemini.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.js +24 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/grok.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/kimi.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/lobechat.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.test.js +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/openclaw.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/opencode.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.d.ts +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.js +11 -9
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode/runtime.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.test.js +2 -1
- package/node_modules/@cchistory/source-adapters/dist/platforms/zcode.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.d.ts +8 -0
- package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.d.ts.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.js +7 -0
- package/node_modules/@cchistory/source-adapters/dist/probe-reference.test.js.map +1 -0
- package/node_modules/@cchistory/source-adapters/dist/test-helpers.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/package.json +1 -1
- package/node_modules/commander/LICENSE +22 -0
- package/node_modules/commander/Readme.md +428 -0
- package/node_modules/commander/index.js +1224 -0
- package/node_modules/commander/package.json +38 -0
- package/node_modules/commander/typings/index.d.ts +310 -0
- package/node_modules/discontinuous-range/.npmignore +28 -0
- package/node_modules/discontinuous-range/.travis.yml +4 -0
- package/node_modules/discontinuous-range/LICENSE +21 -0
- package/node_modules/discontinuous-range/README.md +23 -0
- package/node_modules/discontinuous-range/index.js +144 -0
- package/node_modules/discontinuous-range/package.json +27 -0
- package/node_modules/discontinuous-range/test/main-test.js +96 -0
- package/node_modules/moo/LICENSE +29 -0
- package/node_modules/moo/README.md +385 -0
- package/node_modules/moo/moo.js +645 -0
- package/node_modules/moo/package.json +29 -0
- package/node_modules/nearley/LICENSE.txt +21 -0
- package/node_modules/nearley/README.md +80 -0
- package/node_modules/nearley/bin/nearley-railroad.js +121 -0
- package/node_modules/nearley/bin/nearley-test.js +64 -0
- package/node_modules/nearley/bin/nearley-unparse.js +29 -0
- package/node_modules/nearley/bin/nearleyc.js +38 -0
- package/node_modules/nearley/builtin/cow.ne +2 -0
- package/node_modules/nearley/builtin/number.ne +51 -0
- package/node_modules/nearley/builtin/postprocessors.ne +36 -0
- package/node_modules/nearley/builtin/string.ne +26 -0
- package/node_modules/nearley/builtin/whitespace.ne +5 -0
- package/node_modules/nearley/lib/compile.js +307 -0
- package/node_modules/nearley/lib/generate.js +244 -0
- package/node_modules/nearley/lib/lint.js +28 -0
- package/node_modules/nearley/lib/nearley-language-bootstrapped.js +132 -0
- package/node_modules/nearley/lib/nearley-language-bootstrapped.ne +126 -0
- package/node_modules/nearley/lib/nearley.js +564 -0
- package/node_modules/nearley/lib/stream.js +18 -0
- package/node_modules/nearley/lib/unparse.js +139 -0
- package/node_modules/nearley/package.json +63 -0
- package/node_modules/pgsql-ast-parser/ast-mapper.d.ts +237 -0
- package/node_modules/pgsql-ast-parser/ast-mapper.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/ast-mapper.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/ast-mapper.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/ast-visitor.d.ts +33 -0
- package/node_modules/pgsql-ast-parser/ast-visitor.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/ast-visitor.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/ast-visitor.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/index.d.ts +11 -0
- package/node_modules/pgsql-ast-parser/index.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/index.js +6484 -0
- package/node_modules/pgsql-ast-parser/index.js.map +1 -0
- package/node_modules/pgsql-ast-parser/interfaces.d.ts +1 -0
- package/node_modules/pgsql-ast-parser/interfaces.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/keywords.d.ts +2 -0
- package/node_modules/pgsql-ast-parser/keywords.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/lexer.d.ts +15 -0
- package/node_modules/pgsql-ast-parser/lexer.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/lexer.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/lexer.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array-lexer.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array-lexer.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array.ne.d.ts +29 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array.ne.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/array.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric-lexer.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric-lexer.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.ne.d.ts +29 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.ne.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/geometric.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-builder.d.ts +10 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-builder.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso-lexer.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso-lexer.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso.ne.d.ts +29 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-iso.ne.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-lexer.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval-lexer.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.ne.d.ts +29 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.ne.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/literal-syntaxes/interval.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/package.json +69 -0
- package/node_modules/pgsql-ast-parser/parser.d.ts +33 -0
- package/node_modules/pgsql-ast-parser/parser.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/pg-escape.d.ts +2 -0
- package/node_modules/pgsql-ast-parser/pg-escape.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/readme.md +255 -0
- package/node_modules/pgsql-ast-parser/src/ast-mapper.spec.ts +296 -0
- package/node_modules/pgsql-ast-parser/src/ast-mapper.ts +1378 -0
- package/node_modules/pgsql-ast-parser/src/ast-visitor.spec.ts +57 -0
- package/node_modules/pgsql-ast-parser/src/ast-visitor.ts +101 -0
- package/node_modules/pgsql-ast-parser/src/index.ts +10 -0
- package/node_modules/pgsql-ast-parser/src/interfaces.ts +0 -0
- package/node_modules/pgsql-ast-parser/src/keywords.ts +8 -0
- package/node_modules/pgsql-ast-parser/src/lexer.spec.ts +245 -0
- package/node_modules/pgsql-ast-parser/src/lexer.ts +267 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/array-lexer.ts +27 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/array.ne +18 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/array.spec.ts +55 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/geometric-lexer.ts +26 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/geometric.ne +88 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/geometric.spec.ts +131 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-builder.ts +148 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-iso-lexer.ts +17 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-iso.ne +53 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval-lexer.ts +26 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval.ne +54 -0
- package/node_modules/pgsql-ast-parser/src/literal-syntaxes/interval.spec.ts +106 -0
- package/node_modules/pgsql-ast-parser/src/parser.ts +142 -0
- package/node_modules/pgsql-ast-parser/src/pg-escape.ts +14 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-index.ne +29 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-index.spec.ts +35 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-table.ne +123 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-table.spec.ts +476 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-type.ne +33 -0
- package/node_modules/pgsql-ast-parser/src/syntax/alter-type.spec.ts +29 -0
- package/node_modules/pgsql-ast-parser/src/syntax/ast.ts +1150 -0
- package/node_modules/pgsql-ast-parser/src/syntax/base.ne +369 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-extension.ne +17 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-extension.spec.ts +37 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-index.ne +62 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-index.spec.ts +245 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-table.ne +174 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-table.spec.ts +761 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-type.ne +40 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-type.spec.ts +32 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-view.ne +68 -0
- package/node_modules/pgsql-ast-parser/src/syntax/create-view.spec.ts +187 -0
- package/node_modules/pgsql-ast-parser/src/syntax/deallocate.ne +13 -0
- package/node_modules/pgsql-ast-parser/src/syntax/deallocate.spec.ts +19 -0
- package/node_modules/pgsql-ast-parser/src/syntax/delete.ne +36 -0
- package/node_modules/pgsql-ast-parser/src/syntax/delete.spec.ts +71 -0
- package/node_modules/pgsql-ast-parser/src/syntax/drop.ne +28 -0
- package/node_modules/pgsql-ast-parser/src/syntax/drop.spec.ts +77 -0
- package/node_modules/pgsql-ast-parser/src/syntax/edge-cases.spec.ts +41 -0
- package/node_modules/pgsql-ast-parser/src/syntax/expr.ne +350 -0
- package/node_modules/pgsql-ast-parser/src/syntax/expr.spec.ts +1638 -0
- package/node_modules/pgsql-ast-parser/src/syntax/functions.ne +114 -0
- package/node_modules/pgsql-ast-parser/src/syntax/functions.spec.ts +235 -0
- package/node_modules/pgsql-ast-parser/src/syntax/insert.ne +63 -0
- package/node_modules/pgsql-ast-parser/src/syntax/insert.spec.ts +292 -0
- package/node_modules/pgsql-ast-parser/src/syntax/main.ne +77 -0
- package/node_modules/pgsql-ast-parser/src/syntax/nearley.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/src/syntax/prepare.ne +8 -0
- package/node_modules/pgsql-ast-parser/src/syntax/prepare.spec.ts +44 -0
- package/node_modules/pgsql-ast-parser/src/syntax/refresh-materialized-view.ne +19 -0
- package/node_modules/pgsql-ast-parser/src/syntax/refresh-materialized-view.spec.ts +42 -0
- package/node_modules/pgsql-ast-parser/src/syntax/select.ne +223 -0
- package/node_modules/pgsql-ast-parser/src/syntax/select.spec.ts +1063 -0
- package/node_modules/pgsql-ast-parser/src/syntax/sequence.ne +101 -0
- package/node_modules/pgsql-ast-parser/src/syntax/sequence.spec.ts +103 -0
- package/node_modules/pgsql-ast-parser/src/syntax/simple-statements.ne +168 -0
- package/node_modules/pgsql-ast-parser/src/syntax/simple-statements.spec.ts +327 -0
- package/node_modules/pgsql-ast-parser/src/syntax/spec-utils.ts +333 -0
- package/node_modules/pgsql-ast-parser/src/syntax/union.ne +18 -0
- package/node_modules/pgsql-ast-parser/src/syntax/union.spec.ts +125 -0
- package/node_modules/pgsql-ast-parser/src/syntax/update.ne +56 -0
- package/node_modules/pgsql-ast-parser/src/syntax/update.spec.ts +87 -0
- package/node_modules/pgsql-ast-parser/src/syntax/with.ne +41 -0
- package/node_modules/pgsql-ast-parser/src/syntax/with.spec.ts +155 -0
- package/node_modules/pgsql-ast-parser/src/to-sql.spec.ts +85 -0
- package/node_modules/pgsql-ast-parser/src/to-sql.ts +1555 -0
- package/node_modules/pgsql-ast-parser/src/utils.ts +47 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-index.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-index.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-table.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-table.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-type.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/alter-type.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/ast.d.ts +826 -0
- package/node_modules/pgsql-ast-parser/syntax/ast.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/create-extension.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/create-extension.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/create-index.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/create-index.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/create-table.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/create-table.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/create-type.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/create-type.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/create-view.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/create-view.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/deallocate.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/deallocate.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/delete.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/delete.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/drop.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/drop.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/edge-cases.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/edge-cases.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/expr.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/expr.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/functions.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/functions.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/insert.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/insert.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/main.ne.d.ts +29 -0
- package/node_modules/pgsql-ast-parser/syntax/main.ne.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/prepare.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/prepare.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/refresh-materialized-view.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/refresh-materialized-view.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/select.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/select.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/sequence.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/sequence.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/simple-statements.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/simple-statements.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/spec-utils.d.ts +35 -0
- package/node_modules/pgsql-ast-parser/syntax/spec-utils.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/union.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/union.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/update.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/update.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/syntax/with.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/syntax/with.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/to-sql.d.ts +7 -0
- package/node_modules/pgsql-ast-parser/to-sql.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/to-sql.spec.d.ts +3 -0
- package/node_modules/pgsql-ast-parser/to-sql.spec.d.ts.map +1 -0
- package/node_modules/pgsql-ast-parser/utils.d.ts +16 -0
- package/node_modules/pgsql-ast-parser/utils.d.ts.map +1 -0
- package/node_modules/railroad-diagrams/.gitattributes +22 -0
- package/node_modules/railroad-diagrams/.npmignore +163 -0
- package/node_modules/railroad-diagrams/README.md +86 -0
- package/node_modules/railroad-diagrams/css-example.py-js +183 -0
- package/node_modules/railroad-diagrams/example.html +141 -0
- package/node_modules/railroad-diagrams/generator.html +59 -0
- package/node_modules/railroad-diagrams/package.json +23 -0
- package/node_modules/railroad-diagrams/railroad-diagrams.css +23 -0
- package/node_modules/railroad-diagrams/railroad-diagrams.js +524 -0
- package/node_modules/railroad-diagrams/railroad_diagrams.py +427 -0
- package/node_modules/randexp/LICENSE +19 -0
- package/node_modules/randexp/README.md +134 -0
- package/node_modules/randexp/lib/randexp.js +245 -0
- package/node_modules/randexp/package.json +48 -0
- package/node_modules/ret/LICENSE +19 -0
- package/node_modules/ret/README.md +183 -0
- package/node_modules/ret/lib/index.js +282 -0
- package/node_modules/ret/lib/positions.js +17 -0
- package/node_modules/ret/lib/sets.js +82 -0
- package/node_modules/ret/lib/types.js +10 -0
- package/node_modules/ret/lib/util.js +111 -0
- package/node_modules/ret/package.json +35 -0
- package/package.json +22 -6
- package/schemas/cchistory-lite-agent-v1.schema.json +6 -7
- package/schemas/cchistory-lite-error-v1.schema.json +58 -8
- package/schemas/cchistory-lite-query-result-v2.schema.json +66 -11
- package/schemas/cchistory-lite-query-result-v3.schema.json +219 -0
- package/schemas/cchistory-lite-query-v3.schema.json +57 -0
- package/schemas/cchistory-lite-source-inventory-v1.schema.json +72 -0
- package/skills/using-cchistory-lite/SKILL.md +125 -55
- package/node_modules/@cchistory/live-runtime/dist/node-memory.d.ts +0 -8
- package/node_modules/@cchistory/live-runtime/dist/node-memory.d.ts.map +0 -1
- package/node_modules/@cchistory/live-runtime/dist/node-memory.js +0 -110
- package/node_modules/@cchistory/live-runtime/dist/node-memory.js.map +0 -1
|
@@ -0,0 +1,476 @@
|
|
|
1
|
+
import 'mocha';
|
|
2
|
+
import 'chai';
|
|
3
|
+
import { checkAlterTable, checkAlterTableLoc, checkInvalid } from './spec-utils';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
describe('Alter table', () => {
|
|
7
|
+
|
|
8
|
+
checkAlterTableLoc(['alter table test rename to newname'], {
|
|
9
|
+
_location: { start: 0, end: 34 },
|
|
10
|
+
type: 'alter table',
|
|
11
|
+
table: {
|
|
12
|
+
_location: { start: 12, end: 16 },
|
|
13
|
+
name: 'test'
|
|
14
|
+
},
|
|
15
|
+
changes: [{
|
|
16
|
+
_location: { start: 17, end: 34 },
|
|
17
|
+
type: 'rename',
|
|
18
|
+
to: {
|
|
19
|
+
_location: { start: 27, end: 34 },
|
|
20
|
+
name: 'newname'
|
|
21
|
+
},
|
|
22
|
+
}]
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
checkAlterTable(['alter table if exists only test rename to newname'], {
|
|
26
|
+
type: 'alter table',
|
|
27
|
+
table: { name: 'test' },
|
|
28
|
+
ifExists: true,
|
|
29
|
+
only: true,
|
|
30
|
+
changes: [{
|
|
31
|
+
type: 'rename',
|
|
32
|
+
to: { name: 'newname' },
|
|
33
|
+
}]
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
checkAlterTable(['alter table ONLY test rename to newname'], {
|
|
37
|
+
type: 'alter table',
|
|
38
|
+
table: { name: 'test' },
|
|
39
|
+
only: true,
|
|
40
|
+
changes: [{
|
|
41
|
+
type: 'rename',
|
|
42
|
+
to: { name: 'newname' },
|
|
43
|
+
}]
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
checkAlterTable(['alter table test rename column a to b', 'alter table test rename a to b',], {
|
|
47
|
+
type: 'alter table',
|
|
48
|
+
table: { name: 'test' },
|
|
49
|
+
changes: [{
|
|
50
|
+
type: 'rename column',
|
|
51
|
+
column: { name: 'a' },
|
|
52
|
+
to: { name: 'b', },
|
|
53
|
+
}]
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
checkAlterTable(['alter table test rename constraint a to b',], {
|
|
57
|
+
type: 'alter table',
|
|
58
|
+
table: { name: 'test' },
|
|
59
|
+
changes: [{
|
|
60
|
+
type: 'rename constraint',
|
|
61
|
+
constraint: { name: 'a' },
|
|
62
|
+
to: { name: 'b' },
|
|
63
|
+
}]
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
checkAlterTable(['alter table test add column a jsonb not null', 'alter table test add a jsonb not null'], {
|
|
67
|
+
type: 'alter table',
|
|
68
|
+
table: { name: 'test' },
|
|
69
|
+
changes: [{
|
|
70
|
+
type: 'add column',
|
|
71
|
+
column: {
|
|
72
|
+
kind: 'column',
|
|
73
|
+
name: { name: 'a' },
|
|
74
|
+
dataType: { name: 'jsonb' },
|
|
75
|
+
constraints: [{ type: 'not null' }],
|
|
76
|
+
},
|
|
77
|
+
}]
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
checkAlterTable(['alter table test add column if not exists a jsonb not null', 'alter table test add if not exists a jsonb not null'], {
|
|
81
|
+
type: 'alter table',
|
|
82
|
+
table: { name: 'test' },
|
|
83
|
+
changes: [{
|
|
84
|
+
type: 'add column',
|
|
85
|
+
ifNotExists: true,
|
|
86
|
+
column: {
|
|
87
|
+
kind: 'column',
|
|
88
|
+
name: { name: 'a' },
|
|
89
|
+
dataType: { name: 'jsonb' },
|
|
90
|
+
constraints: [{ type: 'not null' }],
|
|
91
|
+
},
|
|
92
|
+
}]
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
checkAlterTable(['alter table test drop column if exists a', 'alter table test drop if exists a'], {
|
|
96
|
+
type: 'alter table',
|
|
97
|
+
table: { name: 'test' },
|
|
98
|
+
changes: [{
|
|
99
|
+
type: 'drop column',
|
|
100
|
+
column: { name: 'a' },
|
|
101
|
+
ifExists: true,
|
|
102
|
+
}]
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
checkAlterTable(['alter table test drop constraint if exists a'], {
|
|
107
|
+
type: 'alter table',
|
|
108
|
+
table: { name: 'test' },
|
|
109
|
+
changes: [{
|
|
110
|
+
type: 'drop constraint',
|
|
111
|
+
constraint: { name: 'a' },
|
|
112
|
+
ifExists: true,
|
|
113
|
+
}]
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
checkAlterTable(['alter table test drop constraint a cascade'], {
|
|
119
|
+
type: 'alter table',
|
|
120
|
+
table: { name: 'test' },
|
|
121
|
+
changes: [{
|
|
122
|
+
type: 'drop constraint',
|
|
123
|
+
constraint: { name: 'a' },
|
|
124
|
+
behaviour: 'cascade',
|
|
125
|
+
}]
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
checkAlterTable(['alter table test drop constraint a restrict'], {
|
|
129
|
+
type: 'alter table',
|
|
130
|
+
table: { name: 'test' },
|
|
131
|
+
changes: [{
|
|
132
|
+
type: 'drop constraint',
|
|
133
|
+
constraint: { name: 'a' },
|
|
134
|
+
behaviour: 'restrict',
|
|
135
|
+
}]
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
checkAlterTable(['alter table test drop column a', 'alter table test drop a'], {
|
|
141
|
+
type: 'alter table',
|
|
142
|
+
table: { name: 'test' },
|
|
143
|
+
changes: [{
|
|
144
|
+
type: 'drop column',
|
|
145
|
+
column: { name: 'a' },
|
|
146
|
+
}]
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
checkAlterTable(['alter table test alter column a set data type jsonb', 'alter table test alter a type jsonb'], {
|
|
150
|
+
type: 'alter table',
|
|
151
|
+
table: { name: 'test' },
|
|
152
|
+
changes: [{
|
|
153
|
+
type: 'alter column',
|
|
154
|
+
column: { name: 'a' },
|
|
155
|
+
alter: {
|
|
156
|
+
type: 'set type',
|
|
157
|
+
dataType: { name: 'jsonb' },
|
|
158
|
+
}
|
|
159
|
+
}]
|
|
160
|
+
});
|
|
161
|
+
checkAlterTable(['alter table test alter a set default 42'], {
|
|
162
|
+
type: 'alter table',
|
|
163
|
+
table: { name: 'test' },
|
|
164
|
+
changes: [{
|
|
165
|
+
type: 'alter column',
|
|
166
|
+
column: { name: 'a' },
|
|
167
|
+
alter: {
|
|
168
|
+
type: 'set default',
|
|
169
|
+
default: { type: 'integer', value: 42 }
|
|
170
|
+
}
|
|
171
|
+
}]
|
|
172
|
+
});
|
|
173
|
+
checkAlterTable(['alter table test alter a drop default'], {
|
|
174
|
+
type: 'alter table',
|
|
175
|
+
table: { name: 'test' },
|
|
176
|
+
changes: [{
|
|
177
|
+
type: 'alter column',
|
|
178
|
+
column: { name: 'a' },
|
|
179
|
+
alter: {
|
|
180
|
+
type: 'drop default',
|
|
181
|
+
}
|
|
182
|
+
}]
|
|
183
|
+
});
|
|
184
|
+
checkAlterTable(['alter table test alter a drop not null'], {
|
|
185
|
+
type: 'alter table',
|
|
186
|
+
table: { name: 'test' },
|
|
187
|
+
changes: [{
|
|
188
|
+
type: 'alter column',
|
|
189
|
+
column: { name: 'a' },
|
|
190
|
+
alter: {
|
|
191
|
+
type: 'drop not null',
|
|
192
|
+
}
|
|
193
|
+
}]
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
// "check" constraint must be surounded by parenthesis
|
|
198
|
+
checkInvalid(`ALTER TABLE tbl ADD CONSTRAINT "cname" check a > 0`);
|
|
199
|
+
|
|
200
|
+
checkAlterTableLoc(`ALTER TABLE tbl ADD CONSTRAINT "cname" check (a > 0)`, {
|
|
201
|
+
_location: { start: 0, end: 51 },
|
|
202
|
+
type: 'alter table',
|
|
203
|
+
table: {
|
|
204
|
+
_location: { start: 12, end: 15 },
|
|
205
|
+
name: 'tbl'
|
|
206
|
+
},
|
|
207
|
+
changes: [{
|
|
208
|
+
type: 'add constraint',
|
|
209
|
+
_location: { start: 16, end: 51 },
|
|
210
|
+
constraint: {
|
|
211
|
+
_location: { start: 20, end: 51 },
|
|
212
|
+
type: 'check',
|
|
213
|
+
constraintName: {
|
|
214
|
+
_location: { start: 31, end: 38 },
|
|
215
|
+
name: 'cname'
|
|
216
|
+
},
|
|
217
|
+
expr: {
|
|
218
|
+
_location: { start: 46, end: 51 },
|
|
219
|
+
type: 'binary',
|
|
220
|
+
left: {
|
|
221
|
+
_location: { start: 46, end: 47 },
|
|
222
|
+
type: 'ref', name: 'a'
|
|
223
|
+
},
|
|
224
|
+
op: '>',
|
|
225
|
+
right: {
|
|
226
|
+
_location: { start: 50, end: 51 },
|
|
227
|
+
type: 'integer', value: 0
|
|
228
|
+
},
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
}]
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
checkAlterTable(`ALTER TABLE tbl ADD check (a > 0)`, {
|
|
235
|
+
type: 'alter table',
|
|
236
|
+
table: { name: 'tbl' },
|
|
237
|
+
changes: [{
|
|
238
|
+
type: 'add constraint',
|
|
239
|
+
constraint: {
|
|
240
|
+
type: 'check',
|
|
241
|
+
expr: {
|
|
242
|
+
type: 'binary',
|
|
243
|
+
left: { type: 'ref', name: 'a' },
|
|
244
|
+
op: '>',
|
|
245
|
+
right: { type: 'integer', value: 0 },
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
}]
|
|
249
|
+
});
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
checkAlterTable(`ALTER TABLE "photo" ADD CONSTRAINT "FK_4494006ff358f754d07df5ccc87"
|
|
254
|
+
FOREIGN KEY ("userId")
|
|
255
|
+
REFERENCES "user"("id")
|
|
256
|
+
ON DELETE NO ACTION ON UPDATE NO ACTION;`, {
|
|
257
|
+
type: 'alter table',
|
|
258
|
+
table: { name: 'photo' },
|
|
259
|
+
changes: [{
|
|
260
|
+
type: 'add constraint',
|
|
261
|
+
constraint: {
|
|
262
|
+
type: 'foreign key',
|
|
263
|
+
constraintName: { name: 'FK_4494006ff358f754d07df5ccc87' },
|
|
264
|
+
localColumns: [{ name: 'userId' }],
|
|
265
|
+
foreignTable: { name: 'user' },
|
|
266
|
+
foreignColumns: [{ name: 'id' }],
|
|
267
|
+
onUpdate: 'no action',
|
|
268
|
+
onDelete: 'no action',
|
|
269
|
+
}
|
|
270
|
+
}]
|
|
271
|
+
});
|
|
272
|
+
|
|
273
|
+
|
|
274
|
+
checkAlterTable(`ALTER TABLE "test" ADD CONSTRAINT "cname"
|
|
275
|
+
PRIMARY KEY ("a", "b")`, {
|
|
276
|
+
type: 'alter table',
|
|
277
|
+
table: { name: 'test' },
|
|
278
|
+
changes: [{
|
|
279
|
+
type: 'add constraint',
|
|
280
|
+
constraint: {
|
|
281
|
+
type: 'primary key',
|
|
282
|
+
constraintName: { name: 'cname' },
|
|
283
|
+
columns: [{ name: 'a' }, { name: 'b' }],
|
|
284
|
+
}
|
|
285
|
+
}]
|
|
286
|
+
})
|
|
287
|
+
|
|
288
|
+
|
|
289
|
+
checkAlterTable(`ALTER TABLE public.tbl OWNER to postgres;`, {
|
|
290
|
+
type: 'alter table',
|
|
291
|
+
table: { name: 'tbl', schema: 'public' },
|
|
292
|
+
changes: [{
|
|
293
|
+
type: 'owner',
|
|
294
|
+
to: { name: 'postgres' },
|
|
295
|
+
}]
|
|
296
|
+
})
|
|
297
|
+
|
|
298
|
+
// https://github.com/oguimbal/pg-mem/issues/9
|
|
299
|
+
checkAlterTable(`ALTER TABLE ONLY public.location
|
|
300
|
+
ADD CONSTRAINT city_id_fk FOREIGN KEY (city_id) REFERENCES public.city(city_id) MATCH FULL;`, {
|
|
301
|
+
type: 'alter table',
|
|
302
|
+
table: { name: 'location', schema: 'public' },
|
|
303
|
+
only: true,
|
|
304
|
+
changes: [{
|
|
305
|
+
type: 'add constraint',
|
|
306
|
+
constraint: {
|
|
307
|
+
type: 'foreign key',
|
|
308
|
+
constraintName: { name: 'city_id_fk' },
|
|
309
|
+
localColumns: [{ name: 'city_id' }],
|
|
310
|
+
foreignColumns: [{ name: 'city_id' }],
|
|
311
|
+
foreignTable: { name: 'city', schema: 'public' },
|
|
312
|
+
match: 'full',
|
|
313
|
+
}
|
|
314
|
+
}]
|
|
315
|
+
});
|
|
316
|
+
|
|
317
|
+
|
|
318
|
+
checkAlterTable(`ALTER TABLE public.city ALTER COLUMN city_id ADD GENERATED ALWAYS AS IDENTITY (
|
|
319
|
+
SEQUENCE NAME public.city_city_id_seq
|
|
320
|
+
START WITH 0
|
|
321
|
+
INCREMENT BY 1
|
|
322
|
+
MINVALUE 0
|
|
323
|
+
NO MAXVALUE
|
|
324
|
+
CACHE 1
|
|
325
|
+
);`, {
|
|
326
|
+
type: 'alter table',
|
|
327
|
+
table: { name: 'city', schema: 'public' },
|
|
328
|
+
changes: [{
|
|
329
|
+
type: 'alter column',
|
|
330
|
+
column: { name: 'city_id' },
|
|
331
|
+
alter: {
|
|
332
|
+
type: 'add generated',
|
|
333
|
+
always: 'always',
|
|
334
|
+
sequence: {
|
|
335
|
+
name: { name: 'city_city_id_seq', schema: 'public' },
|
|
336
|
+
startWith: 0,
|
|
337
|
+
incrementBy: 1,
|
|
338
|
+
minValue: 0,
|
|
339
|
+
maxValue: 'no maxvalue',
|
|
340
|
+
cache: 1,
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}]
|
|
344
|
+
})
|
|
345
|
+
|
|
346
|
+
// https://github.com/oguimbal/pgsql-ast-parser/issues/57
|
|
347
|
+
checkAlterTable(`
|
|
348
|
+
ALTER TABLE public.tbl
|
|
349
|
+
OWNER to postgres,
|
|
350
|
+
ADD check (a > 0);
|
|
351
|
+
`, {
|
|
352
|
+
type: 'alter table',
|
|
353
|
+
table: { name: 'tbl', schema: 'public' },
|
|
354
|
+
changes: [{
|
|
355
|
+
type: 'owner',
|
|
356
|
+
to: { name: 'postgres' },
|
|
357
|
+
}, {
|
|
358
|
+
type: 'add constraint',
|
|
359
|
+
constraint: {
|
|
360
|
+
type: 'check',
|
|
361
|
+
expr: {
|
|
362
|
+
type: 'binary',
|
|
363
|
+
left: { type: 'ref', name: 'a' },
|
|
364
|
+
op: '>',
|
|
365
|
+
right: { type: 'integer', value: 0 },
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
}]
|
|
369
|
+
})
|
|
370
|
+
|
|
371
|
+
checkAlterTable(`
|
|
372
|
+
ALTER TABLE public.tbl
|
|
373
|
+
OWNER to postgres,
|
|
374
|
+
ALTER COLUMN city_id ADD GENERATED ALWAYS AS IDENTITY (
|
|
375
|
+
SEQUENCE NAME public.city_city_id_seq
|
|
376
|
+
START WITH 0
|
|
377
|
+
INCREMENT BY 1
|
|
378
|
+
MINVALUE 0
|
|
379
|
+
NO MAXVALUE
|
|
380
|
+
CACHE 1
|
|
381
|
+
),
|
|
382
|
+
ADD check (a > 0);
|
|
383
|
+
`, {
|
|
384
|
+
type: 'alter table',
|
|
385
|
+
table: { name: 'tbl', schema: 'public' },
|
|
386
|
+
changes: [{
|
|
387
|
+
type: 'owner',
|
|
388
|
+
to: { name: 'postgres' },
|
|
389
|
+
}, {
|
|
390
|
+
type: 'alter column',
|
|
391
|
+
column: { name: 'city_id' },
|
|
392
|
+
alter: {
|
|
393
|
+
type: 'add generated',
|
|
394
|
+
always: 'always',
|
|
395
|
+
sequence: {
|
|
396
|
+
name: { name: 'city_city_id_seq', schema: 'public' },
|
|
397
|
+
startWith: 0,
|
|
398
|
+
incrementBy: 1,
|
|
399
|
+
minValue: 0,
|
|
400
|
+
maxValue: 'no maxvalue',
|
|
401
|
+
cache: 1,
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}, {
|
|
405
|
+
type: 'add constraint',
|
|
406
|
+
constraint: {
|
|
407
|
+
type: 'check',
|
|
408
|
+
expr: {
|
|
409
|
+
type: 'binary',
|
|
410
|
+
left: { type: 'ref', name: 'a' },
|
|
411
|
+
op: '>',
|
|
412
|
+
right: { type: 'integer', value: 0 },
|
|
413
|
+
}
|
|
414
|
+
},
|
|
415
|
+
}]
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
checkAlterTable(['ALTER TABLE foo DROP bar CASCADE'], {
|
|
420
|
+
type: 'alter table',
|
|
421
|
+
table: { name: 'foo' },
|
|
422
|
+
changes: [{
|
|
423
|
+
type: 'drop column',
|
|
424
|
+
column: { name: 'bar' },
|
|
425
|
+
behaviour: 'cascade',
|
|
426
|
+
}],
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
checkAlterTable(['alter table test drop column a cascade, drop column b restrict'], {
|
|
431
|
+
type: 'alter table',
|
|
432
|
+
table: { name: 'test' },
|
|
433
|
+
changes: [{
|
|
434
|
+
type: 'drop column',
|
|
435
|
+
column: { name: 'a' },
|
|
436
|
+
behaviour: 'cascade',
|
|
437
|
+
}, {
|
|
438
|
+
type: 'drop column',
|
|
439
|
+
column: { name: 'b' },
|
|
440
|
+
behaviour: 'restrict',
|
|
441
|
+
}],
|
|
442
|
+
});
|
|
443
|
+
|
|
444
|
+
checkAlterTable(['alter table test drop constraint a cascade, drop constraint b restrict'], {
|
|
445
|
+
type: 'alter table',
|
|
446
|
+
table: { name: 'test' },
|
|
447
|
+
changes: [{
|
|
448
|
+
type: 'drop constraint',
|
|
449
|
+
constraint: { name: 'a' },
|
|
450
|
+
behaviour: 'cascade',
|
|
451
|
+
}, {
|
|
452
|
+
type: 'drop constraint',
|
|
453
|
+
constraint: { name: 'b' },
|
|
454
|
+
behaviour: 'restrict',
|
|
455
|
+
}],
|
|
456
|
+
});
|
|
457
|
+
|
|
458
|
+
checkAlterTable([`alter table test add column b text generated always as (a + 'x') stored`], {
|
|
459
|
+
type: 'alter table',
|
|
460
|
+
table: { name: 'test' },
|
|
461
|
+
changes: [{
|
|
462
|
+
type: 'add column',
|
|
463
|
+
column: {
|
|
464
|
+
kind: 'column',
|
|
465
|
+
name: { name: 'b' },
|
|
466
|
+
dataType: { name: 'text' },
|
|
467
|
+
constraints: [{
|
|
468
|
+
type: 'add generated',
|
|
469
|
+
always: 'always',
|
|
470
|
+
expression: { type: 'binary', left: { type: 'ref', name: 'a' }, op: '+', right: { type: 'string', value: 'x' } },
|
|
471
|
+
stored: true,
|
|
472
|
+
}]
|
|
473
|
+
},
|
|
474
|
+
}],
|
|
475
|
+
})
|
|
476
|
+
});
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@lexer lexerAny
|
|
2
|
+
@include "base.ne"
|
|
3
|
+
|
|
4
|
+
# https://www.postgresql.org/docs/13/sql-altertype.html
|
|
5
|
+
|
|
6
|
+
altertype_statement -> kw_alter kw_type qualified_name (
|
|
7
|
+
altertype_enum_add_value | altertype_enum_rename
|
|
8
|
+
) {% x => track(x, {
|
|
9
|
+
name: x[2],
|
|
10
|
+
...unwrap(x[3]),
|
|
11
|
+
}) %}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# ==== ADD VALUE
|
|
15
|
+
altertype_enum_add_value -> kw_add kw_value enum_additional_value {% x => track(x, {
|
|
16
|
+
type: 'alter enum',
|
|
17
|
+
change: {
|
|
18
|
+
type: 'add value',
|
|
19
|
+
add: x[2]
|
|
20
|
+
}
|
|
21
|
+
}) %}
|
|
22
|
+
|
|
23
|
+
enum_additional_value -> string {% x => track(x, {value: toStr(x) }) %}
|
|
24
|
+
|
|
25
|
+
# ==== RENAME ENUM
|
|
26
|
+
altertype_enum_rename -> kw_rename %kw_to word {% x => track(x, {
|
|
27
|
+
type: 'alter enum',
|
|
28
|
+
change: {
|
|
29
|
+
type: 'rename',
|
|
30
|
+
to: asName(last(x))
|
|
31
|
+
}
|
|
32
|
+
}) %}
|
|
33
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import 'mocha';
|
|
2
|
+
import 'chai';
|
|
3
|
+
import { checkStatement } from './spec-utils';
|
|
4
|
+
|
|
5
|
+
describe('Alter types', () => {
|
|
6
|
+
|
|
7
|
+
checkStatement([`ALTER TYPE myType ADD VALUE 'c'`], {
|
|
8
|
+
type: 'alter enum',
|
|
9
|
+
name: { name: 'mytype' },
|
|
10
|
+
change: {
|
|
11
|
+
type: 'add value',
|
|
12
|
+
add: {
|
|
13
|
+
value: 'c'
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
checkStatement([`ALTER TYPE weight RENAME TO mass`], {
|
|
20
|
+
type: 'alter enum',
|
|
21
|
+
name: { name: 'weight' },
|
|
22
|
+
change: {
|
|
23
|
+
type: 'rename',
|
|
24
|
+
to: {
|
|
25
|
+
name: 'mass'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
});
|