@intentius/chant-lexicon-sql 0.121.0 → 0.122.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 (150) hide show
  1. package/dist/clickhouse/catalog-types.d.ts +8 -0
  2. package/dist/clickhouse/catalog-types.d.ts.map +1 -1
  3. package/dist/clickhouse/overlays/codecs.d.ts.map +1 -1
  4. package/dist/clickhouse/overlays/kinds.d.ts +1 -1
  5. package/dist/clickhouse/overlays/kinds.d.ts.map +1 -1
  6. package/dist/clickhouse/overlays/types.d.ts.map +1 -1
  7. package/dist/clickhouse/type-syntax.d.ts +33 -0
  8. package/dist/clickhouse/type-syntax.d.ts.map +1 -0
  9. package/dist/codegen/clickhouse-module.d.ts.map +1 -1
  10. package/dist/codegen/postgres-module.d.ts.map +1 -1
  11. package/dist/generated/clickhouse.d.ts +7 -1
  12. package/dist/generated/clickhouse.d.ts.map +1 -1
  13. package/dist/generated/postgres.d.ts +6 -0
  14. package/dist/generated/postgres.d.ts.map +1 -1
  15. package/dist/integrity.json +23 -5
  16. package/dist/lint/audit-catalog.d.ts.map +1 -1
  17. package/dist/lint/post-synth/audit-entries.d.ts.map +1 -1
  18. package/dist/lint/post-synth/clickhouse-type-check.d.ts +37 -0
  19. package/dist/lint/post-synth/clickhouse-type-check.d.ts.map +1 -0
  20. package/dist/lint/post-synth/index.d.ts.map +1 -1
  21. package/dist/lint/post-synth/postgres-audit-entries.d.ts.map +1 -1
  22. package/dist/lint/post-synth/postgres-names.d.ts +149 -0
  23. package/dist/lint/post-synth/postgres-names.d.ts.map +1 -0
  24. package/dist/lint/post-synth/sql101.d.ts +9 -0
  25. package/dist/lint/post-synth/sql101.d.ts.map +1 -0
  26. package/dist/lint/post-synth/sqlch121.d.ts +10 -0
  27. package/dist/lint/post-synth/sqlch121.d.ts.map +1 -0
  28. package/dist/lint/post-synth/sqlch122.d.ts +10 -0
  29. package/dist/lint/post-synth/sqlch122.d.ts.map +1 -0
  30. package/dist/lint/post-synth/sqlch123.d.ts +9 -0
  31. package/dist/lint/post-synth/sqlch123.d.ts.map +1 -0
  32. package/dist/lint/post-synth/sqlch124.d.ts +6 -0
  33. package/dist/lint/post-synth/sqlch124.d.ts.map +1 -0
  34. package/dist/lint/post-synth/sqlch125.d.ts +11 -0
  35. package/dist/lint/post-synth/sqlch125.d.ts.map +1 -0
  36. package/dist/lint/post-synth/sqlch126.d.ts +12 -0
  37. package/dist/lint/post-synth/sqlch126.d.ts.map +1 -0
  38. package/dist/lint/post-synth/sqlch127.d.ts +22 -0
  39. package/dist/lint/post-synth/sqlch127.d.ts.map +1 -0
  40. package/dist/lint/post-synth/sqlpg119.d.ts +18 -0
  41. package/dist/lint/post-synth/sqlpg119.d.ts.map +1 -0
  42. package/dist/lint/post-synth/sqlpg120.d.ts +17 -0
  43. package/dist/lint/post-synth/sqlpg120.d.ts.map +1 -0
  44. package/dist/lint/post-synth/sqlpg121.d.ts +12 -0
  45. package/dist/lint/post-synth/sqlpg121.d.ts.map +1 -0
  46. package/dist/lint/post-synth/sqlpg122.d.ts +12 -0
  47. package/dist/lint/post-synth/sqlpg122.d.ts.map +1 -0
  48. package/dist/lint/post-synth/sqlpg123.d.ts +17 -0
  49. package/dist/lint/post-synth/sqlpg123.d.ts.map +1 -0
  50. package/dist/lint/post-synth/sqlpg124.d.ts +16 -0
  51. package/dist/lint/post-synth/sqlpg124.d.ts.map +1 -0
  52. package/dist/lint/post-synth/sqlpg125.d.ts +17 -0
  53. package/dist/lint/post-synth/sqlpg125.d.ts.map +1 -0
  54. package/dist/lint/post-synth/sqlpg126.d.ts +19 -0
  55. package/dist/lint/post-synth/sqlpg126.d.ts.map +1 -0
  56. package/dist/manifest.json +1 -1
  57. package/dist/okf/index.md +16 -0
  58. package/dist/okf/rules/SQL101.md +23 -0
  59. package/dist/okf/rules/SQLCH121.md +11 -0
  60. package/dist/okf/rules/SQLCH122.md +11 -0
  61. package/dist/okf/rules/SQLCH123.md +11 -0
  62. package/dist/okf/rules/SQLCH124.md +18 -0
  63. package/dist/okf/rules/SQLCH125.md +11 -0
  64. package/dist/okf/rules/SQLCH126.md +15 -0
  65. package/dist/okf/rules/SQLCH127.md +15 -0
  66. package/dist/okf/rules/SQLPG119.md +16 -0
  67. package/dist/okf/rules/SQLPG120.md +16 -0
  68. package/dist/okf/rules/SQLPG121.md +11 -0
  69. package/dist/okf/rules/SQLPG122.md +15 -0
  70. package/dist/okf/rules/SQLPG123.md +16 -0
  71. package/dist/okf/rules/SQLPG124.md +11 -0
  72. package/dist/okf/rules/SQLPG125.md +11 -0
  73. package/dist/okf/rules/SQLPG126.md +11 -0
  74. package/dist/okf/types/Dictionary.md +4 -0
  75. package/dist/okf/types/Function.md +5 -0
  76. package/dist/okf/types/Grant.md +6 -0
  77. package/dist/okf/types/MaterializedView.md +1 -0
  78. package/dist/okf/types/PostgresDefaultPrivileges.md +4 -0
  79. package/dist/okf/types/PostgresDomain.md +2 -0
  80. package/dist/okf/types/PostgresEnum.md +1 -0
  81. package/dist/okf/types/PostgresFunction.md +4 -0
  82. package/dist/okf/types/PostgresGrant.md +5 -0
  83. package/dist/okf/types/PostgresPolicy.md +4 -0
  84. package/dist/okf/types/PostgresProcedure.md +4 -0
  85. package/dist/okf/types/PostgresSequence.md +2 -0
  86. package/dist/okf/types/PostgresTrigger.md +4 -0
  87. package/dist/okf/types/RowPolicy.md +4 -0
  88. package/dist/okf/types/Table.md +1 -0
  89. package/dist/okf/types/View.md +1 -0
  90. package/dist/postgres/overlays/extension-objects.d.ts +28 -0
  91. package/dist/postgres/overlays/extension-objects.d.ts.map +1 -0
  92. package/dist/postgres/overlays/types.d.ts +10 -0
  93. package/dist/postgres/overlays/types.d.ts.map +1 -1
  94. package/dist/rules/audit-entries.ts +7 -0
  95. package/dist/rules/clickhouse-type-check.ts +173 -0
  96. package/dist/rules/postgres-audit-entries.ts +8 -0
  97. package/dist/rules/postgres-names.ts +506 -0
  98. package/dist/rules/sql101.ts +62 -0
  99. package/dist/rules/sqlch121.ts +12 -0
  100. package/dist/rules/sqlch122.ts +12 -0
  101. package/dist/rules/sqlch123.ts +11 -0
  102. package/dist/rules/sqlch124.ts +21 -0
  103. package/dist/rules/sqlch125.ts +56 -0
  104. package/dist/rules/sqlch126.ts +57 -0
  105. package/dist/rules/sqlch127.ts +128 -0
  106. package/dist/rules/sqlpg119.ts +37 -0
  107. package/dist/rules/sqlpg120.ts +70 -0
  108. package/dist/rules/sqlpg121.ts +32 -0
  109. package/dist/rules/sqlpg122.ts +28 -0
  110. package/dist/rules/sqlpg123.ts +63 -0
  111. package/dist/rules/sqlpg124.ts +47 -0
  112. package/dist/rules/sqlpg125.ts +40 -0
  113. package/dist/rules/sqlpg126.ts +37 -0
  114. package/package.json +2 -2
  115. package/src/clickhouse/catalog-types.ts +9 -0
  116. package/src/clickhouse/overlays/codecs.ts +6 -2
  117. package/src/clickhouse/overlays/kinds.ts +1 -1
  118. package/src/clickhouse/overlays/types.ts +20 -3
  119. package/src/clickhouse/type-syntax.ts +82 -0
  120. package/src/codegen/clickhouse-module.ts +15 -1
  121. package/src/codegen/postgres-module.ts +43 -0
  122. package/src/composites/composites.test.ts +7 -6
  123. package/src/generated/clickhouse.ts +1905 -6
  124. package/src/generated/postgres.ts +2639 -0
  125. package/src/lint/audit-catalog.ts +8 -0
  126. package/src/lint/post-synth/audit-entries.ts +7 -0
  127. package/src/lint/post-synth/clickhouse-catalog-checks.test.ts +315 -0
  128. package/src/lint/post-synth/clickhouse-type-check.ts +173 -0
  129. package/src/lint/post-synth/index.ts +32 -0
  130. package/src/lint/post-synth/postgres-audit-entries.ts +8 -0
  131. package/src/lint/post-synth/postgres-checks.test.ts +214 -1
  132. package/src/lint/post-synth/postgres-names.ts +506 -0
  133. package/src/lint/post-synth/sql101.ts +62 -0
  134. package/src/lint/post-synth/sqlch121.ts +12 -0
  135. package/src/lint/post-synth/sqlch122.ts +12 -0
  136. package/src/lint/post-synth/sqlch123.ts +11 -0
  137. package/src/lint/post-synth/sqlch124.ts +21 -0
  138. package/src/lint/post-synth/sqlch125.ts +56 -0
  139. package/src/lint/post-synth/sqlch126.ts +57 -0
  140. package/src/lint/post-synth/sqlch127.ts +128 -0
  141. package/src/lint/post-synth/sqlpg119.ts +37 -0
  142. package/src/lint/post-synth/sqlpg120.ts +70 -0
  143. package/src/lint/post-synth/sqlpg121.ts +32 -0
  144. package/src/lint/post-synth/sqlpg122.ts +28 -0
  145. package/src/lint/post-synth/sqlpg123.ts +63 -0
  146. package/src/lint/post-synth/sqlpg124.ts +47 -0
  147. package/src/lint/post-synth/sqlpg125.ts +40 -0
  148. package/src/lint/post-synth/sqlpg126.ts +37 -0
  149. package/src/postgres/overlays/extension-objects.ts +100 -0
  150. package/src/postgres/overlays/types.ts +25 -0
@@ -49,6 +49,14 @@ export interface TypeFamilySpec {
49
49
  canonical: string;
50
50
  caseInsensitive: boolean;
51
51
  }
52
+ /** A function the server has: \`system.functions\`. */
53
+ export interface FunctionSpec {
54
+ aggregate: boolean;
55
+ /** The server resolves the name in any case. */
56
+ caseInsensitive: boolean;
57
+ /** The function this name is an alias of. */
58
+ aliasOf?: string;
59
+ }
52
60
  export interface CodecSpec {
53
61
  compression: boolean;
54
62
  generic: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"catalog-types.d.ts","sourceRoot":"","sources":["../../src/clickhouse/catalog-types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC;AAElE,gHAAgH;AAChH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,Q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ources":["../../../src/clickhouse/overlays/codecs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,WAAW,YAAY;IAC3B,kGAAkG;IAClG,UAAU,EAAE,SAAS,CAAC,eAAe,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,GAAG,SAAS,CAAC;IACxE;;;;OAIG;IACH,IAAI,EAAE,eAAe,GAAG,aAAa,GAAG,YAAY,GAAG,MAAM,GAAG,UAAU,CAAC;CAC5E;AASD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAiCtD,CAAC"}
1
+ {"version":3,"file":"codecs.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/overlays/codecs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,WAAW,YAAY;IAC3B,kGAAkG;IAClG,UAAU,EAAE,SAAS,CAAC,eAAe,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,EAAE,GAAG,SAAS,CAAC;IACxE;;;;OAIG;IACH,IAAI,EAAE,eAAe,GAAG,aAAa,GAAG,YAAY,GAAG,MAAM,GAAG,UAAU,CAAC;CAC5E;AAUD,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAoCtD,CAAC"}
@@ -28,7 +28,7 @@ export interface ArgumentOverlay {
28
28
  kind: ArgumentKind;
29
29
  /** Overrides the syntax line's optionality, with `note` saying why. */
30
30
  optional?: boolean;
31
- /** The legal values of a `keyword`. */
31
+ /** The legal values of a `keyword`, or of a `number` limited to a set (a codec's byte width: 1, 2, 4 or 8). */
32
32
  values?: readonly string[];
33
33
  /** The inclusive range of a `number`. */
34
34
  range?: readonly [number, number];
@@ -1 +1 @@
1
- {"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/overlays/kinds.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,YAAY;AACtB,wCAAwC;AACtC,QAAQ;AACV,uCAAuC;GACrC,SAAS;AACX,+CAA+C;GAC7C,YAAY;AACd,qDAAqD;GACnD,YAAY;AACd,wBAAwB;GACtB,QAAQ;AACV,yBAAyB;GACvB,QAAQ;AACV,kDAAkD;GAChD,SAAS;AACX,2CAA2C;GACzC,MAAM;AACR,iGAAiG;GAC/F,UAAU;AACZ,+CAA+C;GAC7C,OAAO,CAAC;AAEZ,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,CAAC;IACnB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,uCAAuC;IACvC,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,yCAAyC;IACzC,KAAK,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
1
+ {"version":3,"file":"kinds.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/overlays/kinds.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,YAAY;AACtB,wCAAwC;AACtC,QAAQ;AACV,uCAAuC;GACrC,SAAS;AACX,+CAA+C;GAC7C,YAAY;AACd,qDAAqD;GACnD,YAAY;AACd,wBAAwB;GACtB,QAAQ;AACV,yBAAyB;GACvB,QAAQ;AACV,kDAAkD;GAChD,SAAS;AACX,2CAA2C;GACzC,MAAM;AACR,iGAAiG;GAC/F,UAAU;AACZ,+CAA+C;GAC7C,OAAO,CAAC;AAEZ,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,YAAY,CAAC;IACnB,uEAAuE;IACvE,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+GAA+G;IAC/G,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3B,yCAAyC;IACzC,KAAK,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,kEAAkE;IAClE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/overlays/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,GAAG,aAAa,GAAG,YAAY,CAAC;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAUD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CA0BpE,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,EAAuB,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/clickhouse/overlays/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,YAAY,GAAG,aAAa,GAAG,YAAY,CAAC;IAClD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAoBD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,aAAa,EAAE,CAiCpE,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,EAAuB,CAAC"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * A column type, read into its family and parameters: `Nullable(String)` is
3
+ * the family `Nullable` with the one parameter `String`;
4
+ * `DateTime64(3, 'UTC')` is `DateTime64` with `3` and `'UTC'`.
5
+ *
6
+ * The reading is lexical, over the same tokenizer the parser uses, so a
7
+ * string literal holding a parenthesis (`Enum8('a(' = 1)`) or a comma does not
8
+ * split a parameter. What a parameter means (a type, a number, a name) is the
9
+ * caller's question, answered from `TYPE_PARAMETERS`.
10
+ */
11
+ import { type Token } from "./tokens.js";
12
+ export interface TypeParam {
13
+ /** The parameter as written, trimmed. */
14
+ text: string;
15
+ tokens: Token[];
16
+ }
17
+ export interface TypeSyntax {
18
+ /** The words before the parameters: `UInt64`, `BIGINT UNSIGNED`, or `a String` for a named tuple element. */
19
+ words: Token[];
20
+ /** The parameters, or undefined when the type has no parentheses. */
21
+ params?: TypeParam[];
22
+ }
23
+ /** The significant tokens of a type, or undefined when it does not tokenize. */
24
+ export declare function typeTokens(text: string): Token[] | undefined;
25
+ /**
26
+ * Read a type into its leading words and its parameters. Undefined when the
27
+ * text is not a type this can read: no leading name, or unbalanced parentheses.
28
+ * Anything after the closing parenthesis (`COLLATE utf8`) is ignored.
29
+ */
30
+ export declare function readType(tokens: readonly Token[]): TypeSyntax | undefined;
31
+ /** A parameter that is a numeric literal, possibly negative: its value. */
32
+ export declare function numericParam(param: TypeParam): number | undefined;
33
+ //# sourceMappingURL=type-syntax.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"type-syntax.d.ts","sourceRoot":"","sources":["../../src/clickhouse/type-syntax.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAA0B,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AAE9D,MAAM,WAAW,SAAS;IACxB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,KAAK,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,UAAU;IACzB,6GAA6G;IAC7G,KAAK,EAAE,KAAK,EAAE,CAAC;IACf,qEAAqE;IACrE,MAAM,CAAC,EAAE,SAAS,EAAE,CAAC;CACtB;AAID,gFAAgF;AAChF,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,EAAE,GAAG,SAAS,CAM5D;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,UAAU,GAAG,SAAS,CA8BzE;AAED,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAMjE"}
@@ -1 +1 @@
1
- {"version":3,"file":"clickhouse-module.d.ts","sourceRoot":"","sources":["../../src/codegen/clickhouse-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAc,MAAM,iBAAiB,CAAC;AA6BrE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAmED,MAAM,WAAW,cAAc;IAC7B,0GAA0G;IAC1G,YAAY,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,cAAc,CAqJjF"}
1
+ {"version":3,"file":"clickhouse-module.d.ts","sourceRoot":"","sources":["../../src/codegen/clickhouse-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAc,MAAM,iBAAiB,CAAC;AA6BrE,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAmED,MAAM,WAAW,cAAc;IAC7B,0GAA0G;IAC1G,YAAY,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAC;IACf,qDAAqD;IACrD,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,iBAAiB,GAAG,cAAc,CAmKjF"}
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-module.d.ts","sourceRoot":"","sources":["../../src/codegen/postgres-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAMV,eAAe,EAGhB,MAAM,0BAA0B,CAAC;AA6GlC,MAAM,WAAW,sBAAsB;IACrC,4EAA4E;IAC5E,YAAY,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,GAAG,sBAAsB,CA8RjG"}
1
+ {"version":3,"file":"postgres-module.d.ts","sourceRoot":"","sources":["../../src/codegen/postgres-module.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAMV,eAAe,EAGhB,MAAM,0BAA0B,CAAC;AA6GlC,MAAM,WAAW,sBAAsB;IACrC,4EAA4E;IAC5E,YAAY,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,MAAM,EAAE,MAAM,CAAC;IACf,+BAA+B;IAC/B,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,GAAG,sBAAsB,CAyUjG"}
@@ -1,10 +1,16 @@
1
- import type { CodecSpec, DatabaseEngineSpec, SettingSpec, SkipIndexSpec, TableEngineSpec, TypeFamilySpec } from "../clickhouse/catalog-types.js";
1
+ import type { CodecSpec, DatabaseEngineSpec, FunctionSpec, SettingSpec, SkipIndexSpec, TableEngineSpec, TypeFamilySpec } from "../clickhouse/catalog-types.js";
2
2
  import type { CodecName, ColumnTypeName, DatabaseEngineName, MergeTreeSettings, QuerySettings, SkipIndexType, TableEngineName } from "./clickhouse-types.js";
3
3
  export * from "./clickhouse-types.js";
4
4
  export declare const TABLE_ENGINES: Readonly<Record<TableEngineName, TableEngineSpec>>;
5
5
  export declare const DATABASE_ENGINES: Readonly<Record<DatabaseEngineName, DatabaseEngineSpec>>;
6
6
  export declare const TYPE_FAMILIES: Readonly<Record<ColumnTypeName, TypeFamilySpec>>;
7
7
  export declare const CODECS: Readonly<Record<CodecName, CodecSpec>>;
8
+ /** Every function the server has (`system.functions`, origin System), aliases included. */
9
+ export declare const FUNCTIONS: Readonly<Record<string, FunctionSpec>>;
10
+ /** The aggregate function combinators (`system.aggregate_function_combinators`): the suffixes of `countIf`, `sumState`. */
11
+ export declare const AGGREGATE_COMBINATORS: readonly string[];
12
+ /** The table functions (`system.table_functions`): `numbers`, `remote`, `s3`. */
13
+ export declare const TABLE_FUNCTIONS: readonly string[];
8
14
  export declare const SKIP_INDEX_TYPES: Readonly<Record<SkipIndexType, SkipIndexSpec>>;
9
15
  export declare const MERGE_TREE_SETTINGS: Readonly<Record<keyof MergeTreeSettings, SettingSpec>>;
10
16
  export declare const QUERY_SETTINGS: Readonly<Record<keyof QuerySettings, SettingSpec>>;
@@ -1 +1 @@
1
- {"version":3,"file":"clickhouse.d.ts","sourceRoot":"","sources":["../../src/generated/clickhouse.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC9I,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CA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MAAM,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAkBrF,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,cAAc,CAAC,CA8I1E,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,SAAS,CAAC,CAkBzD,CAAC;AAEF,2FAA2F;AAC3F,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAk2D5D,CAAC;AAEF,2HAA2H;AAC3H,eAAO,MAAM,qBAAqB,EAAE,SAAS,MAAM,EAA6I,CAAC;AAEjM,iFAAiF;AACjF,eAAO,MAAM,eAAe,EAAE,SAAS,MAAM,EAAizC,CAAC;AAE/1C,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,aAAa,EAAE,aAAa,CAAC,CAU3E,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,iBAAiB,EAAE,WAAW,CAAC,CA4WtF,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,aAAa,EAAE,WAAW,CAAC,CAyxD7E,CAAC"}
@@ -6,4 +6,10 @@ export declare const STORAGE_PARAMETERS: Readonly<Record<string, StorageParamete
6
6
  export declare const COLUMN_TYPES: Readonly<Record<TypeSqlName, ColumnTypeSpec>>;
7
7
  /** Every key word at the latest pinned major, by its `pg_get_keywords()` category: U unreserved, C column name, T type or function name, R reserved. */
8
8
  export declare const KEYWORDS: Readonly<Record<string, "U" | "C" | "T" | "R">>;
9
+ /** Every function, aggregate and procedure name in `pg_proc`, to the majors that have it (`true`: all of them). */
10
+ export declare const FUNCTIONS: Readonly<Record<string, true | readonly number[]>>;
11
+ /** The index access methods, to the majors that have each (`true`: all of them). */
12
+ export declare const INDEX_ACCESS_METHODS: Readonly<Record<string, true | readonly number[]>>;
13
+ /** The operator classes of each index access method, to the majors that have each (`true`: all of them). */
14
+ export declare const OPERATOR_CLASSES: Readonly<Record<string, Readonly<Record<string, true | readonly number[]>>>>;
9
15
  //# sourceMappingURL=postgres.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../src/generated/postgres.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACnG,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE9D,cAAc,kBAAkB,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,QAAQ,EAAE,WAAW,CAAC,CAyZlE,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAmC7E,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,CAmFtE,CAAC;AAEF,wJAAwJ;AACxJ,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CA+epE,CAAC"}
1
+ {"version":3,"file":"postgres.d.ts","sourceRoot":"","sources":["../../src/generated/postgres.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACnG,OAAO,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE9D,cAAc,kBAAkB,CAAC;AAEjC,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,QAAQ,EAAE,WAAW,CAAC,CAyZlE,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,oBAAoB,CAAC,CAmC7E,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,CAmFtE,CAAC;AAEF,wJAAwJ;AACxJ,eAAO,MAAM,QAAQ,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC,CA+epE,CAAC;AAEF,mHAAmH;AACnH,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,SAAS,MAAM,EAAE,CAAC,CAi4ExE,CAAC;AAEF,oFAAoF;AACpF,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,SAAS,MAAM,EAAE,CAAC,CAOnF,CAAC;AAEF,4GAA4G;AAC5G,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,GAAG,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC,CA8LzG,CAAC"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "97a5ea5cc74e37ed7eedab6c720e70e924d0b4958e8264053f9e35c7dd9c9f1a",
4
+ "manifest.json": "599d41cd6d621016963b3fa98014254161ba8550574f18d539eef769538f7af1",
5
5
  "meta.json": "44b1dcfa5b5e5be2239fdc9614ab6c11d3f1461d64e61d572e3658af6c96aa68",
6
6
  "types/index.d.ts": "0286ebb367773e84c76818b0f69cb14cff8328fd2f8c65ed87563c8d5815458c",
7
7
  "rules/postgres-templates.ts": "da6e305bc2ff3d0d64a20925fe588e051c2a4b556b37f2581c61c314ef7c580d",
@@ -13,11 +13,14 @@
13
13
  "rules/sqlpg003.ts": "6f4903f9fdd3eb87bd4db3ad7e8fa0320db20f719ead7685a03cf7da677a7183",
14
14
  "rules/sqlpg004.ts": "68e4eaaa455f155d6dfe779eb01d7f134d856ab5db7cf45e2eb110ed7147b580",
15
15
  "rules/templates.ts": "f021609378d287d5e2dc763b022fa10ef74f402fa59d380a238c5ceed2995fd8",
16
- "rules/audit-entries.ts": "946a937d96726c01778f3e11bc3e3ff84fdb4fb0533bb0159222276a293301e9",
16
+ "rules/audit-entries.ts": "2339bc445687a4037652ffd300e3a230866b8abfd91f08a2ba831179cf646424",
17
17
  "rules/clickhouse-helpers.ts": "cdbbfd53ecf2cf912ecc60a9aeb2fd5d66db3665dc5b541a3a336904dc385b8a",
18
- "rules/postgres-audit-entries.ts": "5d868f35486cfbfa44ff12834bac47b3354c3b49bd356dbea12b9f17571e0b46",
18
+ "rules/clickhouse-type-check.ts": "75396cd5aef4ae09d6f7dea92924b0867e5c9182bbf918ade4d9b42823e54538",
19
+ "rules/postgres-audit-entries.ts": "30887efb76971b6db629807e583576e875d939c906eada0f260b90a5eec646b8",
19
20
  "rules/postgres-helpers.ts": "35c953054368f45be16466250f42053def1fabf1e551eab48742dc4ff4f823c7",
21
+ "rules/postgres-names.ts": "59cc3ac70198759e10e5715c2eb15d400b1ea49da45d11ffee5555f1383baa55",
20
22
  "rules/sql-helpers.ts": "8d2a2f9a392c67de6a959b6ff699669df1de7f004f7db8863a1bd032fb884138",
23
+ "rules/sql101.ts": "5d08a073a155d682fd59131ebbf14d72c85016d0682cbc87bfdd303440049a5a",
21
24
  "rules/sqlch101.ts": "6ffb9007e4f9b014946b7a98733b77b7da3501e8713bb27b34553823dbd58d89",
22
25
  "rules/sqlch102.ts": "5c6b1d3ef1dee8954fdf8e8451830f2f74dc9e701e039454fa1f069853e499d6",
23
26
  "rules/sqlch103.ts": "db5b8071e4ec18a504dfbaa23b5c046a11ca0f5fddbb54cb43f20b824a3274e0",
@@ -38,6 +41,13 @@
38
41
  "rules/sqlch118.ts": "5913b3e496bb5aec9baff8485e7d93a472baab9c599813cd6a4142fe9f9001f2",
39
42
  "rules/sqlch119.ts": "be7f7d74be1e98083a72ef01c8cf6ac926b5e19f9372d260f34993b5724658b6",
40
43
  "rules/sqlch120.ts": "a34f72f316b2ac021e2ed6ba8321dbf9678ad722bb15b7044cf6281eebe70d6c",
44
+ "rules/sqlch121.ts": "95bbcf65246b5492ca201e8932016dac41e9a7ccb809e57bf18821037a2c2fe5",
45
+ "rules/sqlch122.ts": "c9f3c613317d9b15e4a42cab2c28896ec14bf67f041bdffe7632d10355de0e73",
46
+ "rules/sqlch123.ts": "adb13902ad9a98b1f4ad09d50ea9f9eabef9fd7dada65389c7977b2dfbcc0173",
47
+ "rules/sqlch124.ts": "975534efd968a090bdab3847fcbc3521a5902c8ab1704ebdbca5faded832f5c3",
48
+ "rules/sqlch125.ts": "c235f9ea00542fa53c662457e2d70abf43e9ab13b2877d6e047904c8cb7f0e42",
49
+ "rules/sqlch126.ts": "58f45e5bd29f445d30b45876fed5a4a53a2de0cf63eaa5472202b36d0bcf7b2e",
50
+ "rules/sqlch127.ts": "6662ecaa0f0c45538e9461c27c00d4f20438dc0355ca485d41d8b5fb9451c6a9",
41
51
  "rules/sqlpg101.ts": "34bd3032af0a1054f2ee90b6e66dd2c159406196e86159545b1d18874fb3ce4b",
42
52
  "rules/sqlpg102.ts": "0a4f30a46fc1af3a251fd60ba8fee28f853605629cc93a2881c5bf8664dfd68e",
43
53
  "rules/sqlpg103.ts": "d172dbb711917a50dcb4e894d554730386cfdc056c10338733083dbf344f6f86",
@@ -55,7 +65,15 @@
55
65
  "rules/sqlpg115.ts": "ba3df2715edbd643436bec08d52311b8beae9ae318899ace4cdf2b62949ff202",
56
66
  "rules/sqlpg116.ts": "7a47846aa3ea1cfd3857b76476a5daeb6bfaefe86ea2cb33de1debbaf9b21afe",
57
67
  "rules/sqlpg117.ts": "3d5c2d57ccdee3cf91c3ba3cb6363750787a850df8ebd75e9cc3f33113303827",
58
- "rules/sqlpg118.ts": "e2a40a88a9374c4d99d02118ca4c60877ba0c6eb1ce603a93b24f5fd23d81dde"
68
+ "rules/sqlpg118.ts": "e2a40a88a9374c4d99d02118ca4c60877ba0c6eb1ce603a93b24f5fd23d81dde",
69
+ "rules/sqlpg119.ts": "2355b1b0d14a9603776e432e6a2b29a35c05a29b8ed057c2077bc970a20277f4",
70
+ "rules/sqlpg120.ts": "2f2035f3f46ef5a2de0606de20dd8c159fd67cd076e532cc634d37eef5c495f7",
71
+ "rules/sqlpg121.ts": "44dcd44efce37e81c69a5debfcf8d04a8511c3ac4aa26b61c22b8067790e6d52",
72
+ "rules/sqlpg122.ts": "cd9a13cd25ed366404a671ee0fdab97e130b17445bdf02fbb5832ab59056be10",
73
+ "rules/sqlpg123.ts": "2c2d3080823a455de2a56e563f3bc31af47686814e5eda90eaddc38defed50c8",
74
+ "rules/sqlpg124.ts": "57a499e6602399880e820a2adcd93b3775febc9034a9c5e5e59a7603ebe83a9b",
75
+ "rules/sqlpg125.ts": "cc7411c57c525613dc720ba00e986bbc4e5a84b8b0bcfa7a6ce0d058f039f025",
76
+ "rules/sqlpg126.ts": "d57b82a5842273876510131d67bf4418cbd61eff821e245edebc644dafd502bb"
59
77
  },
60
- "composite": "9c0319e9493291215b867bf6255596f67dd0081f8cf6479f0ad5c00c1cf3aa5b"
78
+ "composite": "f2bcf7e5c187974015d043254b07f35dbbb7c4c8eb882c6e0ef343e79c818c97"
61
79
  }
@@ -1 +1 @@
1
- {"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AASxF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAqDpD,CAAC"}
1
+ {"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AASxF,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CA6DpD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"audit-entries.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/audit-entries.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAoB7D,CAAC"}
1
+ {"version":3,"file":"audit-entries.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/audit-entries.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,wBAAwB,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CA2B7D,CAAC"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Checking a ClickHouse column type against the pinned catalog, for SQLCH121
3
+ * (the family), SQLCH122 (its parameters) and SQLCH123 (a wrapper the server
4
+ * refuses). One walk over the type answers all three; each check keeps the
5
+ * findings with its own id.
6
+ *
7
+ * Families come from `system.data_type_families` (`TYPE_FAMILIES`): a name is
8
+ * case-sensitive unless the catalog marks it case-insensitive, and an alias
9
+ * resolves to its family. Parameters come from the `TYPE_PARAMETERS` overlay.
10
+ * The walk goes into every parameter that is itself a type, so `UInt46`
11
+ * inside `Array(Map(String, UInt46))` is found.
12
+ */
13
+ import { checkOf } from "./clickhouse-helpers.js";
14
+ import { type OutputObject } from "./sql-helpers.js";
15
+ export interface TypeFinding {
16
+ checkId: "SQLCH121" | "SQLCH122" | "SQLCH123";
17
+ /** What is wrong, without the column: `UInt46 is not a type family ClickHouse 26.8.15.10 has`. */
18
+ detail: string;
19
+ }
20
+ type FamilySpec = {
21
+ canonical: string;
22
+ caseInsensitive: boolean;
23
+ };
24
+ /** A family by name as the server resolves it: exactly, or in any case when the catalog marks it case-insensitive. */
25
+ export declare function familyOf(name: string): FamilySpec | undefined;
26
+ /** Every finding for one column type, in the order the walk meets them. */
27
+ export declare function typeFindings(type: string, version: string): TypeFinding[];
28
+ /** Each declared column type in the build: tables, views that list their columns, and dictionary attributes. */
29
+ export declare function columnTypes(objects: readonly OutputObject[]): Generator<{
30
+ object: OutputObject;
31
+ column: string;
32
+ type: string;
33
+ }>;
34
+ /** The body of one of the three type checks: every column type's findings with that id. */
35
+ export declare function reportTypeFindings(id: TypeFinding["checkId"]): Parameters<typeof checkOf>[1];
36
+ export {};
37
+ //# sourceMappingURL=clickhouse-type-check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"clickhouse-type-check.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/clickhouse-type-check.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAMH,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAErE,MAAM,WAAW,WAAW;IAC1B,OAAO,EAAE,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;IAC9C,kGAAkG;IAClG,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,KAAK,UAAU,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,eAAe,EAAE,OAAO,CAAA;CAAE,CAAC;AASlE,sHAAsH;AACtH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAE7D;AA2BD,2EAA2E;AAC3E,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,WAAW,EAAE,CAMzE;AAiFD,gHAAgH;AAChH,wBAAiB,WAAW,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,GAAG,SAAS,CAAC;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAMhI;AAED,2FAA2F;AAC3F,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,WAAW,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,CAS5F"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAwCvE,eAAO,MAAM,eAAe,EAAE,cAAc,EAuC3C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAwDvE,eAAO,MAAM,eAAe,EAAE,cAAc,EAuD3C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"postgres-audit-entries.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/postgres-audit-entries.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CAmBlE,CAAC"}
1
+ {"version":3,"file":"postgres-audit-entries.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/postgres-audit-entries.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAE1E,eAAO,MAAM,6BAA6B,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CA2BlE,CAAC"}
@@ -0,0 +1,149 @@
1
+ /**
2
+ * Names in a Postgres declaration, read against the target major's catalog:
3
+ * column types, function calls, index access methods and operator classes.
4
+ * SQLPG119 to SQLPG126 share it.
5
+ *
6
+ * The line every check here keeps: a name the catalog or the project can
7
+ * answer for is checked; a name qualified with a schema the project does not
8
+ * declare (`billing.money`, `pg_catalog.int4`) is a plain-text reference and
9
+ * left to the server; a name the core catalog lacks is a warning, not an
10
+ * error, when the project declares an extension, since extension objects are
11
+ * not in the catalog (`overlays/extension-objects.ts` covers the common ones).
12
+ */
13
+ import type { PostSynthContext } from "@intentius/chant/lint/post-synth";
14
+ import { type PgTable } from "./postgres-helpers.js";
15
+ import { type OutputObject } from "./sql-helpers.js";
16
+ /** The catalog category of a built-in type (`N` numeric, `S` string...). */
17
+ export declare const categoryOf: (canonical: string) => string | undefined;
18
+ /** The parameters a built-in type takes, from the overlay. */
19
+ export declare const parametersOf: (canonical: string) => readonly import("../../postgres/catalog-types.js").ClauseArgument[];
20
+ /** An identifier's value: a quoted one as written, a bare one folded to lower case. */
21
+ export declare function identValue(text: string): string;
22
+ /** Split on commas at depth 0. */
23
+ export declare function splitTopLevel(text: string): string[];
24
+ /** The bare column names of an `INCLUDE` list as the output keeps it (`b, "X"`, or `(b, c)`). */
25
+ export declare function includeColumns(text: string | undefined): string[];
26
+ /** What the build declares, for resolving a name to it. */
27
+ export interface PgProject {
28
+ major: number;
29
+ objects: OutputObject[];
30
+ byExport: Map<string, OutputObject>;
31
+ schemas: Set<string>;
32
+ /** Declared extension names. */
33
+ extensions: Set<string>;
34
+ }
35
+ export declare function projectOf(ctx: PostSynthContext): PgProject;
36
+ /** A name the core catalog does not have: the finding's severity and a note, or nothing when an extension accounts for it. */
37
+ export interface Miss {
38
+ severity: "error" | "warning";
39
+ /** `, which comes from the pg_trgm extension the project does not declare` and the like. */
40
+ note: string;
41
+ }
42
+ export interface ParsedType {
43
+ schema?: string;
44
+ /** The name: words joined by one space, bare words lower case. */
45
+ name: string;
46
+ quoted: boolean;
47
+ /** The modifiers of the first `(...)`, as written. */
48
+ modifiers?: string[];
49
+ array: boolean;
50
+ /** `interval`'s fields, upper case (`DAY TO SECOND`). */
51
+ fields?: string;
52
+ }
53
+ /** A type as written in a column, domain or sequence: `numeric(12,2)`, `time(3) with time zone`, `app.mood[]`. Undefined when it is not a plain type name. */
54
+ export declare function parseType(text: string | undefined): ParsedType | undefined;
55
+ export type TypeResolution = {
56
+ kind: "builtin";
57
+ canonical: string;
58
+ serial?: boolean;
59
+ } | {
60
+ kind: "declared";
61
+ object: OutputObject;
62
+ }
63
+ /** Qualified with a schema the project does not declare, or provided by a declared extension: not checked. */
64
+ | {
65
+ kind: "outside";
66
+ } | {
67
+ kind: "missing";
68
+ miss: Miss;
69
+ }
70
+ /** A built-in type the target major does not have. */
71
+ | {
72
+ kind: "absent";
73
+ canonical: string;
74
+ };
75
+ /** Resolve a parsed type at the target major. `serial` admits `serial` and friends (a column). */
76
+ export declare function resolveType(p: PgProject, t: ParsedType, opts?: {
77
+ serial?: boolean;
78
+ }): TypeResolution;
79
+ /** A type as the user wrote it, for a message. */
80
+ export declare const typeLabel: (t: ParsedType) => string;
81
+ /**
82
+ * A comparable identity for a column's type, for a foreign key: a built-in
83
+ * type's catalog category (`U`, the catch-all, by name), a domain's base type,
84
+ * an enum or row type by name; `[]` for an array. Undefined when it cannot be
85
+ * told (a type outside the project).
86
+ */
87
+ export declare function typeIdentity(p: PgProject, text: string | undefined, depth?: number): string | undefined;
88
+ export interface Call {
89
+ schema?: string;
90
+ name: string;
91
+ }
92
+ /** The function calls in an expression: a name directly followed by `(`, outside string literals, not a key word construct. */
93
+ export declare function callsIn(expr: string | undefined): Call[];
94
+ export type CallResolution = {
95
+ ok: true;
96
+ } | {
97
+ ok: false;
98
+ miss: Miss;
99
+ since?: number;
100
+ until?: number;
101
+ };
102
+ /** Resolve a call at the target major. */
103
+ export declare function resolveCall(p: PgProject, c: Call): CallResolution;
104
+ /** The expressions of a table, domain or index that may call functions, each with where it sits. */
105
+ export declare function expressionsOf(o: OutputObject): Array<{
106
+ where: string;
107
+ expr: string;
108
+ }>;
109
+ export interface IndexElement {
110
+ /** The column or expression, without its collation, operator class or ordering. */
111
+ expr: string;
112
+ opclass?: {
113
+ schema?: string;
114
+ name: string;
115
+ };
116
+ }
117
+ /** An index element (`(lower(x)) text_pattern_ops DESC`, `x gin_trgm_ops`) split into its expression and operator class. */
118
+ export declare function parseIndexElement(text: string): IndexElement | undefined;
119
+ export type MethodResolution = {
120
+ ok: true;
121
+ } | {
122
+ ok: false;
123
+ miss: Miss;
124
+ since?: number;
125
+ until?: number;
126
+ };
127
+ /** An index access method at the target major. */
128
+ export declare function resolveMethod(p: PgProject, method: string): MethodResolution;
129
+ export type OpClassResolution = {
130
+ ok: true;
131
+ } | {
132
+ ok: false;
133
+ miss: Miss;
134
+ otherMethods?: string[];
135
+ };
136
+ /** An operator class for `method` at the target major. */
137
+ export declare function resolveOpClass(p: PgProject, method: string, opclass: {
138
+ schema?: string;
139
+ name: string;
140
+ }): OpClassResolution;
141
+ /** The table an interpolated reference names (`references`, `table`, a grant's object): the entity when it is one, else undefined. */
142
+ export declare function interpolatedTable(p: PgProject, ref: unknown, sqlName: string | undefined): PgTable | undefined;
143
+ /**
144
+ * Every column a table has, its own and those it inherits or copies from a
145
+ * declared parent; undefined when some come from somewhere the build cannot
146
+ * see (a plain-text parent, `LIKE`, `OF type`).
147
+ */
148
+ export declare function columnsOf(p: PgProject, t: PgTable, seen?: Set<string>): Map<string, PgTable["columns"][number]> | undefined;
149
+ //# sourceMappingURL=postgres-names.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"postgres-names.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/postgres-names.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AAMzE,OAAO,EAAe,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,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AM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,iBAAiB,CAc1H;AAID,sIAAsI;AACtI,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAM9G;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,cAAoB,GAAG,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,SAAS,CAgBjI"}
@@ -0,0 +1,9 @@
1
+ import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
2
+ /**
3
+ * SQL101: two exports declare the same object, the same kind under the same
4
+ * qualified name (`shop.events` twice). The build writes both `CREATE`
5
+ * statements, and the second fails on the server, or replaces the first
6
+ * under `OR REPLACE`.
7
+ */
8
+ export declare const sql101: PostSynthCheck;
9
+ //# sourceMappingURL=sql101.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sql101.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/sql101.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAuB,MAAM,kCAAkC,CAAC;AA0B5F;;;;;GAKG;AACH,eAAO,MAAM,MAAM,EAAE,cA6BpB,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * SQLCH121: a column type names a family the pinned server does not have
3
+ * (`UInt46`, `uint64`, `Nullabel(String)`), at any depth of the type.
4
+ *
5
+ * The family list is the pinned server's own (`system.data_type_families`),
6
+ * aliases included; a name is case-sensitive unless the catalog marks it
7
+ * case-insensitive.
8
+ */
9
+ export declare const sqlch121: import("@intentius/chant").PostSynthCheck;
10
+ //# sourceMappingURL=sqlch121.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlch121.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/sqlch121.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,2CAA2I,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * SQLCH122: a column type's parameters do not fit the family: parameters on a
3
+ * family that takes none, a required one missing (`FixedString`), too many,
4
+ * or a number outside its range (`Decimal(100, 2)`).
5
+ *
6
+ * The parameter grammar is the `TYPE_PARAMETERS` overlay; no system table
7
+ * holds it.
8
+ */
9
+ export declare const sqlch122: import("@intentius/chant").PostSynthCheck;
10
+ //# sourceMappingURL=sqlch122.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlch122.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/sqlch122.ts"],"names":[],"mappings":"AAGA;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,2CAA+H,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * SQLCH123: `Nullable` around a type ClickHouse keeps out of it: `Array`,
3
+ * `Map`, `Nested`, `LowCardinality`, `Variant` or another `Nullable`. The
4
+ * server refuses the column ("Nested type ... cannot be inside Nullable
5
+ * type"). `Nullable(Tuple(...))` is left alone: the server takes it when the
6
+ * profile enables `enable_nullable_tuple_type`.
7
+ */
8
+ export declare const sqlch123: import("@intentius/chant").PostSynthCheck;
9
+ //# sourceMappingURL=sqlch123.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlch123.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/sqlch123.ts"],"names":[],"mappings":"AAGA;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,2CAAgJ,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * SQLCH124: a table, view or dictionary declares a column twice. The server
3
+ * refuses the `CREATE` ("Column ... already exists").
4
+ */
5
+ export declare const sqlch124: import("@intentius/chant").PostSynthCheck;
6
+ //# sourceMappingURL=sqlch124.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlch124.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/sqlch124.ts"],"names":[],"mappings":"AAGA;;;GAGG;AACH,eAAO,MAAM,QAAQ,2CAanB,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * SQLCH125: a codec's parameters do not fit it: more than the codec takes
3
+ * (`LZ4(1)`), a number outside its range (`ZSTD(99)`, `LZ4HC(13)`), or a
4
+ * value outside its set (`Delta(3)`; the byte width is 1, 2, 4 or 8).
5
+ *
6
+ * The parameters are the `CODEC_OVERLAY`'s; a codec marked `"unknown"` there
7
+ * (the experimental ones with undocumented parameters) is not checked. An
8
+ * unknown codec name is SQLCH114's.
9
+ */
10
+ export declare const sqlch125: import("@intentius/chant").PostSynthCheck;
11
+ //# sourceMappingURL=sqlch125.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlch125.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/sqlch125.ts"],"names":[],"mappings":"AAQA;;;;;;;;GAQG;AACH,eAAO,MAAM,QAAQ,2CAsCnB,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * SQLCH126: a `GRANT` column list names a column the `${}` table does not
3
+ * declare: `GRANT SELECT(kindd) ON ${events}`. The server refuses the grant
4
+ * ("There is no column ...").
5
+ *
6
+ * Only a target the grant interpolates is checked, against the columns it
7
+ * declares; a target written as a plain name, or a view that infers its
8
+ * columns from its SELECT, is left to the server. ClickHouse has no declared
9
+ * `REVOKE`, so a grant is the only column list.
10
+ */
11
+ export declare const sqlch126: import("@intentius/chant").PostSynthCheck;
12
+ //# sourceMappingURL=sqlch126.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlch126.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/sqlch126.ts"],"names":[],"mappings":"AAqBA;;;;;;;;;GASG;AACH,eAAO,MAAM,QAAQ,2CAyBnB,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * A catalog function, or an aggregate function with combinator suffixes
3
+ * (`countIf`, `sumState`, `uniqMerge`). A table function (`numbers`) counts
4
+ * too: it is a name the server has, and where it does not belong is the
5
+ * server's to say.
6
+ */
7
+ export declare function isKnownFunction(name: string): boolean;
8
+ /** The names an expression calls: an identifier directly followed by `(`, outside strings and quoted names. */
9
+ export declare function calledNames(expr: string): string[];
10
+ /**
11
+ * SQLCH127: an expression the table declares calls a function the pinned
12
+ * server does not have: `DEFAULT noww()`, `PARTITION BY toYYYYMMM(at)`.
13
+ *
14
+ * Read in each column's `DEFAULT`, `MATERIALIZED`, `ALIAS`, `EPHEMERAL` and
15
+ * TTL expression, in `ORDER BY`, `PRIMARY KEY`, `PARTITION BY`, `SAMPLE BY`
16
+ * and the table TTL, and in each skip index expression. A name counts when it
17
+ * is in `system.functions` (case as the catalog says, aliases included), is an
18
+ * aggregate function with combinator suffixes, or is a function the project
19
+ * declares with `func`.
20
+ */
21
+ export declare const sqlch127: import("@intentius/chant").PostSynthCheck;
22
+ //# sourceMappingURL=sqlch127.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlch127.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/sqlch127.ts"],"names":[],"mappings":"AAgCA;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAoBrD;AAED,+GAA+G;AAC/G,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CA4BlD;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,2CAyBnB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * SQLPG119: a column, array element, domain base or sequence `AS` type the
3
+ * target major does not have.
4
+ *
5
+ * Doc: https://www.postgresql.org/docs/18/datatype.html. The server refuses
6
+ * `type "numerik" does not exist` at CREATE. A built-in type counts in every
7
+ * spelling Postgres accepts: the catalog's `pg_type` name and `format_type()`
8
+ * name (`int4`, `integer`), and the grammar's own spellings (`int`, `decimal`,
9
+ * `double precision`, `time with time zone`), an overlay beside the catalog.
10
+ * So does a type the project declares (`type`, `domain`, a table's row type),
11
+ * by `${}` or by name. A type qualified with a schema the project does not
12
+ * declare is a plain-text reference and left to the server. An unknown name is
13
+ * a warning when the project declares an extension, since extension types are
14
+ * not in the core catalog; the overlay of common extension types answers for
15
+ * the ones it knows.
16
+ */
17
+ export declare const sqlpg119: import("@intentius/chant").PostSynthCheck;
18
+ //# sourceMappingURL=sqlpg119.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlpg119.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/sqlpg119.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,QAAQ,2CAiBnB,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * SQLPG120: a type modifier that does not fit the type.
3
+ *
4
+ * Doc: https://www.postgresql.org/docs/18/datatype-numeric.html,
5
+ * https://www.postgresql.org/docs/18/datatype-character.html,
6
+ * https://www.postgresql.org/docs/18/datatype-datetime.html,
7
+ * https://www.postgresql.org/docs/18/datatype-bit.html. The server refuses a
8
+ * modifier on a type that takes none (`bigint(8)`), `numeric` precision
9
+ * outside 1 to 1000 or scale outside -1000 to 1000 (0 to the precision before
10
+ * 15), `varchar(n)` or `char(n)` outside 1 to 10485760, `timestamp`, `time`
11
+ * or `interval` precision outside 0 to 6, `bit(n)` below 1, and `float(p)`
12
+ * outside 1 to 53. The parameters and ranges are the lexicon's type overlay.
13
+ * Only built-in types are checked: a declared or extension type's modifiers
14
+ * are its own (`geometry(Point, 4326)`).
15
+ */
16
+ export declare const sqlpg120: import("@intentius/chant").PostSynthCheck;
17
+ //# sourceMappingURL=sqlpg120.d.ts.map