@cchistory/lite 0.4.5 → 0.6.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 +7 -5
- package/apps/lite-cli/dist/agent-contract.d.ts.map +1 -1
- package/apps/lite-cli/dist/agent-contract.js +36 -25
- package/apps/lite-cli/dist/agent-contract.js.map +1 -1
- package/apps/lite-cli/dist/bin.js +2 -2
- 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 +151 -66
- package/apps/lite-cli/dist/index.js.map +1 -1
- package/apps/lite-cli/dist/index.test.js +59 -89
- 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 +2 -2
- 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 +6 -2
- package/apps/lite-tui/dist/index.js.map +1 -1
- package/apps/lite-tui/dist/index.test.js +10 -8
- 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 +2 -2
- package/bin/cchistory-lite.mjs +2 -2
- package/docs/guide/for-agents.md +66 -46
- package/docs/guide/lite.md +53 -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 +1 -1
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.d.ts.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/bootstrap.js +1 -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 +314 -143
- 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/launcher-memory.d.ts +12 -0
- package/node_modules/@cchistory/live-runtime/dist/launcher-memory.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/launcher-memory.js +44 -0
- package/node_modules/@cchistory/live-runtime/dist/launcher-memory.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/launcher-memory.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/launcher-memory.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/launcher-memory.test.js +20 -0
- package/node_modules/@cchistory/live-runtime/dist/launcher-memory.test.js.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/live-read-recovery.test.d.ts +2 -0
- package/node_modules/@cchistory/live-runtime/dist/live-read-recovery.test.d.ts.map +1 -0
- package/node_modules/@cchistory/live-runtime/dist/live-read-recovery.test.js +92 -0
- package/node_modules/@cchistory/live-runtime/dist/live-read-recovery.test.js.map +1 -0
- 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 +22 -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 -47
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.js.map +1 -1
- package/node_modules/@cchistory/live-runtime/dist/scan-guard.test.js +287 -83
- 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 +171 -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 +81 -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/jsonl-records.test.js +31 -1
- package/node_modules/@cchistory/source-adapters/dist/core/jsonl-records.test.js.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts +4 -3
- package/node_modules/@cchistory/source-adapters/dist/core/parser.d.ts.map +1 -1
- package/node_modules/@cchistory/source-adapters/dist/core/parser.js +32 -13
- 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 +46 -45
- 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 +76 -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 +126 -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,40 @@
|
|
|
1
|
+
@lexer lexerAny
|
|
2
|
+
@include "base.ne"
|
|
3
|
+
|
|
4
|
+
array_of[EXP] -> $EXP (%comma $EXP {% last %}):* {% ([head, tail]) => {
|
|
5
|
+
return [unwrap(head), ...(tail.map(unwrap) || [])];
|
|
6
|
+
} %}
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# https://www.postgresql.org/docs/13/sql-createtype.html
|
|
10
|
+
|
|
11
|
+
createtype_statement -> %kw_create kw_type qualified_name (
|
|
12
|
+
createtype_enum | createtype_composite
|
|
13
|
+
) {% x => track(x, {
|
|
14
|
+
name: x[2],
|
|
15
|
+
...unwrap(x[3]),
|
|
16
|
+
}) %}
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
# ==== ENUM TYPE
|
|
20
|
+
createtype_enum -> %kw_as kw_enum lparen array_of[enum_value] rparen {% x => track(x, {
|
|
21
|
+
type: 'create enum',
|
|
22
|
+
values: x[3],
|
|
23
|
+
}) %}
|
|
24
|
+
|
|
25
|
+
enum_value -> string {% x => track(x, {value: toStr(x) }) %}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
# ==== COMPOSITE TYPE
|
|
29
|
+
createtype_composite -> %kw_as lparen array_of[createtype_composite_attr] rparen {% x => track(x, {
|
|
30
|
+
type: 'create composite type',
|
|
31
|
+
attributes: x[2],
|
|
32
|
+
}) %}
|
|
33
|
+
|
|
34
|
+
createtype_composite_attr -> word data_type createtable_collate:? {% x => {
|
|
35
|
+
return track(x, {
|
|
36
|
+
name: asName(x[0]),
|
|
37
|
+
dataType: x[1],
|
|
38
|
+
...x[2] ? { collate: x[2][1] }: {},
|
|
39
|
+
})
|
|
40
|
+
} %}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import 'mocha';
|
|
2
|
+
import 'chai';
|
|
3
|
+
import { checkStatement } from './spec-utils';
|
|
4
|
+
|
|
5
|
+
describe('Create types', () => {
|
|
6
|
+
|
|
7
|
+
checkStatement([`create type myType as enum ('a', 'b')`], {
|
|
8
|
+
type: 'create enum',
|
|
9
|
+
name: { name: 'mytype' },
|
|
10
|
+
values: [{ value: 'a' }, { value: 'b' }],
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
checkStatement([`CREATE TYPE weight AS (
|
|
15
|
+
unit text,
|
|
16
|
+
value double precision collate abc
|
|
17
|
+
)`], {
|
|
18
|
+
type: 'create composite type',
|
|
19
|
+
name: { name: 'weight' },
|
|
20
|
+
attributes: [
|
|
21
|
+
{
|
|
22
|
+
name: { name: 'unit' },
|
|
23
|
+
dataType: { name: 'text' },
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: { name: 'value' },
|
|
27
|
+
dataType: { name: 'double precision' },
|
|
28
|
+
collate: { name: 'abc' },
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
@lexer lexerAny
|
|
2
|
+
@include "base.ne"
|
|
3
|
+
|
|
4
|
+
array_of[EXP] -> $EXP (%comma $EXP {% last %}):* {% ([head, tail]) => {
|
|
5
|
+
return [unwrap(head), ...(tail.map(unwrap) || [])];
|
|
6
|
+
} %}
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
# https://www.postgresql.org/docs/current/sql-createview.html
|
|
10
|
+
create_view_statements -> create_view | create_materialized_view
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
create_view -> %kw_create
|
|
14
|
+
(%kw_or kw_replace):?
|
|
15
|
+
(kw_temp | kw_temporary):?
|
|
16
|
+
kw_recursive:?
|
|
17
|
+
kw_view
|
|
18
|
+
qualified_name
|
|
19
|
+
(lparen array_of[ident] rparen {% get(1) %}):?
|
|
20
|
+
create_view_opts:?
|
|
21
|
+
%kw_as
|
|
22
|
+
selection
|
|
23
|
+
(%kw_with (kw_local | kw_cascaded) %kw_check kw_option {% get(1) %}):? {% x => {
|
|
24
|
+
return track(x, {
|
|
25
|
+
type: 'create view',
|
|
26
|
+
... x[1] && {orReplace: true},
|
|
27
|
+
... x[2] && {temp: true},
|
|
28
|
+
... x[3] && {recursive: true},
|
|
29
|
+
name: x[5],
|
|
30
|
+
... x[6] && {columnNames: x[6].map(asName)},
|
|
31
|
+
... x[7] && {parameters: fromEntries(x[7])},
|
|
32
|
+
query: x[9],
|
|
33
|
+
... x[10] && { checkOption: toStr(x[10]) },
|
|
34
|
+
})
|
|
35
|
+
} %}
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
create_view_opt -> ident %op_eq ident {% ([a, _, b]) => [toStr(a), toStr(b)] %}
|
|
41
|
+
|
|
42
|
+
create_view_opts -> %kw_with array_of[create_view_opt] {% last %}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
# https://www.postgresql.org/docs/current/sql-creatematerializedview.html
|
|
46
|
+
|
|
47
|
+
create_materialized_view -> %kw_create
|
|
48
|
+
kw_materialized
|
|
49
|
+
kw_view
|
|
50
|
+
kw_ifnotexists:?
|
|
51
|
+
qualified_name
|
|
52
|
+
(lparen array_of[ident] rparen {% get(1) %}):?
|
|
53
|
+
create_view_opts:?
|
|
54
|
+
(kw_tablespace ident {% last %}):?
|
|
55
|
+
%kw_as
|
|
56
|
+
selection
|
|
57
|
+
(%kw_with kw_no:? kw_data):? {% x => {
|
|
58
|
+
return track(x, {
|
|
59
|
+
type: 'create materialized view',
|
|
60
|
+
... x[3] && {ifNotExists: true},
|
|
61
|
+
name: x[4],
|
|
62
|
+
... x[5] && {columnNames: x[6].map(asName)},
|
|
63
|
+
... x[6] && {parameters: fromEntries(x[6])},
|
|
64
|
+
... x[7] && {tablespace: asName(x[7]) },
|
|
65
|
+
query: x[9],
|
|
66
|
+
... x[10] && { withData: toStr(x[10][1]) !== 'no' },
|
|
67
|
+
})
|
|
68
|
+
} %}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import 'mocha';
|
|
2
|
+
import 'chai';
|
|
3
|
+
import { checkInvalid, checkStatement, columns, tbl } from './spec-utils';
|
|
4
|
+
|
|
5
|
+
describe('Create view statements', () => {
|
|
6
|
+
|
|
7
|
+
checkStatement(`create view myview as select * from tbl`, {
|
|
8
|
+
type: 'create view',
|
|
9
|
+
name: { name: 'myview' },
|
|
10
|
+
query: {
|
|
11
|
+
type: 'select',
|
|
12
|
+
columns: columns('*'),
|
|
13
|
+
from: [tbl('tbl')],
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
checkStatement(`create or replace view myview (a,b) as select * from tbl`, {
|
|
19
|
+
type: 'create view',
|
|
20
|
+
name: { name: 'myview' },
|
|
21
|
+
columnNames: [{ name: 'a' }, { name: 'b' }],
|
|
22
|
+
orReplace: true,
|
|
23
|
+
query: {
|
|
24
|
+
type: 'select',
|
|
25
|
+
columns: columns('*'),
|
|
26
|
+
from: [tbl('tbl')],
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
checkStatement(`create view myview (a) as select * from tbl`, {
|
|
33
|
+
type: 'create view',
|
|
34
|
+
name: { name: 'myview' },
|
|
35
|
+
columnNames: [{ name: 'a' }],
|
|
36
|
+
query: {
|
|
37
|
+
type: 'select',
|
|
38
|
+
columns: columns('*'),
|
|
39
|
+
from: [tbl('tbl')],
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
checkStatement(`create recursive view myview as select * from tbl`, {
|
|
45
|
+
type: 'create view',
|
|
46
|
+
name: { name: 'myview' },
|
|
47
|
+
recursive: true,
|
|
48
|
+
query: {
|
|
49
|
+
type: 'select',
|
|
50
|
+
columns: columns('*'),
|
|
51
|
+
from: [tbl('tbl')],
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
checkStatement(`create view myview as select * from tbl with local check option`, {
|
|
57
|
+
type: 'create view',
|
|
58
|
+
name: { name: 'myview' },
|
|
59
|
+
checkOption: 'local',
|
|
60
|
+
query: {
|
|
61
|
+
type: 'select',
|
|
62
|
+
columns: columns('*'),
|
|
63
|
+
from: [tbl('tbl')],
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
checkStatement(`create view myview as select * from tbl with cascaded check option`, {
|
|
68
|
+
type: 'create view',
|
|
69
|
+
name: { name: 'myview' },
|
|
70
|
+
checkOption: 'cascaded',
|
|
71
|
+
query: {
|
|
72
|
+
type: 'select',
|
|
73
|
+
columns: columns('*'),
|
|
74
|
+
from: [tbl('tbl')],
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
checkStatement([`create temp view myview as select * from tbl`, `CREATE TEMPORARY VIEW myview AS select * from tbl`], {
|
|
79
|
+
type: 'create view',
|
|
80
|
+
name: { name: 'myview' },
|
|
81
|
+
temp: true,
|
|
82
|
+
query: {
|
|
83
|
+
type: 'select',
|
|
84
|
+
columns: columns('*'),
|
|
85
|
+
from: [tbl('tbl')],
|
|
86
|
+
},
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
checkStatement([`create materialized view myview as select * from tbl`], {
|
|
92
|
+
type: 'create materialized view',
|
|
93
|
+
name: { name: 'myview' },
|
|
94
|
+
query: {
|
|
95
|
+
type: 'select',
|
|
96
|
+
columns: columns('*'),
|
|
97
|
+
from: [tbl('tbl')],
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
checkStatement([`create view myview with pa = va as select * from tbl`], {
|
|
104
|
+
type: 'create view',
|
|
105
|
+
name: { name: 'myview' },
|
|
106
|
+
parameters: { pa: 'va' },
|
|
107
|
+
query: {
|
|
108
|
+
type: 'select',
|
|
109
|
+
columns: columns('*'),
|
|
110
|
+
from: [tbl('tbl')],
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
checkStatement([`create view public.myview as select * from tbl`], {
|
|
115
|
+
type: 'create view',
|
|
116
|
+
name: { name: 'myview', schema: 'public', },
|
|
117
|
+
query: {
|
|
118
|
+
type: 'select',
|
|
119
|
+
columns: columns('*'),
|
|
120
|
+
from: [tbl('tbl')],
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
checkStatement([`create materialized view myview with pa = va as select * from tbl`], {
|
|
125
|
+
type: 'create materialized view',
|
|
126
|
+
name: { name: 'myview' },
|
|
127
|
+
parameters: { pa: 'va' },
|
|
128
|
+
query: {
|
|
129
|
+
type: 'select',
|
|
130
|
+
columns: columns('*'),
|
|
131
|
+
from: [tbl('tbl')],
|
|
132
|
+
},
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
checkStatement([`create materialized view myview with pa = va, pb = vb as select * from tbl`], {
|
|
136
|
+
type: 'create materialized view',
|
|
137
|
+
name: { name: 'myview' },
|
|
138
|
+
parameters: { pa: 'va', pb: 'vb' },
|
|
139
|
+
query: {
|
|
140
|
+
type: 'select',
|
|
141
|
+
columns: columns('*'),
|
|
142
|
+
from: [tbl('tbl')],
|
|
143
|
+
},
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
checkStatement([`create materialized view myview as select * from tbl with data`], {
|
|
149
|
+
type: 'create materialized view',
|
|
150
|
+
name: { name: 'myview' },
|
|
151
|
+
query: {
|
|
152
|
+
type: 'select',
|
|
153
|
+
columns: columns('*'),
|
|
154
|
+
from: [tbl('tbl')],
|
|
155
|
+
},
|
|
156
|
+
withData: true,
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
checkStatement([`create materialized view myview as select * from tbl with no data`], {
|
|
161
|
+
type: 'create materialized view',
|
|
162
|
+
name: { name: 'myview' },
|
|
163
|
+
query: {
|
|
164
|
+
type: 'select',
|
|
165
|
+
columns: columns('*'),
|
|
166
|
+
from: [tbl('tbl')],
|
|
167
|
+
},
|
|
168
|
+
withData: false,
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
checkStatement([`create materialized view public.myview as select * from tbl`], {
|
|
173
|
+
type: 'create materialized view',
|
|
174
|
+
name: {
|
|
175
|
+
name: 'myview',
|
|
176
|
+
schema: 'public',
|
|
177
|
+
},
|
|
178
|
+
query: {
|
|
179
|
+
type: 'select',
|
|
180
|
+
columns: columns('*'),
|
|
181
|
+
from: [tbl('tbl')],
|
|
182
|
+
},
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
checkInvalid(`create view myview as select * from tbl with data`);
|
|
186
|
+
checkInvalid(`create or replace materialized view myview as select * from tbl with data`);
|
|
187
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@lexer lexerAny
|
|
2
|
+
|
|
3
|
+
deallocate -> kw_deallocate kw_prepare:? deallocate_target {% x => track(x, {
|
|
4
|
+
type: 'deallocate',
|
|
5
|
+
target: x[2],
|
|
6
|
+
}) %}
|
|
7
|
+
|
|
8
|
+
deallocate_target
|
|
9
|
+
-> deallocate_all {% unwrap %}
|
|
10
|
+
| deallocate_name {% unwrap %}
|
|
11
|
+
|
|
12
|
+
deallocate_name -> ident {% x => track(x, asName(x[0]) ) %}
|
|
13
|
+
deallocate_all -> %kw_all {% x => track(x, { option: 'all' }) %}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import 'mocha';
|
|
2
|
+
import 'chai';
|
|
3
|
+
|
|
4
|
+
import { checkStatement } from './spec-utils';
|
|
5
|
+
|
|
6
|
+
describe('Create types', () => {
|
|
7
|
+
checkStatement(['DEALLOCATE identifier', 'DEALLOCATE PREPARE identifier'], {
|
|
8
|
+
target: {
|
|
9
|
+
name: 'identifier',
|
|
10
|
+
},
|
|
11
|
+
type: 'deallocate',
|
|
12
|
+
});
|
|
13
|
+
checkStatement(['DEALLOCATE ALL', 'DEALLOCATE PREPARE ALL'], {
|
|
14
|
+
target: {
|
|
15
|
+
option: 'all',
|
|
16
|
+
},
|
|
17
|
+
type: 'deallocate',
|
|
18
|
+
});
|
|
19
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@lexer lexerAny
|
|
2
|
+
@include "base.ne"
|
|
3
|
+
@include "expr.ne"
|
|
4
|
+
@include "select.ne"
|
|
5
|
+
|
|
6
|
+
array_of[EXP] -> $EXP (%comma $EXP {% last %}):* {% ([head, tail]) => {
|
|
7
|
+
return [unwrap(head), ...(tail.map(unwrap) || [])];
|
|
8
|
+
} %}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# https://www.postgresql.org/docs/12/sql-delete.html
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
delete_statement -> delete_delete | delete_truncate
|
|
15
|
+
|
|
16
|
+
delete_delete -> (kw_delete %kw_from)
|
|
17
|
+
table_ref_aliased
|
|
18
|
+
select_where:?
|
|
19
|
+
(%kw_returning select_expr_list_aliased {% last %}):?
|
|
20
|
+
{% x => {
|
|
21
|
+
const where = x[2];
|
|
22
|
+
const returning = x[3];
|
|
23
|
+
return track(x, {
|
|
24
|
+
type: 'delete',
|
|
25
|
+
from: unwrap(x[1]),
|
|
26
|
+
...where ? { where } : {},
|
|
27
|
+
...returning ? { returning } : {},
|
|
28
|
+
});
|
|
29
|
+
} %}
|
|
30
|
+
|
|
31
|
+
delete_truncate -> (kw_truncate %kw_table:?) array_of[table_ref] ((kw_restart | kw_continue) kw_identity):? (kw_restrict | kw_cascade):? {% x => track(x, {
|
|
32
|
+
type: 'truncate table',
|
|
33
|
+
tables: x[1],
|
|
34
|
+
...x[2] && { identity: toStr(x[2][0]) },
|
|
35
|
+
... x[3] && {cascade: toStr(x[3]) },
|
|
36
|
+
}) %}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import 'mocha';
|
|
2
|
+
import 'chai';
|
|
3
|
+
import { checkDelete, checkStatement } from './spec-utils';
|
|
4
|
+
|
|
5
|
+
describe('Delete', () => {
|
|
6
|
+
|
|
7
|
+
checkDelete([`delete from test where a = b`], {
|
|
8
|
+
type: 'delete',
|
|
9
|
+
from: { name: 'test' },
|
|
10
|
+
where: {
|
|
11
|
+
type: 'binary',
|
|
12
|
+
op: '=',
|
|
13
|
+
left: { type: 'ref', name: 'a' },
|
|
14
|
+
right: { type: 'ref', name: 'b' },
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
checkStatement([`truncate test`, `truncate table test`], {
|
|
20
|
+
type: 'truncate table',
|
|
21
|
+
tables: [{ name: 'test' }]
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
checkStatement([`truncate test restart identity`, `truncate table test restart identity`], {
|
|
25
|
+
type: 'truncate table',
|
|
26
|
+
tables: [{ name: 'test' }],
|
|
27
|
+
identity: 'restart'
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
checkStatement([`truncate test continue identity`, `truncate table test continue identity`], {
|
|
31
|
+
type: 'truncate table',
|
|
32
|
+
tables: [{ name: 'test' }],
|
|
33
|
+
identity: 'continue'
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
checkStatement([`TRUNCATE TABLE t1,t2 RESTART IDENTITY CASCADE`], {
|
|
37
|
+
type: 'truncate table',
|
|
38
|
+
tables: [{ name: 't1' }, { name: 't2' }],
|
|
39
|
+
identity: 'restart',
|
|
40
|
+
cascade: 'cascade',
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
checkStatement([`TRUNCATE TABLE t1,t2 CASCADE`], {
|
|
44
|
+
type: 'truncate table',
|
|
45
|
+
tables: [{ name: 't1' }, { name: 't2' }],
|
|
46
|
+
cascade: 'cascade',
|
|
47
|
+
});
|
|
48
|
+
checkStatement([`TRUNCATE TABLE t1,t2 restrict`], {
|
|
49
|
+
type: 'truncate table',
|
|
50
|
+
tables: [{ name: 't1' }, { name: 't2' }],
|
|
51
|
+
cascade: 'restrict',
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
checkStatement([`truncate ta, "tb"`, `truncate table "ta","tb"`], {
|
|
55
|
+
type: 'truncate table',
|
|
56
|
+
tables: [{ name: 'ta' }, { name: 'tb' }]
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
checkDelete([`delete from test`], {
|
|
60
|
+
type: 'delete',
|
|
61
|
+
from: { name: 'test' },
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
checkDelete([`delete from test returning *`], {
|
|
65
|
+
type: 'delete',
|
|
66
|
+
from: { name: 'test' },
|
|
67
|
+
returning: [{
|
|
68
|
+
expr: { type: 'ref', name: '*' }
|
|
69
|
+
}]
|
|
70
|
+
});
|
|
71
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@lexer lexerAny
|
|
2
|
+
@include "base.ne"
|
|
3
|
+
|
|
4
|
+
array_of[EXP] -> $EXP (%comma $EXP {% last %}):* {% ([head, tail]) => {
|
|
5
|
+
return [unwrap(head), ...(tail.map(unwrap) || [])];
|
|
6
|
+
} %}
|
|
7
|
+
|
|
8
|
+
# https://www.postgresql.org/docs/9.3/sql-dropindex.html
|
|
9
|
+
|
|
10
|
+
drop_statement -> kw_drop drop_what kw_ifexists:? array_of[qualified_name] (kw_cascade | kw_restrict):? {% (x: any, rej: any) => {
|
|
11
|
+
const v = unwrap(x[1]);
|
|
12
|
+
return track(x, {
|
|
13
|
+
...v,
|
|
14
|
+
... x[2] && {ifExists: true},
|
|
15
|
+
names: x[3],
|
|
16
|
+
... x[4] && {cascade: toStr(x[4]) },
|
|
17
|
+
});
|
|
18
|
+
}%}
|
|
19
|
+
|
|
20
|
+
drop_what
|
|
21
|
+
-> %kw_table {% x => track(x, { type: 'drop table' }) %}
|
|
22
|
+
| kw_sequence {% x => track(x, { type: 'drop sequence' }) %}
|
|
23
|
+
| kw_type {% x => track(x, { type: 'drop type' }) %}
|
|
24
|
+
| kw_trigger {% x => track(x, { type: 'drop trigger' }) %}
|
|
25
|
+
| kw_index %kw_concurrently:? {% x => track(x, {
|
|
26
|
+
type: 'drop index',
|
|
27
|
+
...x[1] && {concurrently: true },
|
|
28
|
+
}) %}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import 'mocha';
|
|
2
|
+
import 'chai';
|
|
3
|
+
import { checkStatement } from './spec-utils';
|
|
4
|
+
|
|
5
|
+
describe('Drop', () => {
|
|
6
|
+
|
|
7
|
+
checkStatement([`drop table test`], {
|
|
8
|
+
type: 'drop table',
|
|
9
|
+
names: [{ name: 'test' }],
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
checkStatement([`drop table if exists test`], {
|
|
13
|
+
type: 'drop table',
|
|
14
|
+
names: [{ name: 'test' }],
|
|
15
|
+
ifExists: true,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
checkStatement([`DROP TABLE IF EXISTS "Users" CASCADE`], {
|
|
19
|
+
type: 'drop table',
|
|
20
|
+
names: [{ name: 'Users' }],
|
|
21
|
+
ifExists: true,
|
|
22
|
+
cascade: 'cascade',
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
checkStatement([`DROP TABLE IF EXISTS a, b CASCADE`], {
|
|
27
|
+
type: 'drop table',
|
|
28
|
+
names: [{ name: 'a' }, { name: 'b' }],
|
|
29
|
+
ifExists: true,
|
|
30
|
+
cascade: 'cascade',
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
checkStatement([`DROP TYPE IF EXISTS a, b CASCADE`], {
|
|
35
|
+
type: 'drop type',
|
|
36
|
+
names: [{ name: 'a' }, { name: 'b' }],
|
|
37
|
+
ifExists: true,
|
|
38
|
+
cascade: 'cascade',
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
checkStatement([`DROP TABLE IF EXISTS "Users" RESTRICT`], {
|
|
42
|
+
type: 'drop table',
|
|
43
|
+
names: [{ name: 'Users' }],
|
|
44
|
+
ifExists: true,
|
|
45
|
+
cascade: 'restrict',
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
checkStatement([`drop index test`, `DROP INDEX"test"`], {
|
|
50
|
+
type: 'drop index',
|
|
51
|
+
names: [{ name: 'test' }],
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
checkStatement([`DROP INDEX"pub"."test"`], {
|
|
55
|
+
type: 'drop index',
|
|
56
|
+
names: [{ name: 'test', schema: 'pub' }],
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
checkStatement([`DROP SEQUENCE test`], {
|
|
61
|
+
type: 'drop sequence',
|
|
62
|
+
names: [{ name: 'test' }],
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
checkStatement([`DROP TRIGGER test`], {
|
|
66
|
+
type: 'drop trigger',
|
|
67
|
+
names: [{ name: 'test' }],
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
checkStatement([`drop index concurrently if exists test`], {
|
|
71
|
+
type: 'drop index',
|
|
72
|
+
names: [{ name: 'test' }],
|
|
73
|
+
concurrently: true,
|
|
74
|
+
ifExists: true,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import 'mocha';
|
|
2
|
+
import 'chai';
|
|
3
|
+
import { checkCreateTable, checkCreateTableLoc, checkInvalid, checkValid } from './spec-utils';
|
|
4
|
+
import { parse, parseFirst } from '../parser';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
describe('Edge cases', () => {
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
// https://github.com/oguimbal/pg-mem/issues/171
|
|
11
|
+
describe('Behaviour with table named after keywords', () => {
|
|
12
|
+
const validName = (name: string) => {
|
|
13
|
+
const [schema, qname] = name.split('.');
|
|
14
|
+
checkCreateTable([`create table ${name}(value text)`], {
|
|
15
|
+
type: 'create table',
|
|
16
|
+
name: qname ? { name: qname, schema } : { name },
|
|
17
|
+
columns: [{
|
|
18
|
+
kind: 'column',
|
|
19
|
+
name: { name: 'value' },
|
|
20
|
+
dataType: {
|
|
21
|
+
name: 'text',
|
|
22
|
+
},
|
|
23
|
+
}],
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
const invalidName = (name: string) => checkInvalid(`create table ${name}(value text)`);
|
|
27
|
+
|
|
28
|
+
invalidName('order');
|
|
29
|
+
invalidName('authorization');
|
|
30
|
+
|
|
31
|
+
validName('precision');
|
|
32
|
+
validName(`public.order`);
|
|
33
|
+
validName(`public.asc`);
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
checkInvalid(`select a precision from (values('a')) as foo(a)`);
|
|
37
|
+
checkValid(`select double val from (values('a')) as foo(double)`)
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
});
|