@intentius/chant-lexicon-sql 0.118.1 → 0.120.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.
Files changed (113) hide show
  1. package/dist/clickhouse/apply/apply.d.ts +1 -1
  2. package/dist/clickhouse/apply/apply.d.ts.map +1 -1
  3. package/dist/clickhouse/apply/statements.d.ts +8 -0
  4. package/dist/clickhouse/apply/statements.d.ts.map +1 -1
  5. package/dist/clickhouse/import/generator.d.ts +1 -1
  6. package/dist/clickhouse/import/generator.d.ts.map +1 -1
  7. package/dist/clickhouse/import/live-export.d.ts +19 -0
  8. package/dist/clickhouse/import/live-export.d.ts.map +1 -1
  9. package/dist/clickhouse/live/bind.d.ts +8 -0
  10. package/dist/clickhouse/live/bind.d.ts.map +1 -1
  11. package/dist/clickhouse/live/catalog.d.ts +15 -0
  12. package/dist/clickhouse/live/catalog.d.ts.map +1 -1
  13. package/dist/clickhouse/live/describe-resources.d.ts.map +1 -1
  14. package/dist/clickhouse/plan/commands.d.ts.map +1 -1
  15. package/dist/clickhouse/plan/deep.d.ts +19 -2
  16. package/dist/clickhouse/plan/deep.d.ts.map +1 -1
  17. package/dist/clickhouse/plan/diff.d.ts.map +1 -1
  18. package/dist/clickhouse/plan/normalize.d.ts +3 -0
  19. package/dist/clickhouse/plan/normalize.d.ts.map +1 -1
  20. package/dist/clickhouse/plan/rebuild-handoff.d.ts +2 -0
  21. package/dist/clickhouse/plan/rebuild-handoff.d.ts.map +1 -1
  22. package/dist/clickhouse/rebuild/engines.d.ts +44 -0
  23. package/dist/clickhouse/rebuild/engines.d.ts.map +1 -0
  24. package/dist/clickhouse/rebuild/verify.d.ts +25 -1
  25. package/dist/clickhouse/rebuild/verify.d.ts.map +1 -1
  26. package/dist/clickhouse/testing/fake-server.d.ts +5 -0
  27. package/dist/clickhouse/testing/fake-server.d.ts.map +1 -1
  28. package/dist/config.d.ts +32 -8
  29. package/dist/config.d.ts.map +1 -1
  30. package/dist/core/foreign-tables.d.ts +13 -0
  31. package/dist/core/foreign-tables.d.ts.map +1 -0
  32. package/dist/files/clickhouse.d.ts +7 -3
  33. package/dist/files/clickhouse.d.ts.map +1 -1
  34. package/dist/files/postgres.d.ts +3 -0
  35. package/dist/files/postgres.d.ts.map +1 -1
  36. package/dist/import-parser.d.ts.map +1 -1
  37. package/dist/integrity.json +2 -2
  38. package/dist/manifest.json +1 -1
  39. package/dist/op/activities/clickhouse-emulator.d.ts +7 -1
  40. package/dist/op/activities/clickhouse-emulator.d.ts.map +1 -1
  41. package/dist/op/activities/postgres-emulator.d.ts +8 -1
  42. package/dist/op/activities/postgres-emulator.d.ts.map +1 -1
  43. package/dist/postgres/access/changes.d.ts +23 -0
  44. package/dist/postgres/access/changes.d.ts.map +1 -0
  45. package/dist/postgres/apply/apply.d.ts.map +1 -1
  46. package/dist/postgres/entities.d.ts.map +1 -1
  47. package/dist/postgres/live/bind.d.ts +8 -1
  48. package/dist/postgres/live/bind.d.ts.map +1 -1
  49. package/dist/postgres/live/catalog.d.ts +3 -3
  50. package/dist/postgres/live/catalog.d.ts.map +1 -1
  51. package/dist/postgres/live/client.d.ts +31 -0
  52. package/dist/postgres/live/client.d.ts.map +1 -1
  53. package/dist/postgres/plan/commands.d.ts.map +1 -1
  54. package/dist/postgres/plan/deep.d.ts.map +1 -1
  55. package/dist/sql-files.d.ts +2 -1
  56. package/dist/sql-files.d.ts.map +1 -1
  57. package/package.json +2 -2
  58. package/src/clickhouse/apply/apply.ts +8 -2
  59. package/src/clickhouse/apply/statements.ts +32 -5
  60. package/src/clickhouse/import/generator.ts +8 -3
  61. package/src/clickhouse/import/import.test.ts +64 -0
  62. package/src/clickhouse/import/live-export.ts +70 -2
  63. package/src/clickhouse/live/access.e2e.test.ts +71 -18
  64. package/src/clickhouse/live/bind.ts +10 -0
  65. package/src/clickhouse/live/catalog.ts +25 -2
  66. package/src/clickhouse/live/describe-resources.ts +5 -2
  67. package/src/clickhouse/live/live.test.ts +8 -0
  68. package/src/clickhouse/plan/commands.ts +6 -3
  69. package/src/clickhouse/plan/deep-grants.test.ts +67 -0
  70. package/src/clickhouse/plan/deep.ts +70 -6
  71. package/src/clickhouse/plan/diff.ts +4 -1
  72. package/src/clickhouse/plan/normalize.ts +5 -2
  73. package/src/clickhouse/plan/plan.test.ts +9 -1
  74. package/src/clickhouse/plan/rebuild-handoff.ts +11 -1
  75. package/src/clickhouse/rebuild/engines.ts +163 -0
  76. package/src/clickhouse/rebuild/rebuild-collapsing.e2e.test.ts +120 -0
  77. package/src/clickhouse/rebuild/rebuild-into-collapsing.e2e.test.ts +198 -0
  78. package/src/clickhouse/rebuild/rebuild.test.ts +78 -0
  79. package/src/clickhouse/rebuild/verify.ts +153 -24
  80. package/src/clickhouse/testing/fake-server.ts +3 -2
  81. package/src/codegen/classifier-page.ts +1 -1
  82. package/src/config.ts +16 -4
  83. package/src/core/foreign-tables.ts +28 -0
  84. package/src/files/clickhouse.ts +71 -5
  85. package/src/files/postgres.ts +2 -1
  86. package/src/import-parser.ts +2 -0
  87. package/src/migration-statements.test.ts +33 -0
  88. package/src/migration-statements.ts +2 -0
  89. package/src/op/__snapshots__/watch-pipeline.test.ts.snap +1 -1
  90. package/src/op/activities/clickhouse-emulator.ts +22 -1
  91. package/src/op/activities/postgres-apply-lock-timeout.e2e.test.ts +87 -0
  92. package/src/op/activities/postgres-apply.test.ts +32 -0
  93. package/src/op/activities/postgres-emulator.test.ts +20 -0
  94. package/src/op/activities/postgres-emulator.ts +41 -1
  95. package/src/op/apply-gate-access-clickhouse.e2e.test.ts +195 -0
  96. package/src/op/apply-gate-access.e2e.test.ts +207 -0
  97. package/src/postgres/access/access.test.ts +26 -1
  98. package/src/postgres/access/changes.ts +39 -0
  99. package/src/postgres/apply/apply.ts +10 -7
  100. package/src/postgres/entities.ts +20 -1
  101. package/src/postgres/live/bind.ts +16 -4
  102. package/src/postgres/live/catalog.ts +3 -15
  103. package/src/postgres/live/client.ts +85 -0
  104. package/src/postgres/live/live.test.ts +54 -0
  105. package/src/postgres/live/lock-timeout.e2e.test.ts +70 -0
  106. package/src/postgres/plan/commands.ts +2 -14
  107. package/src/postgres/plan/deep.ts +44 -2
  108. package/src/serializer.test.ts +4 -0
  109. package/src/skills/chant-sql-postgres-plan.md +1 -1
  110. package/src/skills/chant-sql-rebuild.md +2 -0
  111. package/src/skills/chant-sql.md +1 -1
  112. package/src/sql-files.test.ts +78 -1
  113. package/src/sql-files.ts +2 -1
@@ -83,5 +83,5 @@ export declare function plannedChanges(target: ClickHouseTarget, declared: reado
83
83
  * exactly one of applied or not attempted, and every pruned orphan; throws
84
84
  * {@link ClickHouseApplyError} when the server refused a statement.
85
85
  */
86
- export declare function applyClickHouse(target: ClickHouseTarget, declared: readonly DeclaredObject[], opts?: ClickHouseApplyOptions): Promise<ClickHouseApplyOutcome>;
86
+ export declare function applyClickHouse(target: ClickHouseTarget, all: readonly DeclaredObject[], opts?: ClickHouseApplyOptions): Promise<ClickHouseApplyOutcome>;
87
87
  //# sourceMappingURL=apply.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/apply/apply.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EACL,aAAa,EAIb,KAAK,eAAe,EACrB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAErD,OAAO,EAAoE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE3H,OAAO,EAAe,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAIxD,OAAO,EAA6B,KAAK,cAAc,EAAiC,MAAM,cAAc,CAAC;AAE7G,OAAO,EAAa,KAAK,QAA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B,CAAC;gBACjE,OAAO,EAAE,sBAAsB;CAI5C;AAgBD;;;;GAIG;AACH,wBAAsB,cAAc,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,SAAS,cAAc,EAAE,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAMzJ;AAED;;;;GAIG;AACH,wBAAsB,eAAe,CAAC,MAAM,EAAE,gBAAgB,EAAE,GAAG,EAAE,SAAS,cAAc,EAAE,EAAE,IAAI,GAAE,sBAA2B,GAAG,OAAO,CAAC,sBAAsB,CAAC,CAwFlK"}
@@ -164,6 +164,14 @@ export interface StatementPlanInput {
164
164
  * engine the topology runs. Default: the statements as declared.
165
165
  */
166
166
  topology?: Topology;
167
+ /**
168
+ * The versioned path (#3717): a user whose password is the environment's
169
+ * is taken to exist by the time the statements run, so its declared
170
+ * clauses are set with `ALTER USER` and its password left alone, where an
171
+ * apply against a server withholds it until the environment creates it.
172
+ * Default: off.
173
+ */
174
+ environmentCreatesUsers?: boolean;
167
175
  }
168
176
  export interface StatementPlan {
169
177
  /** One entry per declared object, in creation order. */
@@ -1 +1 @@
1
- {"version":3,"file":"statements.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/apply/statements.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,EAAmB,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAoB,KAAK,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAE1F,OAAO,EAA2B,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvD,+BAA+B;AA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E;AACpE,MAAM,WAAW,aAAa;IAC5B,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,oBAAoB,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,QAAQ,EAAE,SAAS,cAAc,EAAE,CAAC;IACpC,0EAA0E;IAC1E,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,iEAAiE;IACjE,OAAO,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IAC9C,iIAAiI;IACjI,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,MAAM,CAAC;IACxC,+DAA+D;IAC/D,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,4DAA4D;IAC5D,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,yIAAyI;IACzI,aAAa,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;IAChD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;;;;;OAMG;IACH,uBAAuB,CAAC,EAAE,OAAO,CAAC;CACnC;AAED,MAAM,WAAW,aAAa;IAC5B,wDAAwD;IACxD,OAAO,EAAE,gBAAgB,EAAE,CAAC;IAC5B,kHAAkH;IAClH,KAAK,EAAE,aAAa,EAAE,CAAC;CACxB;AAKD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,kBAAkB,GAAG,aAAa,CASvE;AAID,iGAAiG;AACjG,eAAO,MAAM,YAAY,EAAE,WAAW,CAAC,MAAM,CAK3C,CAAC"}
@@ -21,7 +21,7 @@ export interface TemplateBody {
21
21
  parts: string[];
22
22
  refs: string[];
23
23
  }
24
- export declare const CLICKHOUSE_TAG_OF: Readonly<Record<string, "database" | "table" | "view" | "dictionary" | "func">>;
24
+ export declare const CLICKHOUSE_TAG_OF: Readonly<Record<string, "database" | "table" | "view" | "dictionary" | "func" | "user" | "role" | "policy" | "grant">>;
25
25
  /** A template body as the text between the backquotes. */
26
26
  export declare const bodyText: (body: TemplateBody) => string;
27
27
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/import/generator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAC5F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAKjE,6EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACb;AACD,KAAK,IAAI,GAAG,cAAc,CAAC;AAE3B,uHAAuH;AACvH,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,eAAO,MAAM,iBAAiB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,CAAC,CAO7G,CAAC;AA+EF,0DAA0D;AAC1D,eAAO,MAAM,QAAQ,GAAI,MAAM,YAAY,KAAG,MAA0F,CAAC;AAEzI;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,EAAE,OAAO,GAAE,SAAS,IAAI,EAAU,GAAG;IAAE,KAAK,EAAE,IAAI,EAAE,CAAC;IAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;CAAE,CA2BlJ;AAOD,q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EAAE,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,CAAA;CAAE,CA2BlJ;AAOD,qBAAa,mBAAoB,YAAW,mBAAmB;IAGjD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;IAFpC,QAAQ,CAAC,UAAU,QAAQ;gBAEE,MAAM,CAAC,EAAE,MAAM,YAAA;IAE5C,QAAQ,CAAC,EAAE,EAAE,UAAU,GAAG,aAAa,EAAE;CAuB1C"}
@@ -13,9 +13,28 @@
13
13
  * - `owned` keeps the objects whose comment carries chant's ownership marker
14
14
  * (`../ownership.ts`), the trailer the applier stamps. The trailer itself is
15
15
  * never written into a declaration: `readLiveSchema` takes it off.
16
+ * - a migration runner's history table (`schema_migrations`,
17
+ * `goose_db_version`) is left out with a warning (#3676), as on Postgres.
18
+ * - A SQL user-defined function belongs to no database, and every project's
19
+ * functions sit side by side on a server (#3718). Without a selector, an
20
+ * import adopts only the functions the imported objects call (and those
21
+ * functions call), and the ones `sql.profiles.<env>.importFunctions` names;
22
+ * a warning names the rest. A function carries no comment, so `owned` does
23
+ * not apply to it.
16
24
  */
17
25
  import type { ExportedTemplate, ResourceSelector } from "@intentius/chant/lexicon";
18
26
  import { type BindOptions } from "../live/bind.js";
27
+ import type { LiveObject } from "../live/catalog.js";
28
+ /** The functions among `names` a statement calls: a name followed by `(`. */
29
+ export declare function calledFunctions(ddl: string, names: ReadonlySet<string>): string[];
30
+ /**
31
+ * The functions an import adopts (#3718): those the objects call, those
32
+ * `patterns` name, and the functions those call in turn; and the rest.
33
+ */
34
+ export declare function scopedFunctions(objects: readonly LiveObject[], functions: readonly LiveObject[], patterns?: readonly string[]): {
35
+ adopted: LiveObject[];
36
+ skipped: string[];
37
+ };
19
38
  export interface ExportOptions extends Omit<BindOptions, "environment"> {
20
39
  environment: string;
21
40
  stack?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"live-export.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/import/live-export.ts"],"names":[],"mappings":"AAAA;;;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AAC,WAAW,EAAE,aAAa,CAAC;IACrE,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,wBAAsB,eAAe,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAsCvF"}
@@ -21,6 +21,14 @@ export interface ClickHouseTarget {
21
21
  * as declared.
22
22
  */
23
23
  topology?: Topology;
24
+ /**
25
+ * Whether chant manages access here (`sql.profiles.<env>.access`, #3716):
26
+ * the declared users, roles, row policies and grants. Off when omitted, as
27
+ * on Postgres, and off for a server bound by `CLICKHOUSE_URL`.
28
+ */
29
+ access?: boolean;
30
+ /** `sql.profiles.<env>.importFunctions` (#3718): the functions an import adopts besides those the imported objects call. */
31
+ importFunctions?: string[];
24
32
  }
25
33
  export interface UnresolvedTarget {
26
34
  reason: "no-binding" | "no-credentials";
@@ -1 +1 @@
1
- {"version":3,"file":"bind.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/live/bind.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAyC,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAA6B,KAAK,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,kBAAkB,CAAC;IAC7B,gFAAgF;IAChF,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IAC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AAC3C,qBAAa,sBAAuB,SAAQ,KAAK;IACnC,QAAQ,CAAC,UAAU,EAAE,gBAAgB;gBAA5B,UAAU,EAAE,gBAAgB;CAIlD;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4DAA4D;IAC5D,MAAM,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IAClC,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;CAC1C;AAYD,kGAAkG;AAClG,wBAAsB,cAAc,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAKzF;AAED,uEAAuE;AACvE,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,OAAO,GAAG;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAWpG;AAED,wCAAwC;AACxC,wBAAsB,aAAa,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAG7E"}
@@ -21,6 +21,8 @@ export interface LiveObject {
21
21
  statement: string;
22
22
  /** A row policy's table. */
23
23
  table?: string;
24
+ /** The tool that keeps it, for a migration runner's history table (`../../core/foreign-tables.ts`): never chant's to import, change or drop. */
25
+ foreign?: string;
24
26
  }
25
27
  /** The entity type a `system.tables` engine stands for. */
26
28
  export declare function entityTypeOfEngine(engine: string): ClickHouseEntityType;
@@ -32,6 +34,11 @@ export declare function entityTypeOfEngine(engine: string): ClickHouseEntityType
32
34
  * `SELECT` on the database sees it without a grant on `system.dictionaries`;
33
35
  * a table with the `Dictionary` engine is a table.
34
36
  *
37
+ * A table another tool keeps its migration history in (`schema_migrations`,
38
+ * `goose_db_version`, `../../core/foreign-tables.ts`) is read and marked with
39
+ * the tool, as the Postgres reader marks it (#3676): import leaves it out
40
+ * with a warning, and a plan names it in a hint instead of dropping it.
41
+ *
35
42
  * So are chant's own working objects (`../ownership.ts`
36
43
  * `isChantWorkingObject`): a rebuild migration's new, dual-write and retained
37
44
  * tables, and the effect receipts database. None of them is a declaration, so
@@ -59,6 +66,14 @@ export interface DeclaredAccess {
59
66
  export declare function readLiveAccess(target: ClickHouseTarget, declared: readonly DeclaredAccess[], opts?: {
60
67
  withStatements?: boolean;
61
68
  }): Promise<LiveObject[]>;
69
+ /** The canonical kinds a profile's `access` switch decides (#3716). */
70
+ export declare const ACCESS_KINDS: ReadonlySet<string>;
71
+ /** The entity types a profile's `access` switch decides (#3716). */
72
+ export declare const ACCESS_ENTITY_TYPES: ReadonlySet<string>;
73
+ /** Why an access declaration is not read, planned or applied where the profile does not manage access. */
74
+ export declare const ACCESS_UNMANAGED_DETAIL = "access is not managed in this environment: set sql.profiles.<env>.access to plan and apply users, roles, row policies and grants";
75
+ /** The hint a plan gives for the access declarations it left out. */
76
+ export declare function accessUnmanagedHint(n: number, environment: string): string;
62
77
  /** The access objects among declared canonical objects, for `readLiveAccess`. */
63
78
  export declare function declaredAccess(objects: ReadonlyArray<{
64
79
  kind: string;
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/live/catalog.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC/C,OAAO,EAA2B,KAAK,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAGjF,mEAAmE;AACnE,eAAO,MAAM,gBAAgB,aAAkE,CAAC;AAEhG,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,oBAAoB,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,+HAA+H;IAC/H,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2GAA2G;IAC3G,OAAO,CAAC,EA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B,GAAG,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,GACnC,OAAO,CAAC,uBAAuB,CAAC,CAMlC"}
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/plan/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAe,KAAK,UAAU,EAAwB,MAAM,QAAQ,CAAC;AAM5E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAyD9C,wBAAsB,OAAO,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBvE;AAED,mFAAmF;AACnF,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAsBvJ;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAYvE;AAED,eAAO,MAAM,WAAW,EAAE,YAOzB,CAAC"}
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/plan/commands.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC5F,OAAO,EAAe,KAAK,UAAU,EAAwB,MAAM,QAAQ,CAAC;AAM5E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAyD9C,wBAAsB,OAAO,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAsBvE;AAED,mFAAmF;AACnF,wBAAsB,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC,CAAC,CAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAyBvJ;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO,CAAC,MAAM,CAAC,CAYvE;AAED,eAAO,MAAM,WAAW,EAAE,YAOzB,CAAC"}
@@ -17,9 +17,14 @@
17
17
  * (#3664). When a server's copy of a table differs from the profile
18
18
  * server's, that copy is what is reported, with the server in `observedOn`,
19
19
  * which the drift report prints as `seen on`.
20
+ *
21
+ * Where the profile manages access, the grants an apply would give or take
22
+ * from each declared grantee are reported as `pending` (#3733), the same
23
+ * statements `chant sql plan` plans (SQLCH273, SQLCH274), so a privilege
24
+ * granted or revoked by hand after an approval moves the plan digest.
20
25
  */
21
- import { type DeepObservationResult, type DeepNormalizationHooks } from "@intentius/chant/deep-observation";
22
- import { type BindOptions } from "../live/bind.js";
26
+ import { type DeepObservationResult, type DeepPendingChange, type DeepNormalizationHooks } from "@intentius/chant/deep-observation";
27
+ import { type BindOptions, type ClickHouseTarget } from "../live/bind.js";
23
28
  import { type CanonicalObject } from "./normalize.js";
24
29
  type Props = Record<string, unknown>;
25
30
  export declare const sqlDeepNormalizationHooks: DeepNormalizationHooks;
@@ -33,5 +38,17 @@ export declare function observeResourcesDeep(options: {
33
38
  props: Record<string, unknown>;
34
39
  }>;
35
40
  } & Omit<BindOptions, "environment">): Promise<DeepObservationResult>;
41
+ /**
42
+ * The grants an apply would give or take from each declared grantee (#3733),
43
+ * as `chant sql plan` compares them: the declared grants against what
44
+ * `SHOW GRANTS FOR` prints, atom by atom. One change per grantee, its
45
+ * REVOKEs before its GRANTs as the applier sends them, with the grant
46
+ * declarations behind it. A grantee the server does not hold yet is given
47
+ * every declared grant.
48
+ */
49
+ export declare function pendingGrants(target: ClickHouseTarget, entities: ReadonlyMap<string, {
50
+ entityType: string;
51
+ props: Record<string, unknown>;
52
+ }>): Promise<DeepPendingChange[]>;
36
53
  export {};
37
54
  //# sourceMappingURL=deep.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deep.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/plan/deep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAmB,KAAK,qBAAqB,EAAgC,KAAK,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAE3J,OAAO,EAA6C,KAAK,WAAW,EAAyB,MAAM,cAAc,CAAC;AAMlH,OAAO,EAAoD,KAAK,eAAe,EAAE,MAAM,aAAa,CAAC;AAGrG,KAAK,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAKrC,eAAO,MAAM,yBAAyB,EAAE,sBAEvC,CAAC;AA4BF,uGAAuG;AACvG,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,eAAe,EAAE,CAAC,EAAE,eAAe,GAAG,KAAK,CA2ChH;AAqFD,wBAAsB,oBAAoB,CACxC,OAAO,EAAE;IACP,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC,CAAC;CAC/E,GAAG,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,GACnC,OAAO,CAAC,qBAAqB,CAAC,CAiFhC"}
1
+ {"version":3,"file":"deep.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/plan/deep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EAEt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KAAK,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAmC,KAAK,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE9E,MAAM,MAAM,YAAY,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC;AAElD,MAAM,MAAM,MAAM,GAAG,gBAAgB,CAAC,gBAAgB,EAAE,WAAW,CAAC,CAAC;AAErE,MAAM,WAAW,UAAW,SAAQ,SAAS,CAAC,MAAM,CAAC;IACnD,wDAAwD;IACxD,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,6GAA6G;IAC7G,UAAU,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACnC;;;;OAIG;IACH,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;CAChC;AAED,0EAA0E;AAC1E,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAqMD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,EAAE,KAAK,EAAE,SAAS,YAAY,EAAE,GAAG,UAAU,CAqBvG"}
@@ -88,6 +88,8 @@ export interface CanonicalObject {
88
88
  access?: Record<string, string>;
89
89
  /** `-- previously: <name>` before the statement: the object's previous name. */
90
90
  previously?: string;
91
+ /** The tool that keeps a live table (a migration runner's history table): a plan never drops it. */
92
+ foreign?: string;
91
93
  }
92
94
  /**
93
95
  * The Keeper path and replica name a `Replicated*MergeTree` gets when its
@@ -153,5 +155,6 @@ export declare function liveCanonical(o: {
153
155
  type: string;
154
156
  name: string;
155
157
  statement: string;
158
+ foreign?: string;
156
159
  }, defaultDatabase?: string): CanonicalObject;
157
160
  //# sourceMappingURL=normalize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/plan/normalize.ts"],"names":[],"mappings":"AAAA;;;;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;;GAGG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,eAAe,SAAY,GAAG,eAAe,CAoHzF;AAID;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CA+B9D;AAED,gEAAgE;AAChE,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAQtD;AA4FD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,UAAU,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAQ1H;AAUD,4GAA4G;AAC5G,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,SAAY,GAAG,eAAe,CAEvG;AAED;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,UAAU,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,MAAM,CAIxH;AAED,6HAA6H;AAC7H,wBAAgB,aAAa,CAAC,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,EAAE,eAAe,SAAY,GAAG,eAAe,CAGlJ"}
@@ -27,6 +27,8 @@ export interface RebuildOpSuggestion extends MigrationOpSuggestion {
27
27
  } | {
28
28
  mode: "app";
29
29
  };
30
+ /** What to know before running it: set for an engine that collapses rows by sorting key (#3674, #3727). */
31
+ note?: string;
30
32
  }
31
33
  /**
32
34
  * One suggestion per object the diff refuses as a rebuild. `declared` maps
@@ -1 +1 @@
1
- {"version":3,"file":"rebuild-handoff.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/plan/rebuild-handoff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAuC,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAErG,MAAM,WAAW,mBAAoB,SAAQ,qBAAqB;IAChE,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE;QAAE,IAAI,EAAE,mBAAmB,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,KAAK,CAAA;KAAE,CAAC;CACnF;AAID;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAmBzI;AAED,+CAA+C;AAC/C,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,SAAS,mBAAmB,EAAE,GAAG,MAAM,EAAE,CAE9E"}
1
+ {"version":3,"file":"rebuild-handoff.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/plan/rebuild-handoff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AACzC,OAAO,EAAuC,KAAK,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAGrG,MAAM,WAAW,mBAAoB,SAAQ,qBAAqB;IAChE,yCAAyC;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE;QAAE,IAAI,EAAE,mBAAmB,CAAC;QAAC,aAAa,EAAE,MAAM,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,KAAK,CAAA;KAAE,CAAC;IAClF,2GAA2G;IAC3G,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAID;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,eAAe,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,mBAAmB,EAAE,CAyBzI;AAED,+CAA+C;AAC/C,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,SAAS,mBAAmB,EAAE,GAAG,MAAM,EAAE,CAG9E"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Which table engines the rebuild reads as merged (#3674): the verification
3
+ * (`./verify.ts`) and the plan's hand-off note (`../plan/rebuild-handoff.ts`).
4
+ */
5
+ /** Whether an engine collapses rows that share a sorting key (#3674). */
6
+ export declare const collapsesRows: (engine: string | undefined) => boolean;
7
+ /** A column of the new table, as `system.columns` reports it. */
8
+ export interface EngineColumn {
9
+ name: string;
10
+ type: string;
11
+ /** Part of the sorting key: the engine never merges its values. */
12
+ inSortingKey: boolean;
13
+ /** Part of the partition key: rows that merge share its value, so a SummingMergeTree does not sum it. */
14
+ inPartitionKey?: boolean;
15
+ }
16
+ /**
17
+ * How a collapsing engine merges the rows that share a sorting key, as what a
18
+ * merge leaves the same (#3727): for each key, the aggregates it preserves and
19
+ * whether it keeps the key at all. Both tables are grouped by the new table's
20
+ * sorting key and compared on these, so it does not matter which parts have
21
+ * merged, and a table that never collapses (a plain MergeTree) compares with
22
+ * one that does.
23
+ */
24
+ export interface CollapseSemantics {
25
+ /** The engine's name without `Replicated` or `Shared`. */
26
+ engine: string;
27
+ /** Per key: what merging leaves unchanged. SQL over the new table's column names. */
28
+ aggregates: string[];
29
+ /** Per key: whether the engine keeps a row for it. Absent: every key keeps one. */
30
+ having?: string;
31
+ /** One line for the summary and the error: what is compared per key. */
32
+ describe: string;
33
+ }
34
+ /** Split on the commas outside parentheses and quotes. */
35
+ export declare function splitTopLevel(text: string): string[];
36
+ /** The engine's own arguments in `system.tables.engine_full`, without a `Replicated` engine's Keeper path and replica name. */
37
+ export declare function engineArguments(engineFull: string): string[];
38
+ /**
39
+ * What a merge of `engine` keeps per sorting key, or undefined for an engine
40
+ * that does not collapse rows, or whose result depends on the order rows
41
+ * merge in (`GraphiteMergeTree` thins its rows by age).
42
+ */
43
+ export declare function collapseSemantics(engine: string, engineFull: string, columns: readonly EngineColumn[]): CollapseSemantics | undefined;
44
+ //# sourceMappingURL=engines.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"engines.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/rebuild/engines.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAUH,yEAAyE;AACzE,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,GAAG,SAAS,KAAG,OAA+C,CAAC;AAE3G,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,mEAAmE;IACnE,YAAY,EAAE,OAAO,CAAC;IACtB,yGAAyG;IACzG,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,iBAAiB;IAChC,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAC;IACf,qFAAqF;IACrF,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,mFAAmF;IACnF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wEAAwE;IACxE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,0DAA0D;AAC1D,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAqBpD;AAED,+HAA+H;AAC/H,wBAAgB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,EAAE,CAoB5D;AAYD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,iBAAiB,GAAG,SAAS,CAuDrI"}
@@ -24,6 +24,14 @@
24
24
  * later than the cut-over delay, with a time before the cut-over) stop the
25
25
  * swap too, rather than stay behind in the old table.
26
26
  *
27
+ * A table whose engine collapses rows that share a sorting key when parts
28
+ * merge (Summing, Replacing, Aggregating, Collapsing, VersionedCollapsing,
29
+ * Coalescing and Graphite, replicated or not), rebuilt into such an engine,
30
+ * is read under `FINAL` on both sides (#3674). The old table can hold unmerged parts with several rows for
31
+ * one key, which the copy inserts in one block and the new table collapses
32
+ * as it writes them, so the raw counts differ although the data is the same.
33
+ * Under `FINAL` both sides are compared as merged.
34
+ *
27
35
  * On a cluster of more than one shard (#3663) every shard is read, through
28
36
  * the profile's server, and each partition is compared per shard
29
37
  * (`shard<n>/<partition>`), so a shard the copy missed is a difference.
@@ -40,6 +48,7 @@ import { type RebuildObservation } from "./observe.js";
40
48
  import { type RebuildRun } from "./steps.js";
41
49
  export interface PartitionCheck {
42
50
  partition: string;
51
+ /** Rows; keys of the new sorting key when the tables were compared by key (#3727). */
43
52
  rows: number;
44
53
  checksum: string;
45
54
  }
@@ -60,7 +69,22 @@ export interface VerifyResult {
60
69
  export declare class RebuildVerificationError extends Error {
61
70
  readonly table: string;
62
71
  readonly mismatches: Mismatch[];
63
- constructor(table: string, mismatches: Mismatch[]);
72
+ /** The engine, when it collapses rows and the tables were compared under FINAL (#3674) or by sorting key (#3727). */
73
+ readonly collapsingEngine?: string;
74
+ constructor(table: string, mismatches: Mismatch[],
75
+ /** How the tables were compared when an engine collapses rows; an engine's name alone means under FINAL. */
76
+ collapsed?: string | Collapsed);
77
+ }
78
+ /**
79
+ * How the tables were compared when an engine collapses rows: both under
80
+ * FINAL (#3674), or grouped by the new table's sorting key on what its
81
+ * engine's merges keep (#3727).
82
+ */
83
+ export interface Collapsed {
84
+ engine: string;
85
+ how: "final" | "keys";
86
+ /** With `keys`: what is compared per key. */
87
+ describe?: string;
64
88
  }
65
89
  export type Mismatch = {
66
90
  partition: string;
@@ -1 +1 @@
1
- {"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/rebuild/verify.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAKH,OAAO,EAAsC,KAAK,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAExF,OAAO,EAAuD,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AAG/F,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,kBAAkB,CAAC,OAAO,CAAC,CAAC;IACnC,4IAA4I;IAC5I,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,qGAAqG;IACrG,YAAY,EAAE,cAAc,EAAE,CAAC;CAChC;AAED,sDAAsD;AACtD,qBAAa,wBAAyB,SAAQ,KAAK;IAE/C,QAAQ,CAAC,KAAK,EAAE,MAAM;IACtB,QAAQ,CAAC,UAAU,EAAE,QAAQ,EAAE;gBADtB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,QAAQ,EAAE;CAalC;AA6ED,MAAM,MAAM,QAAQ,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,cAAc,CAAC;IAAC,GAAG,CAAC,EAAE,cAAc,CAAA;CAAE,CAAC;AAYzF,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,UAAU,EAAE,QAAQ,EAAE;IAC/B,4GAA4G;IAC5G,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS;CA0BjC;AAgBD;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,OAAO,GAAG,MAAM,CAAC;IACtB,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AA+ID,MAAM,MAAM,QAAQ,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,cAAc,CAAC;IAAC,GAAG,CAAC,EAAE,cAAc,CAAA;CAAE,CAAC;AAYzF,kGAAkG;AAClG,eAAO,MAAM,OAAO,GAAI,SAAS,SAAS,MAAM,EAAE,KAAG,MAA8D,CAAC;AAEpH;;;GAGG;AACH,wBAAsB,cAAc,CAAC,GAAG,EAAE,UAAU,EAAE,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC,CAG1F;AAED,wBAAsB,aAAa,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAAC,YAAY,CAAC,CAqC1E"}
@@ -22,6 +22,11 @@ export interface FakeOptions {
22
22
  body: string;
23
23
  };
24
24
  version?: string;
25
+ /** The SQL user-defined functions `system.functions` lists. Default: none. */
26
+ functions?: Array<{
27
+ name: string;
28
+ statement: string;
29
+ }>;
25
30
  }
26
31
  export declare function fakeClickHouse(objects: FakeObject[], options?: FakeOptions): Promise<FakeServer>;
27
32
  //# sourceMappingURL=fake-server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fake-server.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/testing/fake-server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,O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AAc,CAAC,OAAO,EAAE,UAAU,EAAE,EAAE,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CAkC1G"}
package/dist/config.d.ts CHANGED
@@ -87,6 +87,14 @@ export declare const sqlProfileSchema: z.ZodObject<{
87
87
  databases: z.ZodOptional<z.ZodArray<z.ZodString>>;
88
88
  /** The database an unqualified declaration is created in. `default` when omitted. */
89
89
  defaultDatabase: z.ZodOptional<z.ZodString>;
90
+ /**
91
+ * ClickHouse import (#3718): the SQL user-defined functions `chant import
92
+ * --from <env>` adopts besides those the imported objects call, by name, or
93
+ * by prefix with a trailing `*` (`shop_*`). A function belongs to no
94
+ * database, so without this only the functions the imported tables, views
95
+ * and dictionaries call (and the functions those call) are imported.
96
+ */
97
+ importFunctions: z.ZodOptional<z.ZodArray<z.ZodString>>;
90
98
  /**
91
99
  * ClickHouse: the topology this environment runs, which the applier, the
92
100
  * plan and the rebuild migration render every statement for: `single`,
@@ -142,8 +150,11 @@ export declare const sqlProfileSchema: z.ZodObject<{
142
150
  /**
143
151
  * Postgres apply: how long one statement waits for its lock before it
144
152
  * fails (`lock_timeout`), in milliseconds, so a change blocked behind a
145
- * long query fails fast instead of queueing every query behind it. 5000
146
- * when omitted.
153
+ * long query fails fast instead of queueing every query behind it. The
154
+ * catalog reads (`chant lifecycle diff --live`, `chant sql plan`, the
155
+ * import, and an apply's read before its first statement) wait under it
156
+ * too, and name the session holding the lock when it passes. 5000 when
157
+ * omitted.
147
158
  */
148
159
  lockTimeoutMs: z.ZodOptional<z.ZodNumber>;
149
160
  /**
@@ -158,11 +169,12 @@ export declare const sqlProfileSchema: z.ZodObject<{
158
169
  */
159
170
  scanTimeoutMs: z.ZodOptional<z.ZodNumber>;
160
171
  /**
161
- * Postgres: whether chant manages access in this environment (#3681): the
172
+ * Whether chant manages access in this environment. Postgres (#3681): the
162
173
  * declared row-level security policies and each table's row-level security,
163
174
  * the declared roles (created when missing, never dropped), and the
164
175
  * privileges on the declared objects and the default privileges, which a
165
- * plan compares and an apply grants and revokes. Off when omitted: the
176
+ * plan compares and an apply grants and revokes. ClickHouse (#3716): the
177
+ * declared users, roles, row policies and grants. Off when omitted: the
166
178
  * access declarations are not planned or applied, and the server's access
167
179
  * is not read, so a project that manages access elsewhere is not affected.
168
180
  */
@@ -242,6 +254,14 @@ export declare const sqlConfigSchema: z.ZodObject<{
242
254
  databases: z.ZodOptional<z.ZodArray<z.ZodString>>;
243
255
  /** The database an unqualified declaration is created in. `default` when omitted. */
244
256
  defaultDatabase: z.ZodOptional<z.ZodString>;
257
+ /**
258
+ * ClickHouse import (#3718): the SQL user-defined functions `chant import
259
+ * --from <env>` adopts besides those the imported objects call, by name, or
260
+ * by prefix with a trailing `*` (`shop_*`). A function belongs to no
261
+ * database, so without this only the functions the imported tables, views
262
+ * and dictionaries call (and the functions those call) are imported.
263
+ */
264
+ importFunctions: z.ZodOptional<z.ZodArray<z.ZodString>>;
245
265
  /**
246
266
  * ClickHouse: the topology this environment runs, which the applier, the
247
267
  * plan and the rebuild migration render every statement for: `single`,
@@ -297,8 +317,11 @@ export declare const sqlConfigSchema: z.ZodObject<{
297
317
  /**
298
318
  * Postgres apply: how long one statement waits for its lock before it
299
319
  * fails (`lock_timeout`), in milliseconds, so a change blocked behind a
300
- * long query fails fast instead of queueing every query behind it. 5000
301
- * when omitted.
320
+ * long query fails fast instead of queueing every query behind it. The
321
+ * catalog reads (`chant lifecycle diff --live`, `chant sql plan`, the
322
+ * import, and an apply's read before its first statement) wait under it
323
+ * too, and name the session holding the lock when it passes. 5000 when
324
+ * omitted.
302
325
  */
303
326
  lockTimeoutMs: z.ZodOptional<z.ZodNumber>;
304
327
  /**
@@ -313,11 +336,12 @@ export declare const sqlConfigSchema: z.ZodObject<{
313
336
  */
314
337
  scanTimeoutMs: z.ZodOptional<z.ZodNumber>;
315
338
  /**
316
- * Postgres: whether chant manages access in this environment (#3681): the
339
+ * Whether chant manages access in this environment. Postgres (#3681): the
317
340
  * declared row-level security policies and each table's row-level security,
318
341
  * the declared roles (created when missing, never dropped), and the
319
342
  * privileges on the declared objects and the default privileges, which a
320
- * plan compares and an apply grants and revokes. Off when omitted: the
343
+ * plan compares and an apply grants and revokes. ClickHouse (#3716): the
344
+ * declared users, roles, row policies and grants. Off when omitted: the
321
345
  * access declarations are not planned or applied, and the server's access
322
346
  * is not read, so a project that manages access elsewhere is not affected.
323
347
  */
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAmC3D,eAAO,MAAM,gBAAgB;IAC3B;;;;;OAKG;;IAEH,2EAA2E;;;;IAE3E;;;;;;;OAOG;;;;;;;;;;;;;;;;;;IAEH;;;;OAIG;;IAEH,qFAAqF;;IAErF;;;;;;;;;OASG;;;;;;;;;;;;;;IAEH;;;;;OAKG;;IAEH,4FAA4F;;IAE5F;;;;;OAKG;;IAEH;;;;OAIG;;;;;;;;;IAEH;;;;;OAKG;;IAEH;;;OAGG;;IAEH;;;;OAIG;;IAEH;;;;;;;;OAQG;;kBAEH,CAAC;AAcH,eAAO,MAAM,eAAe;IAC1B,iEAAiE;;;;;;;;IAEjE;;;;OAIG;;;;;;;;;IAEH;;;;OAIG;;IAMH,wCAAwC;;QAxHxC;;;;;WAKG;;QAEH,2EAA2E;;;;QAE3E;;;;;;;WAOG;;;;;;;;;;;;;;;;;;QAEH;;;;WAIG;;QAEH,qFAAqF;;QAErF;;;;;;;;;WASG;;;;;;;;;;;;;;QAEH;;;;;WAKG;;QAEH,4FAA4F;;QAE5F;;;;;WAKG;;QAEH;;;;WAIG;;;;;;;;;QAEH;;;;;WAKG;;QAEH;;;WAGG;;QAEH;;;;WAIG;;QAEH;;;;;;;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;;;;;;;;;;;;QAEH;;;;;WAKG;;QAEH,4FAA4F;;QAE5F;;;;;WAKG;;QAEH;;;;WAIG;;;;;;;;;QAEH;;;;;;;;WAQG;;QAEH;;;WAGG;;QAEH;;;;WAIG;;QAEH;;;;;;;;;WASG;;;kBAqCH,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE1D,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAExD,OAAO,QAAQ,yBAAyB,CAAC;IACvC,UAAU,WAAW;QACnB,GAAG,CAAC,EAAE,SAAS,CAAC;KACjB;CACF;AAED,4EAA4E;AAC5E,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Tables another tool keeps its migration history in, by name, with the tool.
3
+ *
4
+ * Both dialects' catalog readers mark a table by one of these names as
5
+ * foreign: import leaves it out with a warning, and a plan names it in a hint
6
+ * instead of proposing a drop, since chant changing it would change what that
7
+ * tool owns (#3047 question 10, #3676). golang-migrate, dbmate, goose and
8
+ * Flyway keep the same tables on ClickHouse as on Postgres.
9
+ */
10
+ export declare const FOREIGN_TABLES: Readonly<Record<string, string>>;
11
+ /** The tool that keeps a table by this name, or undefined when none does. */
12
+ export declare function foreignTool(name: string): string | undefined;
13
+ //# sourceMappingURL=foreign-tables.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"foreign-tables.d.ts","sourceRoot":"","sources":["../../src/core/foreign-tables.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAa3D,CAAC;AAEF,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE5D"}
@@ -1,11 +1,15 @@
1
1
  /**
2
2
  * A file of ClickHouse DDL as the objects it declares: one per `CREATE
3
3
  * DATABASE`, `TABLE`, `VIEW`, `MATERIALIZED VIEW`, `DICTIONARY` or `FUNCTION`, as `chant import
4
- * <file>.sql` reads them. Any other statement, and any statement the parser
5
- * refuses, is a problem naming it.
4
+ * <file>.sql` reads them, and one per `CREATE USER`, `CREATE ROLE`, `CREATE
5
+ * ROW POLICY` and `GRANT` (#3711), each read by its tag, so what the tag
6
+ * refuses (`IDENTIFIED BY`, a `REVOKE`) is refused with the tag's message.
7
+ * Any other statement, and any statement the parser refuses, is a problem
8
+ * naming it.
6
9
  *
7
10
  * With `schema` (a database), an object's unqualified name is qualified with
8
- * it; a function belongs to no database and keeps its name.
11
+ * it, and so is the table a row policy or a grant is on; a function, a user
12
+ * and a role belong to no database and keep their names.
9
13
  */
10
14
  import type { Declarable } from "@intentius/chant/declarable";
11
15
  import { type ImportedObject } from "../clickhouse/import/ir.js";
@@ -1 +1 @@
1
- {"version":3,"file":"clickhouse.d.ts","sourceRoot":"","sources":["../../src/files/clickhouse.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAK9D,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAiD,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAE3F,KAAK,GAAG,GAAG,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,KAAK,UAAU,CAAC;AAG/E,4CAA4C;AAC5C,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,CAG3D;AAED,sHAAsH;AACtH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,CAuBtG"}
1
+ {"version":3,"file":"clickhouse.d.ts","sourceRoot":"","sources":["../../src/files/clickhouse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAO9D,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAiD,KAAK,WAAW,EAAE,MAAM,UAAU,CAAC;AAG3F,KAAK,GAAG,GAAG,CAAC,OAAO,EAAE,oBAAoB,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,KAAK,UAAU,CAAC;AAoD/E,4CAA4C;AAC5C,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,CAG3D;AAED,sHAAsH;AACtH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,CAiCtG"}
@@ -26,6 +26,9 @@ type Tag = (strings: TemplateStringsArray, ...values: unknown[]) => Declarable;
26
26
  export declare function postgresTag(type: string): Tag | undefined;
27
27
  /** A tagged-template call's strings from template-literal text: `raw` as written, as the tag reads it. */
28
28
  export declare function templateStrings(parts: readonly string[]): TemplateStringsArray;
29
+ /** Text that sits inside a template literal: a backquote and `${` escaped. */
30
+ /** Text that sits inside a template literal: a backquote and `${` escaped. */
31
+ export declare const templateSafe: (s: string) => string;
29
32
  /**
30
33
  * The objects a file of Postgres DDL declares, each with its statements
31
34
  * joined as one declaration's DDL. Problems are collected, not thrown, so a
@@ -1 +1 @@
1
- {"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../src/files/postgres.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAM9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,u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E,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CA2ItG"}
@@ -1 +1 @@
1
- {"version":3,"file":"import-parser.d.ts","sourceRoot":"","sources":["../src/import-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChG,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAmB3D,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAKxD;AAED,4CAA4C;AAC5C,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAKxF;AAED,qBAAa,aAAc,YAAW,cAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;gBAAR,OAAO,CAAC,EAAE,UAAU,YAAA;IAEjD,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU;CAOnC"}
1
+ {"version":3,"file":"import-parser.d.ts","sourceRoot":"","sources":["../src/import-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChG,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAqB3D,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU,CAKxD;AAED,4CAA4C;AAC5C,wBAAgB,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAKxF;AAED,qBAAa,aAAc,YAAW,cAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;gBAAR,OAAO,CAAC,EAAE,UAAU,YAAA;IAEjD,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,UAAU;CAOnC"}