@intentius/chant-lexicon-sql 0.124.45 → 0.124.48
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/dist/change-set.d.ts +1 -1
- package/dist/change-set.d.ts.map +1 -1
- package/dist/change-set.js +2 -1
- package/dist/clickhouse/apply/statements.d.ts +9 -0
- package/dist/clickhouse/apply/statements.d.ts.map +1 -1
- package/dist/clickhouse/apply/statements.js +24 -0
- package/dist/clickhouse/import/live-export.d.ts +7 -3
- package/dist/clickhouse/import/live-export.d.ts.map +1 -1
- package/dist/clickhouse/import/live-export.js +21 -5
- package/dist/clickhouse/live/named-collections.d.ts +27 -0
- package/dist/clickhouse/live/named-collections.d.ts.map +1 -0
- package/dist/clickhouse/live/named-collections.js +53 -0
- package/dist/clickhouse/live/undeclarable.d.ts +15 -3
- package/dist/clickhouse/live/undeclarable.d.ts.map +1 -1
- package/dist/clickhouse/live/undeclarable.js +18 -4
- package/dist/clickhouse/named-collections.d.ts +83 -0
- package/dist/clickhouse/named-collections.d.ts.map +1 -0
- package/dist/clickhouse/named-collections.js +203 -0
- package/dist/clickhouse/parser.d.ts.map +1 -1
- package/dist/clickhouse/parser.js +1 -1
- package/dist/clickhouse/plan/commands.d.ts +2 -1
- package/dist/clickhouse/plan/commands.d.ts.map +1 -1
- package/dist/clickhouse/plan/commands.js +17 -2
- package/dist/clickhouse/plan/diff.d.ts +15 -0
- package/dist/clickhouse/plan/diff.d.ts.map +1 -1
- package/dist/clickhouse/plan/diff.js +43 -1
- package/dist/clickhouse/plan/disruption.d.ts.map +1 -1
- package/dist/clickhouse/plan/disruption.js +5 -0
- package/dist/clickhouse/plan/rebuild-handoff.d.ts.map +1 -1
- package/dist/clickhouse/plan/rebuild-handoff.js +4 -0
- package/dist/clickhouse/plan/report.d.ts.map +1 -1
- package/dist/clickhouse/plan/report.js +6 -1
- package/dist/clickhouse/plan/rules.d.ts +5 -1
- package/dist/clickhouse/plan/rules.d.ts.map +1 -1
- package/dist/clickhouse/plan/rules.js +7 -3
- package/dist/clickhouse/plan/stream.d.ts +40 -0
- package/dist/clickhouse/plan/stream.d.ts.map +1 -0
- package/dist/clickhouse/plan/stream.js +107 -0
- package/dist/clickhouse/rebuild/observe.d.ts +3 -1
- package/dist/clickhouse/rebuild/observe.d.ts.map +1 -1
- package/dist/clickhouse/rebuild/observe.js +14 -1
- package/dist/clickhouse/review-catalog.d.ts +213 -0
- package/dist/clickhouse/review-catalog.d.ts.map +1 -0
- package/dist/clickhouse/review-catalog.js +330 -0
- package/dist/codegen/classifier-page.d.ts.map +1 -1
- package/dist/codegen/classifier-page.js +21 -4
- package/dist/codegen/clickhouse-module.d.ts.map +1 -1
- package/dist/codegen/clickhouse-module.js +3 -0
- package/dist/codegen/coverage-page.d.ts.map +1 -1
- package/dist/codegen/coverage-page.js +5 -3
- package/dist/codegen/docs.js +1 -1
- package/dist/codegen/postgres-classifier-page.js +1 -1
- package/dist/codegen/registry.d.ts.map +1 -1
- package/dist/codegen/registry.js +5 -0
- package/dist/composites/catalog.d.ts.map +1 -1
- package/dist/composites/catalog.js +100 -0
- package/dist/composites/clickhouse.d.ts +2 -0
- package/dist/composites/clickhouse.d.ts.map +1 -1
- package/dist/composites/clickhouse.js +2 -0
- package/dist/composites/otel-tables.d.ts +100 -0
- package/dist/composites/otel-tables.d.ts.map +1 -0
- package/dist/composites/otel-tables.js +282 -0
- package/dist/composites/stream-ingest.d.ts +63 -0
- package/dist/composites/stream-ingest.d.ts.map +1 -0
- package/dist/composites/stream-ingest.js +39 -0
- package/dist/coverage/clickhouse.json +1 -1
- package/dist/coverage/postgres.json +7 -7
- package/dist/coverage.d.ts +16 -6
- package/dist/coverage.d.ts.map +1 -1
- package/dist/coverage.js +10 -5
- package/dist/drizzle-command.d.ts +17 -0
- package/dist/drizzle-command.d.ts.map +1 -0
- package/dist/drizzle-command.js +91 -0
- package/dist/drizzle.d.ts +70 -0
- package/dist/drizzle.d.ts.map +1 -0
- package/dist/drizzle.js +684 -0
- package/dist/files/clickhouse.d.ts.map +1 -1
- package/dist/files/clickhouse.js +8 -1
- package/dist/files/common.d.ts +13 -0
- package/dist/files/common.d.ts.map +1 -1
- package/dist/files/common.js +5 -0
- package/dist/files/postgres.js +12 -2
- package/dist/generated/clickhouse.d.ts +2 -0
- package/dist/generated/clickhouse.d.ts.map +1 -1
- package/dist/generated/clickhouse.js +2 -0
- package/dist/import-parser.d.ts +21 -1
- package/dist/import-parser.d.ts.map +1 -1
- package/dist/import-parser.js +79 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/integrity.json +6 -5
- package/dist/lint/post-synth/audit-entries.d.ts.map +1 -1
- package/dist/lint/post-synth/audit-entries.js +1 -0
- package/dist/lint/post-synth/index.d.ts.map +1 -1
- package/dist/lint/post-synth/index.js +2 -0
- package/dist/lint/post-synth/sqlch128.d.ts +18 -0
- package/dist/lint/post-synth/sqlch128.d.ts.map +1 -0
- package/dist/lint/post-synth/sqlch128.js +222 -0
- package/dist/lint/rules/postgres-templates.js +2 -2
- package/dist/lsp/postgres-template.d.ts.map +1 -1
- package/dist/lsp/postgres-template.js +11 -0
- package/dist/manifest.json +1 -1
- package/dist/mcp/postgres.js +1 -1
- package/dist/meta.json +25 -0
- package/dist/migrate/from-postgres/detect.d.ts +4 -0
- package/dist/migrate/from-postgres/detect.d.ts.map +1 -0
- package/dist/migrate/from-postgres/detect.js +7 -0
- package/dist/migrate/from-postgres/emit.d.ts +26 -0
- package/dist/migrate/from-postgres/emit.d.ts.map +1 -0
- package/dist/migrate/from-postgres/emit.js +86 -0
- package/dist/migrate/from-postgres/index.d.ts +51 -0
- package/dist/migrate/from-postgres/index.d.ts.map +1 -0
- package/dist/migrate/from-postgres/index.js +115 -0
- package/dist/migrate/from-postgres/translate.d.ts +73 -0
- package/dist/migrate/from-postgres/translate.d.ts.map +1 -0
- package/dist/migrate/from-postgres/translate.js +261 -0
- package/dist/migrate/from-postgres/types.d.ts +51 -0
- package/dist/migrate/from-postgres/types.d.ts.map +1 -0
- package/dist/migrate/from-postgres/types.js +211 -0
- package/dist/migration-replay.d.ts +73 -0
- package/dist/migration-replay.d.ts.map +1 -0
- package/dist/migration-replay.js +294 -0
- package/dist/okf/index.md +6 -0
- package/dist/okf/rules/SQLCH128.md +11 -0
- package/dist/okf/types/PostgresForeignDataWrapper.md +9 -0
- package/dist/okf/types/PostgresForeignServer.md +9 -0
- package/dist/okf/types/PostgresOperator.md +9 -0
- package/dist/okf/types/PostgresPublication.md +9 -0
- package/dist/okf/types/PostgresStatistics.md +9 -0
- package/dist/op/activities/postgres-migration.d.ts.map +1 -1
- package/dist/op/activities/postgres-migration.js +4 -0
- package/dist/op/activity-contracts.d.ts +20 -0
- package/dist/op/activity-contracts.d.ts.map +1 -1
- package/dist/op/activity-contracts.js +2 -0
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +36 -2
- package/dist/postgres/apply/apply.js +8 -1
- package/dist/postgres/apply/statements.d.ts.map +1 -1
- package/dist/postgres/apply/statements.js +87 -2
- package/dist/postgres/constraint-names.d.ts +30 -0
- package/dist/postgres/constraint-names.d.ts.map +1 -0
- package/dist/postgres/constraint-names.js +72 -0
- package/dist/postgres/entities.d.ts +110 -1
- package/dist/postgres/entities.d.ts.map +1 -1
- package/dist/postgres/entities.js +146 -0
- package/dist/postgres/entity-types.d.ts +5 -0
- package/dist/postgres/entity-types.d.ts.map +1 -1
- package/dist/postgres/entity-types.js +5 -0
- package/dist/postgres/import/generator.d.ts.map +1 -1
- package/dist/postgres/import/generator.js +50 -2
- package/dist/postgres/import/live-export.d.ts.map +1 -1
- package/dist/postgres/import/live-export.js +2 -0
- package/dist/postgres/live/catalog-kinds.d.ts +14 -0
- package/dist/postgres/live/catalog-kinds.d.ts.map +1 -1
- package/dist/postgres/live/catalog-kinds.js +206 -0
- package/dist/postgres/live/catalog.d.ts +2 -0
- package/dist/postgres/live/catalog.d.ts.map +1 -1
- package/dist/postgres/live/catalog.js +3 -1
- package/dist/postgres/live/describe-resources.d.ts.map +1 -1
- package/dist/postgres/live/describe-resources.js +10 -2
- package/dist/postgres/migrate/backfill.d.ts +2 -0
- package/dist/postgres/migrate/backfill.d.ts.map +1 -1
- package/dist/postgres/migrate/backfill.js +7 -1
- package/dist/postgres/migrate/carry.d.ts +45 -1
- package/dist/postgres/migrate/carry.d.ts.map +1 -1
- package/dist/postgres/migrate/carry.js +72 -8
- package/dist/postgres/migrate/observe.d.ts +28 -4
- package/dist/postgres/migrate/observe.d.ts.map +1 -1
- package/dist/postgres/migrate/observe.js +41 -12
- package/dist/postgres/migrate/op.d.ts +26 -1
- package/dist/postgres/migrate/op.d.ts.map +1 -1
- package/dist/postgres/migrate/op.js +3 -1
- package/dist/postgres/migrate/steps.d.ts +35 -2
- package/dist/postgres/migrate/steps.d.ts.map +1 -1
- package/dist/postgres/migrate/steps.js +158 -12
- package/dist/postgres/parser.d.ts +72 -1
- package/dist/postgres/parser.d.ts.map +1 -1
- package/dist/postgres/parser.js +194 -2
- package/dist/postgres/plan/deep.d.ts.map +1 -1
- package/dist/postgres/plan/deep.js +29 -1
- package/dist/postgres/plan/diff.d.ts.map +1 -1
- package/dist/postgres/plan/diff.js +39 -1
- package/dist/postgres/plan/normalize.d.ts +17 -2
- package/dist/postgres/plan/normalize.d.ts.map +1 -1
- package/dist/postgres/plan/normalize.js +109 -1
- package/dist/postgres/plan/rules.d.ts +1 -0
- package/dist/postgres/plan/rules.d.ts.map +1 -1
- package/dist/postgres/plan/rules.js +3 -2
- package/dist/postgres/plan/schema.js +1 -1
- package/dist/postgres/secret-options.d.ts +10 -0
- package/dist/postgres/secret-options.d.ts.map +1 -0
- package/dist/postgres/secret-options.js +9 -0
- package/dist/postgres/testing/roundtrip-schema.d.ts +3 -2
- package/dist/postgres/testing/roundtrip-schema.d.ts.map +1 -1
- package/dist/postgres/testing/roundtrip-schema.js +13 -1
- package/dist/postgres.d.ts +1 -1
- package/dist/postgres.d.ts.map +1 -1
- package/dist/postgres.js +1 -1
- package/dist/rules/audit-entries.ts +1 -0
- package/dist/rules/postgres-templates.ts +2 -2
- package/dist/rules/sqlch128.ts +230 -0
- package/dist/serializer.d.ts +5 -0
- package/dist/serializer.d.ts.map +1 -1
- package/dist/serializer.js +13 -2
- package/dist/sql-types-command.d.ts +13 -0
- package/dist/sql-types-command.d.ts.map +1 -1
- package/dist/sql-types-command.js +31 -16
- package/dist/sql-types.d.ts +22 -0
- package/dist/sql-types.d.ts.map +1 -1
- package/dist/sql-types.js +10 -6
- package/dist/sqlserver/lexer.d.ts +37 -0
- package/dist/sqlserver/lexer.d.ts.map +1 -0
- package/dist/sqlserver/lexer.js +254 -0
- package/dist/sqlserver/parse.d.ts +185 -0
- package/dist/sqlserver/parse.d.ts.map +1 -0
- package/dist/sqlserver/parse.js +767 -0
- package/dist/sqlserver/translate.d.ts +34 -0
- package/dist/sqlserver/translate.d.ts.map +1 -0
- package/dist/sqlserver/translate.js +495 -0
- package/dist/sqlserver/types.d.ts +44 -0
- package/dist/sqlserver/types.d.ts.map +1 -0
- package/dist/sqlserver/types.js +133 -0
- package/dist/sqlserver/validate.d.ts +31 -0
- package/dist/sqlserver/validate.d.ts.map +1 -0
- package/dist/sqlserver/validate.js +67 -0
- package/dist/validate.d.ts.map +1 -1
- package/dist/validate.js +5 -0
- package/package.json +2 -2
- package/src/change-set.ts +2 -1
- package/src/clickhouse/apply/statements.ts +25 -0
- package/src/clickhouse/import/live-export.ts +20 -5
- package/src/clickhouse/live/named-collections.e2e.test.ts +88 -0
- package/src/clickhouse/live/named-collections.ts +61 -0
- package/src/clickhouse/live/undeclarable.e2e.test.ts +5 -3
- package/src/clickhouse/live/undeclarable.ts +20 -4
- package/src/clickhouse/named-collections.test.ts +187 -0
- package/src/clickhouse/named-collections.ts +224 -0
- package/src/clickhouse/parser.ts +2 -1
- package/src/clickhouse/plan/commands.ts +17 -2
- package/src/clickhouse/plan/diff.ts +57 -1
- package/src/clickhouse/plan/disruption.ts +5 -0
- package/src/clickhouse/plan/rebuild-handoff.ts +3 -0
- package/src/clickhouse/plan/report.ts +6 -1
- package/src/clickhouse/plan/rules.ts +14 -4
- package/src/clickhouse/plan/stream-s3queue.e2e.test.ts +148 -0
- package/src/clickhouse/plan/stream.test.ts +237 -0
- package/src/clickhouse/plan/stream.ts +111 -0
- package/src/clickhouse/rebuild/observe.ts +15 -1
- package/src/clickhouse/review-catalog.test.ts +181 -0
- package/src/clickhouse/review-catalog.ts +489 -0
- package/src/codegen/classifier-page.ts +21 -4
- package/src/codegen/clickhouse-module.ts +3 -0
- package/src/codegen/coverage-page.ts +5 -3
- package/src/codegen/docs.ts +1 -1
- package/src/codegen/postgres-classifier-page.ts +1 -1
- package/src/codegen/registry.ts +5 -0
- package/src/composites/catalog.test.ts +6 -1
- package/src/composites/catalog.ts +100 -0
- package/src/composites/clickhouse.ts +2 -0
- package/src/composites/composites.test.ts +1 -1
- package/src/composites/otel-tables.test.ts +118 -0
- package/src/composites/otel-tables.ts +339 -0
- package/src/composites/stream-ingest.test.ts +114 -0
- package/src/composites/stream-ingest.ts +82 -0
- package/src/core/undeclarable.test.ts +6 -5
- package/src/coverage/clickhouse.json +1 -1
- package/src/coverage/postgres.json +7 -7
- package/src/coverage.test.ts +27 -2
- package/src/coverage.ts +18 -7
- package/src/drizzle-command.ts +94 -0
- package/src/drizzle-kit.e2e.test.ts +89 -0
- package/src/drizzle-types.e2e.test.ts +67 -0
- package/src/drizzle.test.ts +358 -0
- package/src/drizzle.ts +737 -0
- package/src/files/clickhouse.ts +8 -1
- package/src/files/common.ts +14 -1
- package/src/files/postgres.ts +12 -2
- package/src/generated/clickhouse.ts +3 -0
- package/src/generated/lexicon-sql.json +25 -0
- package/src/import-parser.sqlserver.test.ts +92 -0
- package/src/import-parser.ts +79 -5
- package/src/index.ts +1 -1
- package/src/lint/post-synth/audit-entries.ts +1 -0
- package/src/lint/post-synth/index.ts +2 -0
- package/src/lint/post-synth/sqlch128.test.ts +107 -0
- package/src/lint/post-synth/sqlch128.ts +230 -0
- package/src/lint/rules/postgres-templates.ts +2 -2
- package/src/lsp/postgres-template.ts +11 -0
- package/src/mcp/postgres.ts +1 -1
- package/src/migrate/from-postgres/cli.test.ts +165 -0
- package/src/migrate/from-postgres/detect.ts +7 -0
- package/src/migrate/from-postgres/emit.ts +96 -0
- package/src/migrate/from-postgres/example.test.ts +205 -0
- package/src/migrate/from-postgres/index.ts +122 -0
- package/src/migrate/from-postgres/translate.test.ts +242 -0
- package/src/migrate/from-postgres/translate.ts +359 -0
- package/src/migrate/from-postgres/types.test.ts +116 -0
- package/src/migrate/from-postgres/types.ts +236 -0
- package/src/migrate/from-postgres/validate.e2e.test.ts +44 -0
- package/src/migrate/from-postgres/workspace.e2e.test.ts +114 -0
- package/src/migration-replay.e2e.test.ts +155 -0
- package/src/migration-replay.test.ts +173 -0
- package/src/migration-replay.ts +289 -0
- package/src/op/__snapshots__/watch-pipeline.test.ts.snap +2 -2
- package/src/op/activities/postgres-migration.ts +4 -0
- package/src/op/activity-contracts.ts +2 -0
- package/src/plugin.ts +37 -2
- package/src/postgres/apply/apply.ts +9 -1
- package/src/postgres/apply/statements.ts +74 -1
- package/src/postgres/constraint-names.ts +71 -0
- package/src/postgres/database-kinds.test.ts +384 -0
- package/src/postgres/entities.ts +266 -1
- package/src/postgres/entity-types.ts +5 -0
- package/src/postgres/import/generator.ts +42 -2
- package/src/postgres/import/live-export.ts +1 -0
- package/src/postgres/live/catalog-kinds.ts +223 -0
- package/src/postgres/live/catalog.ts +6 -1
- package/src/postgres/live/database-kinds.e2e.test.ts +164 -0
- package/src/postgres/live/describe-resources.ts +11 -2
- package/src/postgres/live/undeclarable.e2e.test.ts +13 -6
- package/src/postgres/migrate/backfill.ts +13 -1
- package/src/postgres/migrate/carry.ts +103 -8
- package/src/postgres/migrate/followups.e2e.test.ts +218 -0
- package/src/postgres/migrate/followups.test.ts +199 -0
- package/src/postgres/migrate/kinds.e2e.test.ts +5 -5
- package/src/postgres/migrate/observe.ts +53 -14
- package/src/postgres/migrate/op.ts +28 -1
- package/src/postgres/migrate/partition.e2e.test.ts +129 -0
- package/src/postgres/migrate/partition.test.ts +206 -0
- package/src/postgres/migrate/steps.ts +157 -12
- package/src/postgres/parser.ts +234 -2
- package/src/postgres/plan/deep.ts +28 -1
- package/src/postgres/plan/diff.ts +36 -1
- package/src/postgres/plan/normalize.ts +122 -1
- package/src/postgres/plan/rules.ts +10 -3
- package/src/postgres/plan/schema.ts +1 -1
- package/src/postgres/secret-options.ts +10 -0
- package/src/postgres/testing/roundtrip-schema.ts +13 -1
- package/src/postgres.ts +16 -0
- package/src/serializer.ts +13 -2
- package/src/skills/chant-sql-postgres-migration.md +3 -3
- package/src/skills/chant-sql-postgres.md +6 -1
- package/src/skills/chant-sql.md +2 -1
- package/src/sql-types-command.ts +38 -16
- package/src/sql-types.ts +11 -6
- package/src/sqlserver/fixture.test.ts +186 -0
- package/src/sqlserver/import-cli.test.ts +61 -0
- package/src/sqlserver/lexer.ts +260 -0
- package/src/sqlserver/parse.ts +865 -0
- package/src/sqlserver/translate.test.ts +396 -0
- package/src/sqlserver/translate.ts +558 -0
- package/src/sqlserver/types.test.ts +102 -0
- package/src/sqlserver/types.ts +154 -0
- package/src/sqlserver/validate.e2e.test.ts +32 -0
- package/src/sqlserver/validate.test.ts +49 -0
- package/src/sqlserver/validate.ts +76 -0
- package/src/validate.ts +5 -0
- package/src/workspace-kinds.test.ts +11 -0
- package/workspace-kinds.json +100 -2
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replay a migration directory into an empty server and read the catalog
|
|
3
|
+
* (#4400). The workspace kinds for goose, golang-migrate,
|
|
4
|
+
* clickhouse-migrations and Flyway list a directory's migrations without
|
|
5
|
+
* running anything (`packages/core/src/workspace/migration-dirs.ts`); the
|
|
6
|
+
* tables and columns they produce come from here.
|
|
7
|
+
*
|
|
8
|
+
* chant sql replay <dir> --kind <kind> --env <env> [--dir-field migrationsDir=<sub>] [--check]
|
|
9
|
+
*
|
|
10
|
+
* The replay applies each migration's up statements in the order the kind's
|
|
11
|
+
* reader lists them, then reads the tables, views and columns the server has
|
|
12
|
+
* and writes them as `chant.replay.json` beside the migrations, named by the
|
|
13
|
+
* contract of #3931: `<schema>.<table>` and `<schema>.<table>.<column>` for
|
|
14
|
+
* Postgres, `<database>.<table>` and `<database>.<table>.<column>` for
|
|
15
|
+
* ClickHouse. The file also holds a digest of the files it ran, so the
|
|
16
|
+
* reader knows when a migration changed after it. `--check` replays and
|
|
17
|
+
* compares instead of writing, exiting 1 when the file differs, the way
|
|
18
|
+
* `chant sql types --check` does.
|
|
19
|
+
*
|
|
20
|
+
* What it runs per kind:
|
|
21
|
+
* - goose: the `-- +goose Up` section of each file; `StatementBegin` to
|
|
22
|
+
* `StatementEnd` is one statement.
|
|
23
|
+
* - golang-migrate and clickhouse-migrations: the whole up file.
|
|
24
|
+
* - Flyway: the SQL files of the locations, versioned in version order and
|
|
25
|
+
* then repeatable ones, with placeholders substituted. Baseline and undo
|
|
26
|
+
* files are not run.
|
|
27
|
+
*
|
|
28
|
+
* The server must hold no table, view or column of its own: the replay
|
|
29
|
+
* refuses a server that does, since it cannot tell what the migrations made.
|
|
30
|
+
* It runs the migrations' SQL against the server `--env` binds, so point it
|
|
31
|
+
* at a throwaway server or emulator.
|
|
32
|
+
*/
|
|
33
|
+
import type { CommandGroupContext } from "@intentius/chant/cli/command-group";
|
|
34
|
+
import { type KindReadMigration, type KindReaderInput } from "@intentius/chant/workspace/kind-link-readers";
|
|
35
|
+
import { type ReplaySnapshot } from "@intentius/chant/workspace/migration-dirs";
|
|
36
|
+
import { type WorkspaceTree } from "@intentius/chant/workspace/tree";
|
|
37
|
+
export declare const REPLAY_KINDS: readonly ["goose", "golang-migrate", "clickhouse-migrations", "flyway"];
|
|
38
|
+
export type ReplayKind = (typeof REPLAY_KINDS)[number];
|
|
39
|
+
/** One server the replay runs on. */
|
|
40
|
+
export interface ReplayDb {
|
|
41
|
+
dialect: "postgres" | "clickhouse";
|
|
42
|
+
run(sql: string): Promise<void>;
|
|
43
|
+
rows(sql: string): Promise<Record<string, unknown>[]>;
|
|
44
|
+
close(): Promise<void>;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Split SQL text into statements at `;`. Single-quoted strings, quoted
|
|
48
|
+
* identifiers, `--` and `/* *\/` comments and Postgres dollar-quoted bodies
|
|
49
|
+
* hold semicolons without ending the statement. A statement of only
|
|
50
|
+
* comments is dropped.
|
|
51
|
+
*/
|
|
52
|
+
export declare function splitStatements(text: string): string[];
|
|
53
|
+
/** goose's Up statements: the lines between `-- +goose Up` and `-- +goose Down`; a StatementBegin to StatementEnd block is one statement. */
|
|
54
|
+
export declare function gooseUpStatements(text: string): string[];
|
|
55
|
+
export interface ReplayStep {
|
|
56
|
+
migration: KindReadMigration;
|
|
57
|
+
statements: string[];
|
|
58
|
+
}
|
|
59
|
+
/** The statements to run, per migration, in order. Throws when a Flyway placeholder has no value. */
|
|
60
|
+
export declare function replaySteps(kind: ReplayKind, tree: WorkspaceTree, dir: string, fields?: KindReaderInput["fields"]): {
|
|
61
|
+
steps: ReplayStep[];
|
|
62
|
+
files: string[];
|
|
63
|
+
dialect: string;
|
|
64
|
+
};
|
|
65
|
+
/** Apply each migration's statements; a failure names the migration file and the statement. */
|
|
66
|
+
export declare function applySteps(db: ReplayDb, steps: readonly ReplayStep[]): Promise<void>;
|
|
67
|
+
/** The tables, views and columns the server has, as workspace output names (#3931). */
|
|
68
|
+
export declare function readCatalogOutputs(db: ReplayDb): Promise<string[]>;
|
|
69
|
+
/** Replay a directory into `db`, which must hold nothing, and return the snapshot to record. */
|
|
70
|
+
export declare function replayDirectory(db: ReplayDb, kind: ReplayKind, tree: WorkspaceTree, dir: string, fields?: KindReaderInput["fields"]): Promise<ReplaySnapshot>;
|
|
71
|
+
export declare const renderSnapshot: (s: ReplaySnapshot) => string;
|
|
72
|
+
export declare function runReplay(ctx: CommandGroupContext): Promise<number>;
|
|
73
|
+
//# sourceMappingURL=migration-replay.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migration-replay.d.ts","sourceRoot":"","sources":["../src/migration-replay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAIH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAgB,KAAK,iBAAiB,EAAE,KAAK,eAAe,EAAE,MAAM,8CAA8C,CAAC;AAC1H,OAAO,EAA6C,KAAK,cAAc,EAAE,MAAM,2CAA2C,CAAC;AAE3H,OAAO,EAAe,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAElF,eAAO,MAAM,YAAY,yEAA0E,CAAC;AACpG,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAIvD,qCAAqC;AACrC,MAAM,WAAW,QAAQ;IACvB,OAAO,EAAE,UAAU,GAAG,YAAY,CAAC;IACnC,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChC,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC;IACtD,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB;AAED;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAyCtD;AAED,6IAA6I;AAC7I,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CA8BxD;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,iBAAiB,CAAC;IAC7B,UAAU,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,qGAAqG;AACrG,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAE,eAAe,CAAC,QAAQ,CAAQ,GAAG;IAAE,KAAK,EAAE,UAAU,EAAE,CAAC;IAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAWnL;AAED,+FAA+F;AAC/F,wBAAsB,UAAU,CAAC,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,UAAU,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAU1F;AAoBD,uFAAuF;AACvF,wBAAsB,kBAAkB,CAAC,EAAE,EAAE,QAAQ,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAaxE;AAED,gGAAgG;AAChG,wBAAsB,eAAe,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,GAAE,eAAe,CAAC,QAAQ,CAAQ,GAAG,OAAO,CAAC,cAAc,CAAC,CAOzK;AAED,eAAO,MAAM,cAAc,GAAI,GAAG,cAAc,KAAG,MAA2C,CAAC;AAiB/F,wBAAsB,SAAS,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CA2DzE"}
|
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Replay a migration directory into an empty server and read the catalog
|
|
3
|
+
* (#4400). The workspace kinds for goose, golang-migrate,
|
|
4
|
+
* clickhouse-migrations and Flyway list a directory's migrations without
|
|
5
|
+
* running anything (`packages/core/src/workspace/migration-dirs.ts`); the
|
|
6
|
+
* tables and columns they produce come from here.
|
|
7
|
+
*
|
|
8
|
+
* chant sql replay <dir> --kind <kind> --env <env> [--dir-field migrationsDir=<sub>] [--check]
|
|
9
|
+
*
|
|
10
|
+
* The replay applies each migration's up statements in the order the kind's
|
|
11
|
+
* reader lists them, then reads the tables, views and columns the server has
|
|
12
|
+
* and writes them as `chant.replay.json` beside the migrations, named by the
|
|
13
|
+
* contract of #3931: `<schema>.<table>` and `<schema>.<table>.<column>` for
|
|
14
|
+
* Postgres, `<database>.<table>` and `<database>.<table>.<column>` for
|
|
15
|
+
* ClickHouse. The file also holds a digest of the files it ran, so the
|
|
16
|
+
* reader knows when a migration changed after it. `--check` replays and
|
|
17
|
+
* compares instead of writing, exiting 1 when the file differs, the way
|
|
18
|
+
* `chant sql types --check` does.
|
|
19
|
+
*
|
|
20
|
+
* What it runs per kind:
|
|
21
|
+
* - goose: the `-- +goose Up` section of each file; `StatementBegin` to
|
|
22
|
+
* `StatementEnd` is one statement.
|
|
23
|
+
* - golang-migrate and clickhouse-migrations: the whole up file.
|
|
24
|
+
* - Flyway: the SQL files of the locations, versioned in version order and
|
|
25
|
+
* then repeatable ones, with placeholders substituted. Baseline and undo
|
|
26
|
+
* files are not run.
|
|
27
|
+
*
|
|
28
|
+
* The server must hold no table, view or column of its own: the replay
|
|
29
|
+
* refuses a server that does, since it cannot tell what the migrations made.
|
|
30
|
+
* It runs the migrations' SQL against the server `--env` binds, so point it
|
|
31
|
+
* at a throwaway server or emulator.
|
|
32
|
+
*/
|
|
33
|
+
import { readFileSync, writeFileSync } from "node:fs";
|
|
34
|
+
import { join, relative, resolve } from "node:path";
|
|
35
|
+
import { LINK_READERS } from "@intentius/chant/workspace/kind-link-readers";
|
|
36
|
+
import { migrationDigest, REPLAY_FILE, replayFiles } from "@intentius/chant/workspace/migration-dirs";
|
|
37
|
+
import { findFlywayConfig, readFlywayConfig, substitute } from "@intentius/chant/workspace/flyway-layout";
|
|
38
|
+
import { workingTree } from "@intentius/chant/workspace/tree";
|
|
39
|
+
export const REPLAY_KINDS = ["goose", "golang-migrate", "clickhouse-migrations", "flyway"];
|
|
40
|
+
const READER = { goose: "goose-dir", "golang-migrate": "golang-migrate-dir", "clickhouse-migrations": "clickhouse-migrations-dir", flyway: "flyway-dir" };
|
|
41
|
+
/**
|
|
42
|
+
* Split SQL text into statements at `;`. Single-quoted strings, quoted
|
|
43
|
+
* identifiers, `--` and `/* *\/` comments and Postgres dollar-quoted bodies
|
|
44
|
+
* hold semicolons without ending the statement. A statement of only
|
|
45
|
+
* comments is dropped.
|
|
46
|
+
*/
|
|
47
|
+
export function splitStatements(text) {
|
|
48
|
+
const out = [];
|
|
49
|
+
let start = 0;
|
|
50
|
+
let i = 0;
|
|
51
|
+
const flush = (end) => {
|
|
52
|
+
const s = text.slice(start, end).trim();
|
|
53
|
+
if (s !== "" && s.replace(/--[^\n]*/g, "").replace(/\/\*[\s\S]*?\*\//g, "").trim() !== "")
|
|
54
|
+
out.push(s);
|
|
55
|
+
start = end + 1;
|
|
56
|
+
};
|
|
57
|
+
while (i < text.length) {
|
|
58
|
+
const c = text[i];
|
|
59
|
+
const two = text.slice(i, i + 2);
|
|
60
|
+
if (two === "--") {
|
|
61
|
+
const nl = text.indexOf("\n", i);
|
|
62
|
+
i = nl < 0 ? text.length : nl + 1;
|
|
63
|
+
}
|
|
64
|
+
else if (two === "/*") {
|
|
65
|
+
const end = text.indexOf("*/", i + 2);
|
|
66
|
+
i = end < 0 ? text.length : end + 2;
|
|
67
|
+
}
|
|
68
|
+
else if (c === "'" || c === '"' || c === "`") {
|
|
69
|
+
i++;
|
|
70
|
+
while (i < text.length) {
|
|
71
|
+
if (text[i] === "\\" && c !== '"')
|
|
72
|
+
i += 2;
|
|
73
|
+
else if (text[i] === c) {
|
|
74
|
+
if (text[i + 1] === c)
|
|
75
|
+
i += 2;
|
|
76
|
+
else
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
else
|
|
80
|
+
i++;
|
|
81
|
+
}
|
|
82
|
+
i++;
|
|
83
|
+
}
|
|
84
|
+
else if (c === "$") {
|
|
85
|
+
const tag = /^\$[A-Za-z_]*\$/.exec(text.slice(i))?.[0];
|
|
86
|
+
if (tag) {
|
|
87
|
+
const end = text.indexOf(tag, i + tag.length);
|
|
88
|
+
i = end < 0 ? text.length : end + tag.length;
|
|
89
|
+
}
|
|
90
|
+
else
|
|
91
|
+
i++;
|
|
92
|
+
}
|
|
93
|
+
else if (c === ";") {
|
|
94
|
+
flush(i);
|
|
95
|
+
i++;
|
|
96
|
+
}
|
|
97
|
+
else
|
|
98
|
+
i++;
|
|
99
|
+
}
|
|
100
|
+
flush(text.length);
|
|
101
|
+
return out;
|
|
102
|
+
}
|
|
103
|
+
/** goose's Up statements: the lines between `-- +goose Up` and `-- +goose Down`; a StatementBegin to StatementEnd block is one statement. */
|
|
104
|
+
export function gooseUpStatements(text) {
|
|
105
|
+
const out = [];
|
|
106
|
+
let section = "none";
|
|
107
|
+
let block;
|
|
108
|
+
let plain = [];
|
|
109
|
+
const annotation = (l) => {
|
|
110
|
+
const t = l.trim();
|
|
111
|
+
return t.startsWith("--") && t.includes("+goose") ? t.replace("+goose", "").replace(/^--\s*/, "").trim().toLowerCase() : undefined;
|
|
112
|
+
};
|
|
113
|
+
const flushPlain = () => {
|
|
114
|
+
out.push(...splitStatements(plain.join("\n")));
|
|
115
|
+
plain = [];
|
|
116
|
+
};
|
|
117
|
+
for (const line of text.split(/\r?\n/)) {
|
|
118
|
+
const a = annotation(line);
|
|
119
|
+
if (a === "up")
|
|
120
|
+
section = "up";
|
|
121
|
+
else if (a === "down") {
|
|
122
|
+
flushPlain();
|
|
123
|
+
section = "down";
|
|
124
|
+
}
|
|
125
|
+
else if (a === "statementbegin" && section === "up") {
|
|
126
|
+
flushPlain();
|
|
127
|
+
block = [];
|
|
128
|
+
}
|
|
129
|
+
else if (a === "statementend" && section === "up" && block) {
|
|
130
|
+
const s = block.join("\n").trim();
|
|
131
|
+
if (s !== "")
|
|
132
|
+
out.push(s);
|
|
133
|
+
block = undefined;
|
|
134
|
+
}
|
|
135
|
+
else if (section === "up" && a === undefined)
|
|
136
|
+
(block ?? plain).push(line);
|
|
137
|
+
}
|
|
138
|
+
flushPlain();
|
|
139
|
+
return out;
|
|
140
|
+
}
|
|
141
|
+
/** The statements to run, per migration, in order. Throws when a Flyway placeholder has no value. */
|
|
142
|
+
export function replaySteps(kind, tree, dir, fields = null) {
|
|
143
|
+
const read = LINK_READERS[READER[kind]]({ member: { name: "replay" }, dir, fields, tree });
|
|
144
|
+
const migrations = (read.migrations ?? []).filter((m) => m.type === "versioned" || m.type === "repeatable");
|
|
145
|
+
const config = kind === "flyway" ? readFlywayConfig(tree, findFlywayConfig(tree, dir), dir) : undefined;
|
|
146
|
+
const steps = migrations.map((migration) => {
|
|
147
|
+
const text = tree.read(migration.file);
|
|
148
|
+
const statements = kind === "goose" ? gooseUpStatements(text) : splitStatements(config ? substitute(text, migration.file, config) : text);
|
|
149
|
+
return { migration, statements };
|
|
150
|
+
});
|
|
151
|
+
const extra = config?.file !== undefined ? [config.file] : [];
|
|
152
|
+
return { steps, files: replayFiles(tree, read.migrations ?? [], extra), dialect: read.migrations?.[0]?.dialect ?? "postgres" };
|
|
153
|
+
}
|
|
154
|
+
/** Apply each migration's statements; a failure names the migration file and the statement. */
|
|
155
|
+
export async function applySteps(db, steps) {
|
|
156
|
+
for (const { migration, statements } of steps) {
|
|
157
|
+
for (const [i, sql] of statements.entries()) {
|
|
158
|
+
try {
|
|
159
|
+
await db.run(sql);
|
|
160
|
+
}
|
|
161
|
+
catch (err) {
|
|
162
|
+
throw new Error(`${migration.file}: statement ${String(i + 1)} failed: ${err.message}\n${sql.slice(0, 200)}`);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
const POSTGRES_CATALOG = `
|
|
168
|
+
select n.nspname as schema, c.relname as relation, a.attname as col
|
|
169
|
+
from pg_class c
|
|
170
|
+
join pg_namespace n on n.oid = c.relnamespace
|
|
171
|
+
left join pg_attribute a on a.attrelid = c.oid and a.attnum > 0 and not a.attisdropped
|
|
172
|
+
where c.relkind in ('r', 'p', 'v', 'm', 'f')
|
|
173
|
+
and n.nspname not in ('pg_catalog', 'information_schema')
|
|
174
|
+
and n.nspname not like 'pg\\_toast%' and n.nspname not like 'pg\\_temp%'
|
|
175
|
+
order by 1, 2, a.attnum`;
|
|
176
|
+
const CLICKHOUSE_CATALOG = `
|
|
177
|
+
select t.database as schema, t.name as relation, c.name as col
|
|
178
|
+
from system.tables t
|
|
179
|
+
left join system.columns c on c.database = t.database and c.table = t.name
|
|
180
|
+
where t.database not in ('system', 'INFORMATION_SCHEMA', 'information_schema')
|
|
181
|
+
and t.is_temporary = 0
|
|
182
|
+
order by t.database, t.name, c.position`;
|
|
183
|
+
/** The tables, views and columns the server has, as workspace output names (#3931). */
|
|
184
|
+
export async function readCatalogOutputs(db) {
|
|
185
|
+
const rows = await db.rows(db.dialect === "postgres" ? POSTGRES_CATALOG : CLICKHOUSE_CATALOG);
|
|
186
|
+
const out = [];
|
|
187
|
+
const seen = new Set();
|
|
188
|
+
for (const r of rows) {
|
|
189
|
+
const rel = `${String(r.schema)}.${String(r.relation)}`;
|
|
190
|
+
if (!seen.has(rel)) {
|
|
191
|
+
seen.add(rel);
|
|
192
|
+
out.push(rel);
|
|
193
|
+
}
|
|
194
|
+
if (r.col !== null && r.col !== undefined)
|
|
195
|
+
out.push(`${rel}.${String(r.col)}`);
|
|
196
|
+
}
|
|
197
|
+
return out;
|
|
198
|
+
}
|
|
199
|
+
/** Replay a directory into `db`, which must hold nothing, and return the snapshot to record. */
|
|
200
|
+
export async function replayDirectory(db, kind, tree, dir, fields = null) {
|
|
201
|
+
const before = await readCatalogOutputs(db);
|
|
202
|
+
if (before.length > 0)
|
|
203
|
+
throw new Error(`the server already has ${before[0].split(".").slice(0, 2).join(".")}${before.length > 1 ? ` and ${String(before.length - 1)} more names` : ""}; replay needs a server with no tables or views of its own, so the tables it finds are the migrations' (use a throwaway server or emulator)`);
|
|
204
|
+
const { steps, files, dialect } = replaySteps(kind, tree, dir, fields);
|
|
205
|
+
if (dialect !== db.dialect)
|
|
206
|
+
throw new Error(`the migrations are ${dialect} and the server is ${db.dialect}; set the member's dialect field or bind the matching server`);
|
|
207
|
+
await applySteps(db, steps);
|
|
208
|
+
return { schema: 1, dialect, digest: migrationDigest((f) => tree.read(f), files), outputs: await readCatalogOutputs(db) };
|
|
209
|
+
}
|
|
210
|
+
export const renderSnapshot = (s) => `${JSON.stringify(s, null, 2)}\n`;
|
|
211
|
+
const USAGE = "usage: chant sql replay <dir> --kind goose|golang-migrate|clickhouse-migrations|flyway --env <env> [--migrations-dir <sub>] [--dialect postgres|clickhouse] [--check]";
|
|
212
|
+
/** Open the server `--env` binds, of the migrations' dialect. */
|
|
213
|
+
async function openBound(dialect, environment) {
|
|
214
|
+
if (dialect === "postgres") {
|
|
215
|
+
const { bindPostgres } = await import("./postgres/live/bind.js");
|
|
216
|
+
const { client } = await bindPostgres({ environment });
|
|
217
|
+
return { dialect, run: async (sql) => void (await client.query(sql)), rows: (sql) => client.query(sql), close: () => client.end() };
|
|
218
|
+
}
|
|
219
|
+
const { bindClickHouse } = await import("./clickhouse/live/bind.js");
|
|
220
|
+
const { clickhouseQuery } = await import("./clickhouse/http.js");
|
|
221
|
+
const target = await bindClickHouse({ environment });
|
|
222
|
+
return { dialect, run: async (sql) => void (await clickhouseQuery(target.endpoint, sql)), rows: (sql) => clickhouseQuery(target.endpoint, sql), async close() { } };
|
|
223
|
+
}
|
|
224
|
+
export async function runReplay(ctx) {
|
|
225
|
+
const args = ctx.rawArgs;
|
|
226
|
+
let kind;
|
|
227
|
+
let env;
|
|
228
|
+
let sub;
|
|
229
|
+
let dialect;
|
|
230
|
+
const check = args.includes("--check");
|
|
231
|
+
const positional = [];
|
|
232
|
+
for (let i = 0; i < args.length; i++) {
|
|
233
|
+
const a = args[i];
|
|
234
|
+
if (a === "--kind")
|
|
235
|
+
kind = args[++i];
|
|
236
|
+
else if (a === "--env")
|
|
237
|
+
env = args[++i];
|
|
238
|
+
else if (a === "--migrations-dir")
|
|
239
|
+
sub = args[++i];
|
|
240
|
+
else if (a === "--dialect")
|
|
241
|
+
dialect = args[++i];
|
|
242
|
+
else if (a === "--check")
|
|
243
|
+
continue;
|
|
244
|
+
else if (a.startsWith("--")) {
|
|
245
|
+
console.error(`unknown argument ${a}\n${USAGE}`);
|
|
246
|
+
return 1;
|
|
247
|
+
}
|
|
248
|
+
else
|
|
249
|
+
positional.push(a);
|
|
250
|
+
}
|
|
251
|
+
if (positional.length !== 1 || !kind || !REPLAY_KINDS.includes(kind) || !env) {
|
|
252
|
+
console.error(USAGE);
|
|
253
|
+
return 1;
|
|
254
|
+
}
|
|
255
|
+
const abs = resolve(process.cwd(), positional[0]);
|
|
256
|
+
const tree = workingTree(abs);
|
|
257
|
+
const fields = { ...(sub ? { migrationsDir: sub } : {}), ...(dialect ? { dialect } : {}) };
|
|
258
|
+
const { steps, dialect: found } = replaySteps(kind, tree, "", fields);
|
|
259
|
+
if (steps.length === 0) {
|
|
260
|
+
console.error(`chant sql replay: ${relative(process.cwd(), abs) || "."} lists no ${kind} migrations`);
|
|
261
|
+
return 1;
|
|
262
|
+
}
|
|
263
|
+
const db = await openBound(found, env);
|
|
264
|
+
let snapshot;
|
|
265
|
+
try {
|
|
266
|
+
snapshot = await replayDirectory(db, kind, tree, "", fields);
|
|
267
|
+
}
|
|
268
|
+
catch (err) {
|
|
269
|
+
console.error(`chant sql replay: ${err.message}`);
|
|
270
|
+
return 1;
|
|
271
|
+
}
|
|
272
|
+
finally {
|
|
273
|
+
await db.close();
|
|
274
|
+
}
|
|
275
|
+
const file = join(abs, REPLAY_FILE);
|
|
276
|
+
const text = renderSnapshot(snapshot);
|
|
277
|
+
const current = (() => {
|
|
278
|
+
try {
|
|
279
|
+
return readFileSync(file, "utf8");
|
|
280
|
+
}
|
|
281
|
+
catch {
|
|
282
|
+
return undefined;
|
|
283
|
+
}
|
|
284
|
+
})();
|
|
285
|
+
if (check) {
|
|
286
|
+
if (current === text)
|
|
287
|
+
return 0;
|
|
288
|
+
console.error(`chant sql replay --check: ${relative(process.cwd(), file)} ${current === undefined ? "is missing" : "differs from a replay of the migrations"}; run chant sql replay and commit it`);
|
|
289
|
+
return 1;
|
|
290
|
+
}
|
|
291
|
+
writeFileSync(file, text);
|
|
292
|
+
console.log(`recorded ${String(snapshot.outputs.length)} names from ${String(steps.length)} migrations in ${relative(process.cwd(), file)}`);
|
|
293
|
+
return 0;
|
|
294
|
+
}
|
package/dist/okf/index.md
CHANGED
|
@@ -18,16 +18,21 @@ okf_version: '0.2'
|
|
|
18
18
|
* [PostgresEnum](/types/PostgresEnum.md) - Postgres::Enum
|
|
19
19
|
* [PostgresEventTrigger](/types/PostgresEventTrigger.md) - Postgres::EventTrigger
|
|
20
20
|
* [PostgresExtension](/types/PostgresExtension.md) - Postgres::Extension
|
|
21
|
+
* [PostgresForeignDataWrapper](/types/PostgresForeignDataWrapper.md) - Postgres::ForeignDataWrapper
|
|
22
|
+
* [PostgresForeignServer](/types/PostgresForeignServer.md) - Postgres::ForeignServer
|
|
21
23
|
* [PostgresFunction](/types/PostgresFunction.md) - Postgres::Function
|
|
22
24
|
* [PostgresGrant](/types/PostgresGrant.md) - Postgres::Grant
|
|
23
25
|
* [PostgresIndex](/types/PostgresIndex.md) - Postgres::Index
|
|
24
26
|
* [PostgresMaterializedView](/types/PostgresMaterializedView.md) - Postgres::MaterializedView
|
|
27
|
+
* [PostgresOperator](/types/PostgresOperator.md) - Postgres::Operator
|
|
25
28
|
* [PostgresPolicy](/types/PostgresPolicy.md) - Postgres::Policy
|
|
26
29
|
* [PostgresProcedure](/types/PostgresProcedure.md) - Postgres::Procedure
|
|
30
|
+
* [PostgresPublication](/types/PostgresPublication.md) - Postgres::Publication
|
|
27
31
|
* [PostgresRangeType](/types/PostgresRangeType.md) - Postgres::RangeType
|
|
28
32
|
* [PostgresRole](/types/PostgresRole.md) - Postgres::Role
|
|
29
33
|
* [PostgresSchema](/types/PostgresSchema.md) - Postgres::Schema
|
|
30
34
|
* [PostgresSequence](/types/PostgresSequence.md) - Postgres::Sequence
|
|
35
|
+
* [PostgresStatistics](/types/PostgresStatistics.md) - Postgres::Statistics
|
|
31
36
|
* [PostgresTable](/types/PostgresTable.md) - Postgres::Table
|
|
32
37
|
* [PostgresTrigger](/types/PostgresTrigger.md) - Postgres::Trigger
|
|
33
38
|
* [PostgresView](/types/PostgresView.md) - Postgres::View
|
|
@@ -74,6 +79,7 @@ okf_version: '0.2'
|
|
|
74
79
|
* [SQLCH125](/rules/SQLCH125.md) - A codec parameter is outside what the codec takes
|
|
75
80
|
* [SQLCH126](/rules/SQLCH126.md) - A GRANT column list names a column the table does not declare
|
|
76
81
|
* [SQLCH127](/rules/SQLCH127.md) - An expression calls a function the pinned server does not have
|
|
82
|
+
* [SQLCH128](/rules/SQLCH128.md) - An integration engine or table function argument holds a literal credential
|
|
77
83
|
* [SQLPG001](/rules/SQLPG001.md) - the DDL in a Postgres template does not parse, or does not hold
|
|
78
84
|
* [SQLPG002](/rules/SQLPG002.md) - a column written as `${events.kind}` instead of `${events.columns.kind}`.
|
|
79
85
|
* [SQLPG003](/rules/SQLPG003.md) - an object named in a string where Postgres reads a `regclass`:
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: post-synth-check
|
|
3
|
+
title: SQLCH128
|
|
4
|
+
description: An integration engine or table function argument holds a literal credential
|
|
5
|
+
id: SQLCH128
|
|
6
|
+
severity: error
|
|
7
|
+
category: post-synth
|
|
8
|
+
lexicon: sql
|
|
9
|
+
docs: https://intentius.io/chant/lexicons/sql/rules/
|
|
10
|
+
---
|
|
11
|
+
An integration engine or table function argument holds a literal credential
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: PostgresForeignDataWrapper
|
|
4
|
+
description: sql resource type Postgres::ForeignDataWrapper
|
|
5
|
+
name: PostgresForeignDataWrapper
|
|
6
|
+
lexicon: sql
|
|
7
|
+
resource_type: Postgres::ForeignDataWrapper
|
|
8
|
+
---
|
|
9
|
+
`Postgres::ForeignDataWrapper`, a resource type of the sql lexicon.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: resource-type
|
|
3
|
+
title: PostgresForeignServer
|
|
4
|
+
description: sql resource type Postgres::ForeignServer
|
|
5
|
+
name: PostgresForeignServer
|
|
6
|
+
lexicon: sql
|
|
7
|
+
resource_type: Postgres::ForeignServer
|
|
8
|
+
---
|
|
9
|
+
`Postgres::ForeignServer`, a resource type of the sql lexicon.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgres-migration.d.ts","sourceRoot":"","sources":["../../../src/op/activities/postgres-migration.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAI3D,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAIzG,OAAO,EAAyD,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACnK,OAAO,EAQL,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,YAAY,EAEjB,KAAK,YAAY,EACjB,KAAK,YAAY,EAClB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAE9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEjE,YAAY,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAEvE,0HAA0H;AAC1H,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,GAAG,WAAW,CAAC,CAAC;IAChD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IACzC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,OAAO,CAAC,cAAc,CAAC,CAAC;IAClE,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;
|
|
1
|
+
{"version":3,"file":"postgres-migration.d.ts","sourceRoot":"","sources":["../../../src/op/activities/postgres-migration.ts"],"names":[],"mappings":"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"}
|
|
@@ -74,6 +74,8 @@ async function bound(args, signal, deps, body) {
|
|
|
74
74
|
objects,
|
|
75
75
|
column: args.column,
|
|
76
76
|
...(args.using !== undefined ? { using: args.using } : {}),
|
|
77
|
+
...(args.reverse !== undefined ? { reverse: args.reverse } : {}),
|
|
78
|
+
...(args.defaultAtContract ? { defaultAtContract: true } : {}),
|
|
77
79
|
...(marker ? { marker } : {}),
|
|
78
80
|
...(major !== undefined ? { major } : {}),
|
|
79
81
|
batchSize: args.batchSize ?? 1000,
|
|
@@ -106,6 +108,8 @@ export async function postgresMigrationPlan(args, signal, deps = {}) {
|
|
|
106
108
|
column: run.column,
|
|
107
109
|
...(run.marker ? { marker: run.marker } : {}),
|
|
108
110
|
...(run.using !== undefined ? { using: run.using } : {}),
|
|
111
|
+
...(run.reverse !== undefined ? { reverse: run.reverse } : {}),
|
|
112
|
+
...(run.defaultAtContract ? { defaultAtContract: true } : {}),
|
|
109
113
|
...(run.major !== undefined ? { major: run.major } : {}),
|
|
110
114
|
});
|
|
111
115
|
const n = o.names;
|
|
@@ -265,6 +265,8 @@ export declare const postgresMigrationPlanContract: import("@intentius/chant/op"
|
|
|
265
265
|
buildPath: string;
|
|
266
266
|
environment?: string | undefined;
|
|
267
267
|
using?: string | undefined;
|
|
268
|
+
reverse?: string | undefined;
|
|
269
|
+
defaultAtContract?: boolean | undefined;
|
|
268
270
|
retain?: string | undefined;
|
|
269
271
|
batchSize?: number | undefined;
|
|
270
272
|
replicationLag?: false | {
|
|
@@ -306,6 +308,8 @@ export declare const postgresMigrationExpandContract: import("@intentius/chant/o
|
|
|
306
308
|
buildPath: string;
|
|
307
309
|
environment?: string | undefined;
|
|
308
310
|
using?: string | undefined;
|
|
311
|
+
reverse?: string | undefined;
|
|
312
|
+
defaultAtContract?: boolean | undefined;
|
|
309
313
|
retain?: string | undefined;
|
|
310
314
|
batchSize?: number | undefined;
|
|
311
315
|
replicationLag?: false | {
|
|
@@ -329,6 +333,8 @@ export declare const postgresMigrationDualWriteContract: import("@intentius/chan
|
|
|
329
333
|
buildPath: string;
|
|
330
334
|
environment?: string | undefined;
|
|
331
335
|
using?: string | undefined;
|
|
336
|
+
reverse?: string | undefined;
|
|
337
|
+
defaultAtContract?: boolean | undefined;
|
|
332
338
|
retain?: string | undefined;
|
|
333
339
|
batchSize?: number | undefined;
|
|
334
340
|
replicationLag?: false | {
|
|
@@ -352,6 +358,8 @@ export declare const postgresMigrationBackfillContract: import("@intentius/chant
|
|
|
352
358
|
buildPath: string;
|
|
353
359
|
environment?: string | undefined;
|
|
354
360
|
using?: string | undefined;
|
|
361
|
+
reverse?: string | undefined;
|
|
362
|
+
defaultAtContract?: boolean | undefined;
|
|
355
363
|
retain?: string | undefined;
|
|
356
364
|
batchSize?: number | undefined;
|
|
357
365
|
replicationLag?: false | {
|
|
@@ -378,6 +386,8 @@ export declare const postgresMigrationCarryContract: import("@intentius/chant/op
|
|
|
378
386
|
buildPath: string;
|
|
379
387
|
environment?: string | undefined;
|
|
380
388
|
using?: string | undefined;
|
|
389
|
+
reverse?: string | undefined;
|
|
390
|
+
defaultAtContract?: boolean | undefined;
|
|
381
391
|
retain?: string | undefined;
|
|
382
392
|
batchSize?: number | undefined;
|
|
383
393
|
replicationLag?: false | {
|
|
@@ -403,6 +413,8 @@ export declare const postgresMigrationVerifyContract: import("@intentius/chant/o
|
|
|
403
413
|
buildPath: string;
|
|
404
414
|
environment?: string | undefined;
|
|
405
415
|
using?: string | undefined;
|
|
416
|
+
reverse?: string | undefined;
|
|
417
|
+
defaultAtContract?: boolean | undefined;
|
|
406
418
|
retain?: string | undefined;
|
|
407
419
|
batchSize?: number | undefined;
|
|
408
420
|
replicationLag?: false | {
|
|
@@ -431,6 +443,8 @@ export declare const postgresMigrationSwitchContract: import("@intentius/chant/o
|
|
|
431
443
|
buildPath: string;
|
|
432
444
|
environment?: string | undefined;
|
|
433
445
|
using?: string | undefined;
|
|
446
|
+
reverse?: string | undefined;
|
|
447
|
+
defaultAtContract?: boolean | undefined;
|
|
434
448
|
retain?: string | undefined;
|
|
435
449
|
batchSize?: number | undefined;
|
|
436
450
|
replicationLag?: false | {
|
|
@@ -455,6 +469,8 @@ export declare const postgresMigrationRetainContract: import("@intentius/chant/o
|
|
|
455
469
|
buildPath: string;
|
|
456
470
|
environment?: string | undefined;
|
|
457
471
|
using?: string | undefined;
|
|
472
|
+
reverse?: string | undefined;
|
|
473
|
+
defaultAtContract?: boolean | undefined;
|
|
458
474
|
retain?: string | undefined;
|
|
459
475
|
batchSize?: number | undefined;
|
|
460
476
|
replicationLag?: false | {
|
|
@@ -480,6 +496,8 @@ export declare const postgresMigrationContractContract: import("@intentius/chant
|
|
|
480
496
|
buildPath: string;
|
|
481
497
|
environment?: string | undefined;
|
|
482
498
|
using?: string | undefined;
|
|
499
|
+
reverse?: string | undefined;
|
|
500
|
+
defaultAtContract?: boolean | undefined;
|
|
483
501
|
retain?: string | undefined;
|
|
484
502
|
batchSize?: number | undefined;
|
|
485
503
|
replicationLag?: false | {
|
|
@@ -504,6 +522,8 @@ export declare const postgresMigrationCompensateContract: import("@intentius/cha
|
|
|
504
522
|
buildPath: string;
|
|
505
523
|
environment?: string | undefined;
|
|
506
524
|
using?: string | undefined;
|
|
525
|
+
reverse?: string | undefined;
|
|
526
|
+
defaultAtContract?: boolean | undefined;
|
|
507
527
|
retain?: string | undefined;
|
|
508
528
|
batchSize?: number | undefined;
|
|
509
529
|
replicationLag?: false | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"activity-contracts.d.ts","sourceRoot":"","sources":["../../src/op/activity-contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiCH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKzC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;EAK3C,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;EAK9C,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;EAK7C,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY3C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;EAKzC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;EAK3C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;EAKzC,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;EAK/C,CAAC;
|
|
1
|
+
{"version":3,"file":"activity-contracts.d.ts","sourceRoot":"","sources":["../../src/op/activity-contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAiCH,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKzC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;EAK3C,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;EAK9C,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;EAK7C,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAY3C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;EAKzC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;EAK3C,CAAC;AAEF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;EAKzC,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;EAK/C,CAAC;AA0BF,eAAO,MAAM,6BAA6B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKzC,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;EAK3C,CAAC;AAEF,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;;;;;;;;;EAK9C,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;EAK7C,CAAC;AAEF,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;EAK1C,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc3C,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;EAK3C,CAAC;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;EAK3C,CAAC;AAEF,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;EAK7C,CAAC;AAEF,eAAO,MAAM,mCAAmC;;;;;;;;;;;;;;;;;;;;;;EAK/C,CAAC;AAIF,+FAA+F;AAC/F,eAAO,MAAM,eAAe;;;;;;;;;EAS3B,CAAC"}
|
|
@@ -63,6 +63,8 @@ const migrationArgs = z.strictObject({
|
|
|
63
63
|
buildPath: z.string(),
|
|
64
64
|
environment: z.string().optional(),
|
|
65
65
|
using: z.string().optional(),
|
|
66
|
+
reverse: z.string().optional(),
|
|
67
|
+
defaultAtContract: z.boolean().optional(),
|
|
66
68
|
retain: z.string().optional(),
|
|
67
69
|
batchSize: z.number().int().positive().optional(),
|
|
68
70
|
replicationLag: z.union([z.literal(false), z.strictObject({ max: z.string().optional(), wait: z.string().optional() })]).optional(),
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,0BAA0B,CAAC;AA0B5E,eAAO,MAAM,SAAS,EAAE,aAiSvB,CAAC"}
|