@intentius/chant-lexicon-sql 0.117.0 → 0.118.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 (183) hide show
  1. package/dist/clickhouse/access.d.ts +132 -0
  2. package/dist/clickhouse/access.d.ts.map +1 -0
  3. package/dist/clickhouse/apply/apply.d.ts.map +1 -1
  4. package/dist/clickhouse/apply/statements.d.ts +2 -0
  5. package/dist/clickhouse/apply/statements.d.ts.map +1 -1
  6. package/dist/clickhouse/entities.d.ts +171 -2
  7. package/dist/clickhouse/entities.d.ts.map +1 -1
  8. package/dist/clickhouse/http.d.ts +3 -0
  9. package/dist/clickhouse/http.d.ts.map +1 -1
  10. package/dist/clickhouse/import/generator.d.ts +28 -0
  11. package/dist/clickhouse/import/generator.d.ts.map +1 -1
  12. package/dist/clickhouse/import/ir.d.ts.map +1 -1
  13. package/dist/clickhouse/import/parser.d.ts +3 -3
  14. package/dist/clickhouse/import/parser.d.ts.map +1 -1
  15. package/dist/clickhouse/live/bind.d.ts.map +1 -1
  16. package/dist/clickhouse/live/catalog.d.ts +41 -6
  17. package/dist/clickhouse/live/catalog.d.ts.map +1 -1
  18. package/dist/clickhouse/live/describe-resources.d.ts +3 -2
  19. package/dist/clickhouse/live/describe-resources.d.ts.map +1 -1
  20. package/dist/clickhouse/parser.d.ts +54 -3
  21. package/dist/clickhouse/parser.d.ts.map +1 -1
  22. package/dist/clickhouse/plan/commands.d.ts +3 -1
  23. package/dist/clickhouse/plan/commands.d.ts.map +1 -1
  24. package/dist/clickhouse/plan/deep.d.ts.map +1 -1
  25. package/dist/clickhouse/plan/diff.d.ts +12 -0
  26. package/dist/clickhouse/plan/diff.d.ts.map +1 -1
  27. package/dist/clickhouse/plan/normalize.d.ts +61 -1
  28. package/dist/clickhouse/plan/normalize.d.ts.map +1 -1
  29. package/dist/clickhouse/plan/report.d.ts.map +1 -1
  30. package/dist/clickhouse/plan/rules.d.ts +7 -0
  31. package/dist/clickhouse/plan/rules.d.ts.map +1 -1
  32. package/dist/clickhouse/plan/schema.d.ts +8 -4
  33. package/dist/clickhouse/plan/schema.d.ts.map +1 -1
  34. package/dist/clickhouse/rebuild/backfill.d.ts +3 -1
  35. package/dist/clickhouse/rebuild/backfill.d.ts.map +1 -1
  36. package/dist/clickhouse/rebuild/observe.d.ts +7 -3
  37. package/dist/clickhouse/rebuild/observe.d.ts.map +1 -1
  38. package/dist/clickhouse/rebuild/op.d.ts +8 -0
  39. package/dist/clickhouse/rebuild/op.d.ts.map +1 -1
  40. package/dist/clickhouse/rebuild/steps.d.ts +48 -0
  41. package/dist/clickhouse/rebuild/steps.d.ts.map +1 -1
  42. package/dist/clickhouse/testing/fake-server.d.ts.map +1 -1
  43. package/dist/clickhouse/testing/writable-server.d.ts.map +1 -1
  44. package/dist/clickhouse/topology.d.ts.map +1 -1
  45. package/dist/clickhouse.d.ts +1 -1
  46. package/dist/clickhouse.d.ts.map +1 -1
  47. package/dist/codegen/classifier-page.d.ts.map +1 -1
  48. package/dist/codegen/registry.d.ts.map +1 -1
  49. package/dist/config.d.ts +50 -7
  50. package/dist/config.d.ts.map +1 -1
  51. package/dist/core/references.d.ts +4 -2
  52. package/dist/core/references.d.ts.map +1 -1
  53. package/dist/core/statements.d.ts +11 -0
  54. package/dist/core/statements.d.ts.map +1 -1
  55. package/dist/files/build-root.d.ts +26 -0
  56. package/dist/files/build-root.d.ts.map +1 -0
  57. package/dist/files/clickhouse.d.ts +19 -0
  58. package/dist/files/clickhouse.d.ts.map +1 -0
  59. package/dist/files/common.d.ts +25 -0
  60. package/dist/files/common.d.ts.map +1 -0
  61. package/dist/files/postgres.d.ts +36 -0
  62. package/dist/files/postgres.d.ts.map +1 -0
  63. package/dist/import-parser.d.ts +25 -0
  64. package/dist/import-parser.d.ts.map +1 -0
  65. package/dist/index.d.ts +3 -2
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/integrity.json +6 -6
  68. package/dist/lint/rules/sqlch001.d.ts +1 -1
  69. package/dist/lint/rules/sqlch001.d.ts.map +1 -1
  70. package/dist/lint/rules/sqlch002.d.ts.map +1 -1
  71. package/dist/lint/rules/templates.d.ts +1 -1
  72. package/dist/lint/rules/templates.d.ts.map +1 -1
  73. package/dist/manifest.json +1 -1
  74. package/dist/meta.json +30 -0
  75. package/dist/okf/index.md +7 -1
  76. package/dist/okf/rules/SQLCH001.md +2 -2
  77. package/dist/okf/types/Dictionary.md +9 -0
  78. package/dist/okf/types/Function.md +9 -0
  79. package/dist/okf/types/Grant.md +9 -0
  80. package/dist/okf/types/Role.md +9 -0
  81. package/dist/okf/types/RowPolicy.md +9 -0
  82. package/dist/okf/types/User.md +9 -0
  83. package/dist/op/activities/clickhouse-rebuild.d.ts.map +1 -1
  84. package/dist/op/activity-contracts.d.ts +9 -0
  85. package/dist/op/activity-contracts.d.ts.map +1 -1
  86. package/dist/plugin.d.ts.map +1 -1
  87. package/dist/postgres/apply/statements.d.ts +68 -0
  88. package/dist/postgres/apply/statements.d.ts.map +1 -1
  89. package/dist/postgres/import/generator.d.ts +33 -0
  90. package/dist/postgres/import/generator.d.ts.map +1 -1
  91. package/dist/postgres/live/bind.d.ts.map +1 -1
  92. package/dist/postgres/live/client.d.ts +3 -0
  93. package/dist/postgres/live/client.d.ts.map +1 -1
  94. package/dist/rules/sqlch001.ts +26 -4
  95. package/dist/rules/sqlch002.ts +3 -2
  96. package/dist/rules/templates.ts +2 -2
  97. package/dist/serializer.d.ts +2 -1
  98. package/dist/serializer.d.ts.map +1 -1
  99. package/dist/sql-files.d.ts +79 -0
  100. package/dist/sql-files.d.ts.map +1 -0
  101. package/dist/token-source.d.ts +88 -0
  102. package/dist/token-source.d.ts.map +1 -0
  103. package/dist/validate.d.ts.map +1 -1
  104. package/package.json +2 -2
  105. package/src/clickhouse/access.test.ts +203 -0
  106. package/src/clickhouse/access.ts +595 -0
  107. package/src/clickhouse/apply/apply.ts +29 -20
  108. package/src/clickhouse/apply/statements.ts +105 -8
  109. package/src/clickhouse/dictionary.test.ts +177 -0
  110. package/src/clickhouse/entities.ts +356 -6
  111. package/src/clickhouse/function.test.ts +91 -0
  112. package/src/clickhouse/http.ts +11 -2
  113. package/src/clickhouse/import/generator.ts +81 -46
  114. package/src/clickhouse/import/import.test.ts +9 -3
  115. package/src/clickhouse/import/ir.ts +6 -2
  116. package/src/clickhouse/import/parser.ts +10 -18
  117. package/src/clickhouse/live/access.e2e.test.ts +218 -0
  118. package/src/clickhouse/live/bind.ts +17 -6
  119. package/src/clickhouse/live/catalog.ts +106 -10
  120. package/src/clickhouse/live/describe-resources.ts +23 -10
  121. package/src/clickhouse/live/dictionaries.e2e.test.ts +186 -0
  122. package/src/clickhouse/live/functions.e2e.test.ts +155 -0
  123. package/src/clickhouse/live/live.test.ts +2 -2
  124. package/src/clickhouse/parser.ts +136 -4
  125. package/src/clickhouse/plan/commands.ts +18 -7
  126. package/src/clickhouse/plan/deep.ts +71 -11
  127. package/src/clickhouse/plan/diff.ts +65 -2
  128. package/src/clickhouse/plan/normalize.ts +200 -6
  129. package/src/clickhouse/plan/report.ts +14 -3
  130. package/src/clickhouse/plan/rules.ts +44 -1
  131. package/src/clickhouse/plan/schema.ts +40 -17
  132. package/src/clickhouse/plan/server-format.ts +1 -1
  133. package/src/clickhouse/rebuild/backfill.ts +5 -25
  134. package/src/clickhouse/rebuild/observe.ts +7 -3
  135. package/src/clickhouse/rebuild/op.ts +9 -0
  136. package/src/clickhouse/rebuild/rebuild.e2e.test.ts +62 -0
  137. package/src/clickhouse/rebuild/rebuild.test.ts +54 -0
  138. package/src/clickhouse/rebuild/steps.ts +136 -1
  139. package/src/clickhouse/testing/fake-server.ts +2 -0
  140. package/src/clickhouse/testing/writable-server.ts +2 -0
  141. package/src/clickhouse/topology.ts +17 -2
  142. package/src/clickhouse.ts +19 -0
  143. package/src/codegen/classifier-page.ts +2 -0
  144. package/src/codegen/registry.ts +6 -0
  145. package/src/config.ts +12 -3
  146. package/src/core/references.ts +5 -3
  147. package/src/core/statements.ts +11 -1
  148. package/src/files/build-root.ts +62 -0
  149. package/src/files/clickhouse.ts +52 -0
  150. package/src/files/common.ts +54 -0
  151. package/src/files/postgres.ts +371 -0
  152. package/src/generated/lexicon-sql.json +30 -0
  153. package/src/import-parser.ts +61 -0
  154. package/src/index.ts +15 -2
  155. package/src/lint/rules/sqlch001.ts +26 -4
  156. package/src/lint/rules/sqlch002.ts +3 -2
  157. package/src/lint/rules/templates.ts +2 -2
  158. package/src/lsp/template.ts +3 -3
  159. package/src/mcp/index.ts +6 -6
  160. package/src/migration-statements.test.ts +25 -0
  161. package/src/migration-statements.ts +1 -0
  162. package/src/op/activities/clickhouse-rebuild.ts +1 -0
  163. package/src/op/activity-contracts.ts +1 -0
  164. package/src/plugin.ts +29 -8
  165. package/src/postgres/apply/constraint-sequences.e2e.test.ts +179 -0
  166. package/src/postgres/apply/safe-sequences.e2e.test.ts +176 -0
  167. package/src/postgres/apply/statements.test.ts +138 -6
  168. package/src/postgres/apply/statements.ts +156 -10
  169. package/src/postgres/import/generator.ts +118 -45
  170. package/src/postgres/live/bind.ts +17 -6
  171. package/src/postgres/live/client.ts +10 -2
  172. package/src/postgres/plan/plan.test.ts +2 -2
  173. package/src/postgres/plan/rules.ts +5 -5
  174. package/src/serializer.ts +14 -9
  175. package/src/skills/chant-sql-postgres-plan.md +3 -3
  176. package/src/skills/chant-sql-rebuild.md +3 -2
  177. package/src/skills/chant-sql.md +7 -1
  178. package/src/sql-files.test.ts +188 -0
  179. package/src/sql-files.ts +218 -0
  180. package/src/token-source.e2e.test.ts +142 -0
  181. package/src/token-source.test.ts +119 -0
  182. package/src/token-source.ts +189 -0
  183. package/src/validate.ts +6 -0
package/dist/config.d.ts CHANGED
@@ -20,7 +20,8 @@
20
20
  * A profile is keyed by chant environment, as `grafana.profiles.<env>` is:
21
21
  * the server `chant import --from <env>`, `chant lifecycle diff <env> --live`
22
22
  * and `plan` read. Credentials are named by their environment variable, never
23
- * written in the config. An environment with no profile falls back to
23
+ * written in the config, or minted as a short-lived token (`password:
24
+ * { token: "rds-iam" }`; `./token-source.ts`). An environment with no profile falls back to
24
25
  * `CLICKHOUSE_URL`, `CLICKHOUSE_USER` and `CLICKHOUSE_PASSWORD`, or for
25
26
  * Postgres `POSTGRES_URL`, `POSTGRES_USER` and `POSTGRES_PASSWORD`. A profile
26
27
  * whose `url` is `postgres://` or `postgresql://` is a Postgres server.
@@ -53,10 +54,31 @@ export declare const sqlProfileSchema: z.ZodObject<{
53
54
  user: z.ZodOptional<z.ZodObject<{
54
55
  env: z.ZodString;
55
56
  }, z.core.$strict>>;
56
- /** The password, named by its environment variable. */
57
- password: z.ZodOptional<z.ZodObject<{
57
+ /**
58
+ * The password, named by its environment variable, or a token source that
59
+ * mints a short-lived one when a connection needs it (#3685):
60
+ * `{ token: "rds-iam" }`, `{ token: "cloud-sql-iam" }`, `{ token: "entra" }`
61
+ * (Postgres), or `{ token: "command", command: ["./mint.sh"] }`, whose
62
+ * standard output is the password. A token is minted again before it
63
+ * expires. See `./token-source.ts`.
64
+ */
65
+ password: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
58
66
  env: z.ZodString;
59
- }, z.core.$strict>>;
67
+ }, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
68
+ token: z.ZodLiteral<"rds-iam">;
69
+ region: z.ZodOptional<z.ZodString>;
70
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
71
+ }, z.core.$strict>, z.ZodObject<{
72
+ token: z.ZodLiteral<"cloud-sql-iam">;
73
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
74
+ }, z.core.$strict>, z.ZodObject<{
75
+ token: z.ZodLiteral<"entra">;
76
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
77
+ }, z.core.$strict>, z.ZodObject<{
78
+ token: z.ZodLiteral<"command">;
79
+ command: z.ZodArray<z.ZodString>;
80
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
81
+ }, z.core.$strict>], "token">]>>;
60
82
  /**
61
83
  * The databases this environment's schema lives in. Import reads these and
62
84
  * nothing else; when omitted, every database except the server's own
@@ -187,10 +209,31 @@ export declare const sqlConfigSchema: z.ZodObject<{
187
209
  user: z.ZodOptional<z.ZodObject<{
188
210
  env: z.ZodString;
189
211
  }, z.core.$strict>>;
190
- /** The password, named by its environment variable. */
191
- password: z.ZodOptional<z.ZodObject<{
212
+ /**
213
+ * The password, named by its environment variable, or a token source that
214
+ * mints a short-lived one when a connection needs it (#3685):
215
+ * `{ token: "rds-iam" }`, `{ token: "cloud-sql-iam" }`, `{ token: "entra" }`
216
+ * (Postgres), or `{ token: "command", command: ["./mint.sh"] }`, whose
217
+ * standard output is the password. A token is minted again before it
218
+ * expires. See `./token-source.ts`.
219
+ */
220
+ password: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
192
221
  env: z.ZodString;
193
- }, z.core.$strict>>;
222
+ }, z.core.$strict>, z.ZodDiscriminatedUnion<[z.ZodObject<{
223
+ token: z.ZodLiteral<"rds-iam">;
224
+ region: z.ZodOptional<z.ZodString>;
225
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
226
+ }, z.core.$strict>, z.ZodObject<{
227
+ token: z.ZodLiteral<"cloud-sql-iam">;
228
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
229
+ }, z.core.$strict>, z.ZodObject<{
230
+ token: z.ZodLiteral<"entra">;
231
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
232
+ }, z.core.$strict>, z.ZodObject<{
233
+ token: z.ZodLiteral<"command">;
234
+ command: z.ZodArray<z.ZodString>;
235
+ ttlSeconds: z.ZodOptional<z.ZodNumber>;
236
+ }, z.core.$strict>], "token">]>>;
194
237
  /**
195
238
  * The databases this environment's schema lives in. Import reads these and
196
239
  * nothing else; when omitted, every database except the server's own
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;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A4E;AAC5E,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC"}
@@ -29,9 +29,11 @@ export declare function lineageJson(edges: readonly LineageEdge[], names: Map<De
29
29
  from: Array<string | null>;
30
30
  }>;
31
31
  /**
32
- * Export names in creation order: an object after everything it references.
32
+ * Export names in creation order: an object after everything it references,
33
+ * and after the names in `extra` (an object read from a `.sql` file that a
34
+ * template names as text, `../sql-files.ts`).
33
35
  * Ties break by export name, so the order is the same however the files were
34
36
  * discovered. A reference cycle is an error naming the cycle.
35
37
  */
36
- export declare function applyOrder(objects: Map<string, Referencing>, names: Map<Declarable, string>): string[];
38
+ export declare function applyOrder(objects: Map<string, Referencing>, names: Map<Declarable, string>, extra?: ReadonlyMap<string, readonly string[]>): string[];
37
39
  //# sourceMappingURL=references.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"references.d.ts","sourceRoot":"","sources":["../../src/core/references.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAGxD,uEAAuE;AACvE,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,uCAAuC;IACvC,IAAI,EAAE,OAAO,EAAE,CAAC;CACjB;AAED,kFAAkF;AAClF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,SAAS,EAAE,SAAS,OAAO,EAAE,CAAC;CACxC;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,GAAG,MAAM,GAAG,SAAS,CAOhG;AAED,6EAA6E;AAC7E,wBAAgB,WAAW,CAAC,KAAK,EAAE,SAAS,WAAW,EAAE,EAA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G,IAAI,CAAC,CAAA;CAAE,CAAC,CAM9J;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,GAAG,MAAM,EAAE,CAsBtJ"}
@@ -45,6 +45,17 @@ export interface StatementStep extends StepObject {
45
45
  waitsForMutation?: boolean;
46
46
  /** The statement removes data that is not recoverable (a column or table drop). */
47
47
  destructive?: boolean;
48
+ /**
49
+ * Postgres: the statement can fail on the rows already there (a NULL under
50
+ * SET NOT NULL, a duplicate under a unique index, a row a check or foreign
51
+ * key refuses). `sql` returns one row with one column, `n`, the count of
52
+ * rows it would fail on; run it before the first statement and stop when
53
+ * it is not zero (#3686).
54
+ */
55
+ precheck?: {
56
+ sql: string;
57
+ detail: string;
58
+ };
48
59
  }
49
60
  /** A change no statement makes in place, made by a migration Op. */
50
61
  export interface OpStep extends StepObject {
@@ -1 +1 @@
1
- {"version":3,"file":"statements.d.ts","sourceRoot":"","sources":["../../src/core/statements.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,iEAAiE;AACjE,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,IAAI,EAAE,MAAM,CAAC;IACb,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,sDAAsD;IACtD,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,uDAAuD;AACvD,MAAM,WAAW,UAAU;IACzB,6FAA6F;IAC7F,MAAM,EAAE,MAAM,CAAC;IACf,oEAAoE;IACpE,IAA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,CAAC;IACzB,wIAAwI;IACxI,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oFAAoF;IACpF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2DAA2D;IAC3D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gGAAgG;IAChG,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,sFAAsF;IACtF,OAAO,EAAE,OAAO,CAAC;IACjB,mGAAmG;IACnG,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,CAAC,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,eAAe,CAUzK;AAED,gJAAgJ;AAChJ,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAe9D"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * The `.sql` files in a project's source directory, read into declarations
3
+ * at build time (the plugin's `buildRoots` hook): each file's objects join
4
+ * the tagged templates' as if an import had written them, with the
5
+ * references between the two as interpolations (`../sql-files.ts`).
6
+ *
7
+ * The files are found by the walk source discovery uses, so `dist`,
8
+ * git-ignored paths, child projects and the project's `exclude` globs are
9
+ * left out. A file whose first lines carry `-- chant-discovery-skip` (or the
10
+ * `/* chant-discovery-skip *\/` form) is not read, for SQL that is not schema:
11
+ * seed data, a migration, a query.
12
+ *
13
+ * The dialect is the declarations': a project whose templates are Postgres
14
+ * reads its files as Postgres. With no templates it is `sql.dialect`, and
15
+ * ClickHouse when that is unset, as for the rest of the lexicon.
16
+ */
17
+ import type { Declarable } from "@intentius/chant/declarable";
18
+ import type { BuildRootContext, BuildRootContribution } from "@intentius/chant/lexicon";
19
+ import { type SqlDialect } from "../dialects.js";
20
+ /** Whether a file is a `.sql` file to read: the name, and no skip or generated marker. */
21
+ export declare function isSqlSourceFile(name: string, full: string): boolean;
22
+ /** The dialect the project's `.sql` files are read as. */
23
+ export declare function filesDialect(entities: ReadonlyMap<string, Declarable> | undefined, config: Record<string, unknown>): SqlDialect;
24
+ /** The `buildRoots` contribution: every `.sql` file's declarations, or nothing when the source directory holds none. */
25
+ export declare function sqlFilesBuildRoot(ctx: BuildRootContext): Promise<BuildRootContribution>;
26
+ //# sourceMappingURL=build-root.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-root.d.ts","sourceRoot":"","sources":["../../src/files/build-root.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC;AAGxF,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAQ5D,0FAA0F;AAC1F,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAInE;AAED,0DAA0D;AAC1D,wBAAgB,YAAY,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,UAAU,CAAC,GAAG,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,UAAU,CAY/H;AAED,wHAAwH;AACxH,wBAAsB,iBAAiB,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAO7F"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * A file of ClickHouse DDL as the objects it declares: one per `CREATE
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.
6
+ *
7
+ * With `schema` (a database), an object's unqualified name is qualified with
8
+ * it; a function belongs to no database and keeps its name.
9
+ */
10
+ import type { Declarable } from "@intentius/chant/declarable";
11
+ import { type ImportedObject } from "../clickhouse/import/ir.js";
12
+ import { type ReadOptions } from "./common.js";
13
+ type Tag = (strings: TemplateStringsArray, ...values: unknown[]) => Declarable;
14
+ /** The tag that declares an entity type. */
15
+ export declare function clickhouseTag(type: string): Tag | undefined;
16
+ /** The objects a file of ClickHouse DDL declares. Problems are collected, not thrown, so a file is reported whole. */
17
+ export declare function readClickHouse(ddl: string, options: ReadOptions, problems: string[]): ImportedObject[];
18
+ export {};
19
+ //# sourceMappingURL=clickhouse.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,25 @@
1
+ /** What reading a file of DDL shares across dialects. */
2
+ import type { Token } from "../core/tokens.js";
3
+ export interface ReadOptions {
4
+ /** Names the DDL in errors: a file's path, a command. */
5
+ origin: string;
6
+ /**
7
+ * The Postgres schema (ClickHouse database) for the names the DDL leaves
8
+ * unqualified, as an ORM does when the schema comes from its connection.
9
+ */
10
+ schema?: string;
11
+ }
12
+ /** A file of DDL with statements that declare nothing chant can hold: each problem names its statement. */
13
+ export declare class SqlFileError extends Error {
14
+ readonly origin: string;
15
+ readonly problems: readonly string[];
16
+ constructor(origin: string, problems: readonly string[]);
17
+ }
18
+ /** The statements of a file, each as its tokens (trivia kept inside, trimmed at the ends), split on top-level `;`. */
19
+ export declare function splitTokens(tokens: readonly Token[], isTrivia: (t: Token) => boolean): Token[][];
20
+ export declare const tokensText: (tokens: readonly Token[]) => string;
21
+ /** A statement's first line, for a message. */
22
+ export declare const firstLine: (s: string) => string;
23
+ /** A name as SQL text: bare when it is a plain lower-case identifier, else double-quoted. */
24
+ export declare const quoteBare: (name: string) => string;
25
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/files/common.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAEzD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,2GAA2G;AAC3G,qBAAa,YAAa,SAAQ,KAAK;IAEnC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE;gBAD3B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,SAAS,MAAM,EAAE;CAOvC;AAED,sHAAsH;AACtH,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,KAAK,OAAO,GAAG,KAAK,EAAE,EAAE,CAiBhG;AAED,eAAO,MAAM,UAAU,GAAI,QAAQ,SAAS,KAAK,EAAE,KAAG,MAA4C,CAAC;AAEnG,+CAA+C;AAC/C,eAAO,MAAM,SAAS,GAAI,GAAG,MAAM,KAAG,MAAgD,CAAC;AAEvF,6FAA6F;AAC7F,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,KAAG,MAAoF,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * A file of Postgres DDL as the objects it declares: each `CREATE` (and each
3
+ * `GRANT`, `REVOKE` and `ALTER DEFAULT PRIVILEGES`) is one object, and the
4
+ * statements that only finish one are folded into it:
5
+ *
6
+ * - `COMMENT ON` joins the object it comments on, wherever in the file it is;
7
+ * - `ALTER TABLE ... ENABLE | DISABLE | FORCE ROW LEVEL SECURITY` joins its table;
8
+ * - `ALTER TABLE <t> ADD [CONSTRAINT <c>] FOREIGN KEY | UNIQUE | PRIMARY KEY |
9
+ * CHECK | EXCLUDE ...`, the form `pg_dump` and ORMs print constraints in,
10
+ * becomes a table constraint in `<t>`'s `CREATE TABLE`.
11
+ *
12
+ * `BEGIN` and `COMMIT` are skipped. Any other statement, and any statement
13
+ * the parser or its tag refuses, is a problem naming it: a statement left
14
+ * out would be a schema change nobody declared.
15
+ *
16
+ * With `schema`, the names the DDL leaves unqualified are qualified with it,
17
+ * as an ORM's connection would: an object's own name, an index's, trigger's
18
+ * or policy's table, a foreign key's table, a comment's target, and a column
19
+ * type naming an enum or domain the file creates.
20
+ */
21
+ import type { Declarable } from "@intentius/chant/declarable";
22
+ import type { ImportedPgObject } from "../postgres/import/ir.js";
23
+ import { type ReadOptions } from "./common.js";
24
+ type Tag = (strings: TemplateStringsArray, ...values: unknown[]) => Declarable;
25
+ /** The tag that declares an entity type. */
26
+ export declare function postgresTag(type: string): Tag | undefined;
27
+ /** A tagged-template call's strings from template-literal text: `raw` as written, as the tag reads it. */
28
+ export declare function templateStrings(parts: readonly string[]): TemplateStringsArray;
29
+ /**
30
+ * The objects a file of Postgres DDL declares, each with its statements
31
+ * joined as one declaration's DDL. Problems are collected, not thrown, so a
32
+ * file is reported whole.
33
+ */
34
+ export declare function readPostgres(ddl: string, options: ReadOptions, problems: string[]): ImportedPgObject[];
35
+ export {};
36
+ //# sourceMappingURL=postgres.d.ts.map
@@ -0,0 +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,uBAAuB,CAAC;AAC9D,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;AAE/E,4CAA4C;AAC5C,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG,GAAG,SAAS,CAGzD;AAED,0GAA0G;AAC1G,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,oBAAoB,CAE9E;AAwBD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,gBAAgB,EAAE,CA2ItG"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * `chant import schema.sql`: a file of DDL into the import IR, in either
3
+ * dialect. `--parser-option dialect=postgres` (or `clickhouse`) names it;
4
+ * without one it is read off the statements: an `ENGINE =` clause, a
5
+ * `CREATE DATABASE`, a `CREATE DICTIONARY` or a lambda `CREATE FUNCTION f AS
6
+ * (x) -> ...` is ClickHouse, a statement
7
+ * only Postgres has (`CREATE SCHEMA`, `CREATE INDEX`, `COMMENT ON`, `ALTER
8
+ * TABLE`, `GRANT`, ...) or a `CREATE TABLE` with no engine is Postgres, and
9
+ * anything else is ClickHouse.
10
+ *
11
+ * A statement that declares nothing, or does not parse, is an error naming
12
+ * it (`./sql-files.ts`); none is left out.
13
+ */
14
+ import type { ParserOptions, TemplateIR, TemplateParser } from "@intentius/chant/import/parser";
15
+ import { type SqlDialect } from "./dialects.js";
16
+ /** The dialect a file of DDL is written in, read off its statements. */
17
+ export declare function guessDialect(content: string): SqlDialect;
18
+ /** The `dialect` parser option, checked. */
19
+ export declare function dialectOption(options: ParserOptions | undefined): SqlDialect | undefined;
20
+ export declare class SqlFileParser implements TemplateParser {
21
+ private readonly dialect?;
22
+ constructor(dialect?: SqlDialect | undefined);
23
+ parse(content: string): TemplateIR;
24
+ }
25
+ //# sourceMappingURL=import-parser.d.ts.map
@@ -0,0 +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"}
package/dist/index.d.ts CHANGED
@@ -2,7 +2,8 @@ export { sqlPlugin } from "./plugin.js";
2
2
  export { sqlSerializer } from "./serializer.js";
3
3
  export { SQL_DIALECTS, type SqlDialect } from "./dialects.js";
4
4
  export { sqlConfigSchema, type SqlConfig } from "./config.js";
5
- export { database, table, view, literal } from "./clickhouse/entities.js";
6
- export { schema, index, sequence, type, domain, extension, func, procedure, trigger, policy, role, grant } from "./postgres/entities.js";
5
+ export { database, table, view, dictionary, user, role, policy, grant, literal } from "./clickhouse/entities.js";
6
+ export { schema, index, sequence, type, domain, extension, func, procedure, trigger } from "./postgres/entities.js";
7
7
  export { diffStatements, renderStatements, type DiffStatementsOptions, type ManualStep, type MigrationStep, type OpStep, type SchemaStatements, type StatementChange, type StatementStep, type StepObject, } from "./migration-statements.js";
8
+ export { readSqlFile, sqlFileDeclarations, sqlFileEntities, sqlFileOf, SqlFileError, type SqlFileObject, type SqlFileOptions, type SqlFileSource, } from "./sql-files.js";
8
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAM3D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAMvE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAItI,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,UAAU,GAChB,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAM3D,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAM9G,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAIjH,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,UAAU,GAChB,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EACL,WAAW,EACX,mBAAmB,EACnB,eAAe,EACf,SAAS,EACT,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,cAAc,EACnB,KAAK,aAAa,GACnB,MAAM,aAAa,CAAC"}
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "5342ab8fb2298c0d3ac08f6bca495e7b5420caff562ad0f03631a4994a650e09",
5
- "meta.json": "ce82d6d2d1e8dfa8b2dde670dd06f1af7a023d131cc87da854e669961b119387",
4
+ "manifest.json": "e2bf7028a41757883dc8f527812bce692e5d90dc5f84c1ab2a593f76735f3a91",
5
+ "meta.json": "44b1dcfa5b5e5be2239fdc9614ab6c11d3f1461d64e61d572e3658af6c96aa68",
6
6
  "types/index.d.ts": "0286ebb367773e84c76818b0f69cb14cff8328fd2f8c65ed87563c8d5815458c",
7
7
  "rules/postgres-templates.ts": "da6e305bc2ff3d0d64a20925fe588e051c2a4b556b37f2581c61c314ef7c580d",
8
- "rules/sqlch001.ts": "5b017574aecb4fdce084c44d02f4012696a1f63d16c8f9b9863d59499a64ca64",
9
- "rules/sqlch002.ts": "466b9db60241efa59f456bcbb69dedc7f93b29730c53c404ab04816af81fedfe",
8
+ "rules/sqlch001.ts": "042af8bf78ea64524657eafa7a739734800cf99956bfa6152948684bede46955",
9
+ "rules/sqlch002.ts": "d866298167d3f2f7b39bddd28cfbb4a761281a2816d6c21db19b86b32434737a",
10
10
  "rules/sqlch003.ts": "16ee8bf9369d97cf72b021d32636e5cc23bd168a51981eef826228c24fa8a8e9",
11
11
  "rules/sqlpg001.ts": "c6f0cb4da0b8deff16d33be2253eab2d500e82a74d28c264eba9aeada132c85f",
12
12
  "rules/sqlpg002.ts": "547e10e4da7a78b149b632eba21d876cb710b77fa654c7eed8ce86e27e37e81b",
13
13
  "rules/sqlpg003.ts": "6f4903f9fdd3eb87bd4db3ad7e8fa0320db20f719ead7685a03cf7da677a7183",
14
14
  "rules/sqlpg004.ts": "68e4eaaa455f155d6dfe779eb01d7f134d856ab5db7cf45e2eb110ed7147b580",
15
- "rules/templates.ts": "e35c0e05d5fe3b04c4149c5131580de143a0ed62fe1fdf25e41db268b73b5fa2",
15
+ "rules/templates.ts": "f021609378d287d5e2dc763b022fa10ef74f402fa59d380a238c5ceed2995fd8",
16
16
  "rules/audit-entries.ts": "946a937d96726c01778f3e11bc3e3ff84fdb4fb0533bb0159222276a293301e9",
17
17
  "rules/clickhouse-helpers.ts": "cdbbfd53ecf2cf912ecc60a9aeb2fd5d66db3665dc5b541a3a336904dc385b8a",
18
18
  "rules/postgres-audit-entries.ts": "5d868f35486cfbfa44ff12834bac47b3354c3b49bd356dbea12b9f17571e0b46",
@@ -57,5 +57,5 @@
57
57
  "rules/sqlpg117.ts": "3d5c2d57ccdee3cf91c3ba3cb6363750787a850df8ebd75e9cc3f33113303827",
58
58
  "rules/sqlpg118.ts": "e2a40a88a9374c4d99d02118ca4c60877ba0c6eb1ce603a93b24f5fd23d81dde"
59
59
  },
60
- "composite": "cddb6da3258bed32ced4c09ac6435b0207a2803f610017e5ac95ec3c3626725f"
60
+ "composite": "bd178b112dd161bc7445a81be2f7471b080eff8ad34e48ce2b7601d32f11823e"
61
61
  }
@@ -1,6 +1,6 @@
1
1
  import type { LintRule } from "@intentius/chant/lint/rule";
2
2
  /**
3
- * SQLCH001: the DDL in a `database`, `table` or `view` template does not parse, or holds another statement than its tag.
3
+ * SQLCH001: the DDL in a ClickHouse template (`database`, `table`, `view`, `dictionary`, `func`, `user`, `role`, `policy`, `grant`) does not parse, or holds another statement than its tag.
4
4
  *
5
5
  * The same parse runs when the build calls the tag, and fails the build there.
6
6
  * This rule reports it in the editor and in `chant lint`, at the token, before
@@ -1 +1 @@
1
- {"version":3,"file":"sqlch001.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/sqlch001.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA+B,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAOxF;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,EAAE,QAoCtB,CAAC"}
1
+ {"version":3,"file":"sqlch001.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/sqlch001.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA+B,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAaxF;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,EAAE,QAoDtB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"sqlch002.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/sqlch002.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA+B,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAkDxF;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,QAwDtB,CAAC"}
1
+ {"version":3,"file":"sqlch002.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/sqlch002.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA+B,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAmDxF;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,QAwDtB,CAAC"}
@@ -10,7 +10,7 @@ import type * as ts from "typescript";
10
10
  import { type Token } from "../../clickhouse/tokens.js";
11
11
  import { type FoundTemplate as SqlFoundTemplate, type TemplateSource } from "../../core/find-templates.js";
12
12
  export { templatePosition, tokenPosition } from "../../core/find-templates.js";
13
- export type SqlTag = "database" | "table" | "view";
13
+ export type SqlTag = "database" | "table" | "view" | "dictionary" | "func" | "user" | "role" | "policy" | "grant";
14
14
  /**
15
15
  * The ClickHouse tags, by the modules they are imported from. The package
16
16
  * root still exports them, so it counts as ClickHouse too.
@@ -1 +1 @@
1
- {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAoB,KAAK,aAAa,IAAI,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE1H,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE5E,MAAM,MAAM,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,cAAc,CAAC,MAAM,CAI7D,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAErD,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,GAAG,aAAa,EAAE,CAEpE;AAED,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,KAAG,KAAK,EAA2B,CAAC"}
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/lint/rules/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAoB,KAAK,aAAa,IAAI,gBAAgB,EAAE,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE1H,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE5E,MAAM,MAAM,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElH;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,cAAc,CAAC,MAAM,CAI7D,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAErD,wEAAwE;AACxE,wBAAgB,aAAa,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,GAAG,aAAa,EAAE,CAEpE;AAED,eAAO,MAAM,QAAQ,GAAI,OAAO,aAAa,KAAG,KAAK,EAA2B,CAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sql",
3
- "version": "0.117.0",
3
+ "version": "0.118.0",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "SQL",
6
6
  "intrinsics": [],
package/dist/meta.json CHANGED
@@ -19,6 +19,36 @@
19
19
  "kind": "resource",
20
20
  "lexicon": "sql"
21
21
  },
22
+ "Dictionary": {
23
+ "resourceType": "ClickHouse::Dictionary",
24
+ "kind": "resource",
25
+ "lexicon": "sql"
26
+ },
27
+ "Function": {
28
+ "resourceType": "ClickHouse::Function",
29
+ "kind": "resource",
30
+ "lexicon": "sql"
31
+ },
32
+ "User": {
33
+ "resourceType": "ClickHouse::User",
34
+ "kind": "resource",
35
+ "lexicon": "sql"
36
+ },
37
+ "Role": {
38
+ "resourceType": "ClickHouse::Role",
39
+ "kind": "resource",
40
+ "lexicon": "sql"
41
+ },
42
+ "RowPolicy": {
43
+ "resourceType": "ClickHouse::RowPolicy",
44
+ "kind": "resource",
45
+ "lexicon": "sql"
46
+ },
47
+ "Grant": {
48
+ "resourceType": "ClickHouse::Grant",
49
+ "kind": "resource",
50
+ "lexicon": "sql"
51
+ },
22
52
  "PostgresSchema": {
23
53
  "resourceType": "Postgres::Schema",
24
54
  "kind": "resource",
package/dist/okf/index.md CHANGED
@@ -5,6 +5,9 @@ okf_version: '0.2'
5
5
  # Resource types
6
6
 
7
7
  * [Database](/types/Database.md) - ClickHouse::Database
8
+ * [Dictionary](/types/Dictionary.md) - ClickHouse::Dictionary
9
+ * [Function](/types/Function.md) - ClickHouse::Function
10
+ * [Grant](/types/Grant.md) - ClickHouse::Grant
8
11
  * [MaterializedView](/types/MaterializedView.md) - ClickHouse::MaterializedView
9
12
  * [PostgresDefaultPrivileges](/types/PostgresDefaultPrivileges.md) - Postgres::DefaultPrivileges
10
13
  * [PostgresDomain](/types/PostgresDomain.md) - Postgres::Domain
@@ -22,12 +25,15 @@ okf_version: '0.2'
22
25
  * [PostgresTable](/types/PostgresTable.md) - Postgres::Table
23
26
  * [PostgresTrigger](/types/PostgresTrigger.md) - Postgres::Trigger
24
27
  * [PostgresView](/types/PostgresView.md) - Postgres::View
28
+ * [Role](/types/Role.md) - ClickHouse::Role
29
+ * [RowPolicy](/types/RowPolicy.md) - ClickHouse::RowPolicy
25
30
  * [Table](/types/Table.md) - ClickHouse::Table
31
+ * [User](/types/User.md) - ClickHouse::User
26
32
  * [View](/types/View.md) - ClickHouse::View
27
33
 
28
34
  # Rules
29
35
 
30
- * [SQLCH001](/rules/SQLCH001.md) - the DDL in a `database`, `table` or `view` template does not parse, or holds another statement than its tag.
36
+ * [SQLCH001](/rules/SQLCH001.md) - the DDL in a ClickHouse template (`database`, `table`, `view`, `dictionary`, `func`, `user`, `role`, `policy`, `grant`) does not parse, or holds another stat...
31
37
  * [SQLCH002](/rules/SQLCH002.md) - a `Nullable` column in a table's sort key or primary key.
32
38
  * [SQLCH003](/rules/SQLCH003.md) - a column written as `${events.kind}` instead of `${events.columns.kind}`.
33
39
  * [SQLCH101](/rules/SQLCH101.md) - A ClickHouse object names an engine the pinned server does not have
@@ -1,11 +1,11 @@
1
1
  ---
2
2
  type: lint-rule
3
3
  title: SQLCH001
4
- description: the DDL in a `database`, `table` or `view` template does not parse, or holds another statement than its tag.
4
+ description: the DDL in a ClickHouse template (`database`, `table`, `view`, `dictionary`, `func`, `user`, `role`, `policy`, `grant`) does not parse, or holds another statement than its tag.
5
5
  id: SQLCH001
6
6
  severity: error
7
7
  category: correctness
8
8
  lexicon: sql
9
9
  docs: https://intentius.io/chant/lexicons/sql/rules/
10
10
  ---
11
- the DDL in a `database`, `table` or `view` template does not parse, or holds another statement than its tag.
11
+ the DDL in a ClickHouse template (`database`, `table`, `view`, `dictionary`, `func`, `user`, `role`, `policy`, `grant`) does not parse, or holds another statement than its tag.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: Dictionary
4
+ description: sql resource type ClickHouse::Dictionary
5
+ name: Dictionary
6
+ lexicon: sql
7
+ resource_type: ClickHouse::Dictionary
8
+ ---
9
+ `ClickHouse::Dictionary`, a resource type of the sql lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: Function
4
+ description: sql resource type ClickHouse::Function
5
+ name: Function
6
+ lexicon: sql
7
+ resource_type: ClickHouse::Function
8
+ ---
9
+ `ClickHouse::Function`, a resource type of the sql lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: Grant
4
+ description: sql resource type ClickHouse::Grant
5
+ name: Grant
6
+ lexicon: sql
7
+ resource_type: ClickHouse::Grant
8
+ ---
9
+ `ClickHouse::Grant`, a resource type of the sql lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: Role
4
+ description: sql resource type ClickHouse::Role
5
+ name: Role
6
+ lexicon: sql
7
+ resource_type: ClickHouse::Role
8
+ ---
9
+ `ClickHouse::Role`, a resource type of the sql lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: RowPolicy
4
+ description: sql resource type ClickHouse::RowPolicy
5
+ name: RowPolicy
6
+ lexicon: sql
7
+ resource_type: ClickHouse::RowPolicy
8
+ ---
9
+ `ClickHouse::RowPolicy`, a resource type of the sql lexicon.
@@ -0,0 +1,9 @@
1
+ ---
2
+ type: resource-type
3
+ title: User
4
+ description: sql resource type ClickHouse::User
5
+ name: User
6
+ lexicon: sql
7
+ resource_type: ClickHouse::User
8
+ ---
9
+ `ClickHouse::User`, a resource type of the sql lexicon.
@@ -1 +1 @@
1
- {"version":3,"file":"clickhouse-rebuild.d.ts","sourceRoot":"","sources":["../../../src/op/activities/clickhouse-rebuild.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAK3D,OAAO,EAAY,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACrG,OAAO,EAA2C,KAAK,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC7G,OAAO,EAOL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,KAAK,UAAU,EAChB,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAKzE,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