@intentius/chant-lexicon-sql 0.124.46 → 0.124.49

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 (402) hide show
  1. package/dist/change-set.d.ts +1 -1
  2. package/dist/change-set.d.ts.map +1 -1
  3. package/dist/change-set.js +2 -1
  4. package/dist/clickhouse/apply/statements.d.ts +9 -0
  5. package/dist/clickhouse/apply/statements.d.ts.map +1 -1
  6. package/dist/clickhouse/apply/statements.js +24 -0
  7. package/dist/clickhouse/import/live-export.d.ts +7 -3
  8. package/dist/clickhouse/import/live-export.d.ts.map +1 -1
  9. package/dist/clickhouse/import/live-export.js +21 -5
  10. package/dist/clickhouse/live/named-collections.d.ts +27 -0
  11. package/dist/clickhouse/live/named-collections.d.ts.map +1 -0
  12. package/dist/clickhouse/live/named-collections.js +53 -0
  13. package/dist/clickhouse/live/undeclarable.d.ts +15 -3
  14. package/dist/clickhouse/live/undeclarable.d.ts.map +1 -1
  15. package/dist/clickhouse/live/undeclarable.js +18 -4
  16. package/dist/clickhouse/named-collections.d.ts +83 -0
  17. package/dist/clickhouse/named-collections.d.ts.map +1 -0
  18. package/dist/clickhouse/named-collections.js +203 -0
  19. package/dist/clickhouse/parser.d.ts.map +1 -1
  20. package/dist/clickhouse/parser.js +1 -1
  21. package/dist/clickhouse/plan/commands.d.ts +2 -1
  22. package/dist/clickhouse/plan/commands.d.ts.map +1 -1
  23. package/dist/clickhouse/plan/commands.js +17 -2
  24. package/dist/clickhouse/plan/diff.d.ts +15 -0
  25. package/dist/clickhouse/plan/diff.d.ts.map +1 -1
  26. package/dist/clickhouse/plan/diff.js +43 -1
  27. package/dist/clickhouse/plan/disruption.d.ts.map +1 -1
  28. package/dist/clickhouse/plan/disruption.js +5 -0
  29. package/dist/clickhouse/plan/rebuild-handoff.d.ts.map +1 -1
  30. package/dist/clickhouse/plan/rebuild-handoff.js +4 -0
  31. package/dist/clickhouse/plan/report.d.ts.map +1 -1
  32. package/dist/clickhouse/plan/report.js +6 -1
  33. package/dist/clickhouse/plan/rules.d.ts +5 -1
  34. package/dist/clickhouse/plan/rules.d.ts.map +1 -1
  35. package/dist/clickhouse/plan/rules.js +7 -3
  36. package/dist/clickhouse/plan/statements.d.ts +29 -0
  37. package/dist/clickhouse/plan/statements.d.ts.map +1 -0
  38. package/dist/clickhouse/plan/statements.js +334 -0
  39. package/dist/clickhouse/plan/stream.d.ts +40 -0
  40. package/dist/clickhouse/plan/stream.d.ts.map +1 -0
  41. package/dist/clickhouse/plan/stream.js +107 -0
  42. package/dist/clickhouse/rebuild/observe.d.ts +3 -1
  43. package/dist/clickhouse/rebuild/observe.d.ts.map +1 -1
  44. package/dist/clickhouse/rebuild/observe.js +14 -1
  45. package/dist/clickhouse/review-catalog.d.ts +213 -0
  46. package/dist/clickhouse/review-catalog.d.ts.map +1 -0
  47. package/dist/clickhouse/review-catalog.js +330 -0
  48. package/dist/codegen/classifier-page.d.ts.map +1 -1
  49. package/dist/codegen/classifier-page.js +44 -4
  50. package/dist/codegen/clickhouse-module.d.ts.map +1 -1
  51. package/dist/codegen/clickhouse-module.js +3 -0
  52. package/dist/codegen/coverage-page.d.ts.map +1 -1
  53. package/dist/codegen/coverage-page.js +5 -3
  54. package/dist/codegen/docs.js +1 -1
  55. package/dist/codegen/postgres-classifier-page.js +2 -2
  56. package/dist/codegen/registry.d.ts.map +1 -1
  57. package/dist/codegen/registry.js +10 -0
  58. package/dist/composites/catalog.d.ts.map +1 -1
  59. package/dist/composites/catalog.js +100 -0
  60. package/dist/composites/clickhouse.d.ts +2 -0
  61. package/dist/composites/clickhouse.d.ts.map +1 -1
  62. package/dist/composites/clickhouse.js +2 -0
  63. package/dist/composites/otel-tables.d.ts +100 -0
  64. package/dist/composites/otel-tables.d.ts.map +1 -0
  65. package/dist/composites/otel-tables.js +282 -0
  66. package/dist/composites/stream-ingest.d.ts +63 -0
  67. package/dist/composites/stream-ingest.d.ts.map +1 -0
  68. package/dist/composites/stream-ingest.js +39 -0
  69. package/dist/core/statement-class.d.ts +55 -0
  70. package/dist/core/statement-class.d.ts.map +1 -0
  71. package/dist/core/statement-class.js +43 -0
  72. package/dist/coverage/clickhouse.json +1 -1
  73. package/dist/coverage/postgres.json +12 -12
  74. package/dist/coverage.d.ts +16 -6
  75. package/dist/coverage.d.ts.map +1 -1
  76. package/dist/coverage.js +10 -5
  77. package/dist/drizzle-command.d.ts +17 -0
  78. package/dist/drizzle-command.d.ts.map +1 -0
  79. package/dist/drizzle-command.js +91 -0
  80. package/dist/drizzle.d.ts +70 -0
  81. package/dist/drizzle.d.ts.map +1 -0
  82. package/dist/drizzle.js +689 -0
  83. package/dist/files/clickhouse.d.ts.map +1 -1
  84. package/dist/files/clickhouse.js +8 -1
  85. package/dist/files/common.d.ts +13 -0
  86. package/dist/files/common.d.ts.map +1 -1
  87. package/dist/files/common.js +5 -0
  88. package/dist/files/postgres.d.ts.map +1 -1
  89. package/dist/files/postgres.js +35 -3
  90. package/dist/generated/clickhouse.d.ts +2 -0
  91. package/dist/generated/clickhouse.d.ts.map +1 -1
  92. package/dist/generated/clickhouse.js +2 -0
  93. package/dist/import-parser.d.ts +21 -1
  94. package/dist/import-parser.d.ts.map +1 -1
  95. package/dist/import-parser.js +79 -5
  96. package/dist/index.d.ts +1 -1
  97. package/dist/index.d.ts.map +1 -1
  98. package/dist/index.js +1 -1
  99. package/dist/integrity.json +7 -6
  100. package/dist/lint/post-synth/audit-entries.d.ts.map +1 -1
  101. package/dist/lint/post-synth/audit-entries.js +1 -0
  102. package/dist/lint/post-synth/index.d.ts.map +1 -1
  103. package/dist/lint/post-synth/index.js +2 -0
  104. package/dist/lint/post-synth/postgres-names.d.ts.map +1 -1
  105. package/dist/lint/post-synth/postgres-names.js +3 -0
  106. package/dist/lint/post-synth/sqlch128.d.ts +18 -0
  107. package/dist/lint/post-synth/sqlch128.d.ts.map +1 -0
  108. package/dist/lint/post-synth/sqlch128.js +222 -0
  109. package/dist/lint/rules/postgres-templates.js +2 -2
  110. package/dist/lsp/postgres-template.d.ts.map +1 -1
  111. package/dist/lsp/postgres-template.js +21 -0
  112. package/dist/manifest.json +1 -1
  113. package/dist/mcp/postgres.js +1 -1
  114. package/dist/meta.json +50 -0
  115. package/dist/migrate/from-postgres/detect.d.ts +4 -0
  116. package/dist/migrate/from-postgres/detect.d.ts.map +1 -0
  117. package/dist/migrate/from-postgres/detect.js +7 -0
  118. package/dist/migrate/from-postgres/emit.d.ts +26 -0
  119. package/dist/migrate/from-postgres/emit.d.ts.map +1 -0
  120. package/dist/migrate/from-postgres/emit.js +86 -0
  121. package/dist/migrate/from-postgres/index.d.ts +51 -0
  122. package/dist/migrate/from-postgres/index.d.ts.map +1 -0
  123. package/dist/migrate/from-postgres/index.js +115 -0
  124. package/dist/migrate/from-postgres/translate.d.ts +73 -0
  125. package/dist/migrate/from-postgres/translate.d.ts.map +1 -0
  126. package/dist/migrate/from-postgres/translate.js +261 -0
  127. package/dist/migrate/from-postgres/types.d.ts +51 -0
  128. package/dist/migrate/from-postgres/types.d.ts.map +1 -0
  129. package/dist/migrate/from-postgres/types.js +211 -0
  130. package/dist/migration-classify.d.ts +23 -0
  131. package/dist/migration-classify.d.ts.map +1 -0
  132. package/dist/migration-classify.js +44 -0
  133. package/dist/migration-replay.d.ts +73 -0
  134. package/dist/migration-replay.d.ts.map +1 -0
  135. package/dist/migration-replay.js +294 -0
  136. package/dist/okf/index.md +11 -0
  137. package/dist/okf/rules/SQLCH128.md +11 -0
  138. package/dist/okf/types/PostgresForeignDataWrapper.md +9 -0
  139. package/dist/okf/types/PostgresForeignServer.md +9 -0
  140. package/dist/okf/types/PostgresForeignTable.md +9 -0
  141. package/dist/okf/types/PostgresOperator.md +9 -0
  142. package/dist/okf/types/PostgresOperatorClass.md +9 -0
  143. package/dist/okf/types/PostgresOperatorFamily.md +9 -0
  144. package/dist/okf/types/PostgresPublication.md +9 -0
  145. package/dist/okf/types/PostgresStatistics.md +9 -0
  146. package/dist/okf/types/PostgresTextSearchConfiguration.md +9 -0
  147. package/dist/okf/types/PostgresTextSearchDictionary.md +9 -0
  148. package/dist/op/activities/postgres-migration.d.ts.map +1 -1
  149. package/dist/op/activities/postgres-migration.js +4 -0
  150. package/dist/op/activity-contracts.d.ts +20 -0
  151. package/dist/op/activity-contracts.d.ts.map +1 -1
  152. package/dist/op/activity-contracts.js +2 -0
  153. package/dist/plugin.d.ts.map +1 -1
  154. package/dist/plugin.js +49 -2
  155. package/dist/postgres/access/acl.js +1 -1
  156. package/dist/postgres/access/import.js +1 -1
  157. package/dist/postgres/apply/apply.js +13 -1
  158. package/dist/postgres/apply/statements.d.ts.map +1 -1
  159. package/dist/postgres/apply/statements.js +243 -4
  160. package/dist/postgres/constraint-names.d.ts +30 -0
  161. package/dist/postgres/constraint-names.d.ts.map +1 -0
  162. package/dist/postgres/constraint-names.js +72 -0
  163. package/dist/postgres/entities.d.ts +229 -2
  164. package/dist/postgres/entities.d.ts.map +1 -1
  165. package/dist/postgres/entities.js +326 -5
  166. package/dist/postgres/entity-types.d.ts +10 -0
  167. package/dist/postgres/entity-types.d.ts.map +1 -1
  168. package/dist/postgres/entity-types.js +10 -0
  169. package/dist/postgres/import/generator.d.ts.map +1 -1
  170. package/dist/postgres/import/generator.js +65 -2
  171. package/dist/postgres/import/live-export.d.ts.map +1 -1
  172. package/dist/postgres/import/live-export.js +2 -0
  173. package/dist/postgres/live/catalog-kinds.d.ts +20 -0
  174. package/dist/postgres/live/catalog-kinds.d.ts.map +1 -1
  175. package/dist/postgres/live/catalog-kinds.js +452 -0
  176. package/dist/postgres/live/catalog.d.ts +2 -0
  177. package/dist/postgres/live/catalog.d.ts.map +1 -1
  178. package/dist/postgres/live/catalog.js +3 -1
  179. package/dist/postgres/live/describe-resources.d.ts.map +1 -1
  180. package/dist/postgres/live/describe-resources.js +12 -2
  181. package/dist/postgres/migrate/backfill.d.ts +2 -0
  182. package/dist/postgres/migrate/backfill.d.ts.map +1 -1
  183. package/dist/postgres/migrate/backfill.js +7 -1
  184. package/dist/postgres/migrate/carry.d.ts +45 -1
  185. package/dist/postgres/migrate/carry.d.ts.map +1 -1
  186. package/dist/postgres/migrate/carry.js +72 -8
  187. package/dist/postgres/migrate/observe.d.ts +28 -4
  188. package/dist/postgres/migrate/observe.d.ts.map +1 -1
  189. package/dist/postgres/migrate/observe.js +45 -13
  190. package/dist/postgres/migrate/op.d.ts +26 -1
  191. package/dist/postgres/migrate/op.d.ts.map +1 -1
  192. package/dist/postgres/migrate/op.js +3 -1
  193. package/dist/postgres/migrate/replication.d.ts +42 -0
  194. package/dist/postgres/migrate/replication.d.ts.map +1 -1
  195. package/dist/postgres/migrate/replication.js +53 -0
  196. package/dist/postgres/migrate/steps.d.ts +35 -2
  197. package/dist/postgres/migrate/steps.d.ts.map +1 -1
  198. package/dist/postgres/migrate/steps.js +158 -12
  199. package/dist/postgres/parser.d.ts +144 -1
  200. package/dist/postgres/parser.d.ts.map +1 -1
  201. package/dist/postgres/parser.js +370 -4
  202. package/dist/postgres/plan/deep.d.ts.map +1 -1
  203. package/dist/postgres/plan/deep.js +43 -4
  204. package/dist/postgres/plan/diff.d.ts.map +1 -1
  205. package/dist/postgres/plan/diff.js +154 -1
  206. package/dist/postgres/plan/normalize.d.ts +28 -2
  207. package/dist/postgres/plan/normalize.d.ts.map +1 -1
  208. package/dist/postgres/plan/normalize.js +260 -1
  209. package/dist/postgres/plan/rules.d.ts +4 -0
  210. package/dist/postgres/plan/rules.d.ts.map +1 -1
  211. package/dist/postgres/plan/rules.js +6 -2
  212. package/dist/postgres/plan/schema.js +1 -1
  213. package/dist/postgres/plan/statements.d.ts +26 -0
  214. package/dist/postgres/plan/statements.d.ts.map +1 -0
  215. package/dist/postgres/plan/statements.js +364 -0
  216. package/dist/postgres/secret-options.d.ts +10 -0
  217. package/dist/postgres/secret-options.d.ts.map +1 -0
  218. package/dist/postgres/secret-options.js +9 -0
  219. package/dist/postgres/testing/roundtrip-schema.d.ts +4 -2
  220. package/dist/postgres/testing/roundtrip-schema.d.ts.map +1 -1
  221. package/dist/postgres/testing/roundtrip-schema.js +24 -1
  222. package/dist/postgres.d.ts +1 -1
  223. package/dist/postgres.d.ts.map +1 -1
  224. package/dist/postgres.js +1 -1
  225. package/dist/rules/audit-entries.ts +1 -0
  226. package/dist/rules/postgres-names.ts +2 -0
  227. package/dist/rules/postgres-templates.ts +2 -2
  228. package/dist/rules/sqlch128.ts +230 -0
  229. package/dist/serializer.d.ts +5 -0
  230. package/dist/serializer.d.ts.map +1 -1
  231. package/dist/serializer.js +13 -2
  232. package/dist/sql-types-command.d.ts +13 -0
  233. package/dist/sql-types-command.d.ts.map +1 -1
  234. package/dist/sql-types-command.js +31 -16
  235. package/dist/sql-types.d.ts +22 -0
  236. package/dist/sql-types.d.ts.map +1 -1
  237. package/dist/sql-types.js +10 -6
  238. package/dist/sqlserver/lexer.d.ts +37 -0
  239. package/dist/sqlserver/lexer.d.ts.map +1 -0
  240. package/dist/sqlserver/lexer.js +254 -0
  241. package/dist/sqlserver/parse.d.ts +185 -0
  242. package/dist/sqlserver/parse.d.ts.map +1 -0
  243. package/dist/sqlserver/parse.js +767 -0
  244. package/dist/sqlserver/translate.d.ts +34 -0
  245. package/dist/sqlserver/translate.d.ts.map +1 -0
  246. package/dist/sqlserver/translate.js +495 -0
  247. package/dist/sqlserver/types.d.ts +44 -0
  248. package/dist/sqlserver/types.d.ts.map +1 -0
  249. package/dist/sqlserver/types.js +133 -0
  250. package/dist/sqlserver/validate.d.ts +31 -0
  251. package/dist/sqlserver/validate.d.ts.map +1 -0
  252. package/dist/sqlserver/validate.js +67 -0
  253. package/dist/validate.d.ts.map +1 -1
  254. package/dist/validate.js +10 -0
  255. package/package.json +2 -2
  256. package/src/change-set.ts +2 -1
  257. package/src/clickhouse/apply/statements.ts +25 -0
  258. package/src/clickhouse/import/live-export.ts +20 -5
  259. package/src/clickhouse/live/named-collections.e2e.test.ts +88 -0
  260. package/src/clickhouse/live/named-collections.ts +61 -0
  261. package/src/clickhouse/live/undeclarable.e2e.test.ts +5 -3
  262. package/src/clickhouse/live/undeclarable.ts +20 -4
  263. package/src/clickhouse/named-collections.test.ts +187 -0
  264. package/src/clickhouse/named-collections.ts +224 -0
  265. package/src/clickhouse/parser.ts +2 -1
  266. package/src/clickhouse/plan/commands.ts +17 -2
  267. package/src/clickhouse/plan/diff.ts +57 -1
  268. package/src/clickhouse/plan/disruption.ts +5 -0
  269. package/src/clickhouse/plan/rebuild-handoff.ts +3 -0
  270. package/src/clickhouse/plan/report.ts +6 -1
  271. package/src/clickhouse/plan/rules.ts +14 -4
  272. package/src/clickhouse/plan/statements.test.ts +61 -0
  273. package/src/clickhouse/plan/statements.ts +306 -0
  274. package/src/clickhouse/plan/stream-s3queue.e2e.test.ts +148 -0
  275. package/src/clickhouse/plan/stream.test.ts +237 -0
  276. package/src/clickhouse/plan/stream.ts +111 -0
  277. package/src/clickhouse/rebuild/observe.ts +15 -1
  278. package/src/clickhouse/review-catalog.test.ts +181 -0
  279. package/src/clickhouse/review-catalog.ts +489 -0
  280. package/src/codegen/classifier-page.ts +44 -4
  281. package/src/codegen/clickhouse-module.ts +3 -0
  282. package/src/codegen/coverage-page.ts +5 -3
  283. package/src/codegen/docs.ts +1 -1
  284. package/src/codegen/postgres-classifier-page.ts +2 -2
  285. package/src/codegen/registry.ts +10 -0
  286. package/src/composites/catalog.test.ts +6 -1
  287. package/src/composites/catalog.ts +100 -0
  288. package/src/composites/clickhouse.ts +2 -0
  289. package/src/composites/composites.test.ts +1 -1
  290. package/src/composites/otel-tables.test.ts +118 -0
  291. package/src/composites/otel-tables.ts +339 -0
  292. package/src/composites/stream-ingest.test.ts +114 -0
  293. package/src/composites/stream-ingest.ts +82 -0
  294. package/src/core/statement-class.ts +88 -0
  295. package/src/core/undeclarable.test.ts +6 -5
  296. package/src/coverage/clickhouse.json +1 -1
  297. package/src/coverage/postgres.json +12 -12
  298. package/src/coverage.test.ts +27 -2
  299. package/src/coverage.ts +18 -7
  300. package/src/drizzle-command.ts +94 -0
  301. package/src/drizzle-kit.e2e.test.ts +89 -0
  302. package/src/drizzle-types.e2e.test.ts +67 -0
  303. package/src/drizzle.test.ts +358 -0
  304. package/src/drizzle.ts +742 -0
  305. package/src/files/clickhouse.ts +8 -1
  306. package/src/files/common.ts +14 -1
  307. package/src/files/postgres.ts +34 -3
  308. package/src/generated/clickhouse.ts +3 -0
  309. package/src/generated/lexicon-sql.json +50 -0
  310. package/src/import-parser.sqlserver.test.ts +92 -0
  311. package/src/import-parser.ts +79 -5
  312. package/src/index.ts +1 -1
  313. package/src/lint/post-synth/audit-entries.ts +1 -0
  314. package/src/lint/post-synth/index.ts +2 -0
  315. package/src/lint/post-synth/postgres-checks.test.ts +8 -1
  316. package/src/lint/post-synth/postgres-names.ts +2 -0
  317. package/src/lint/post-synth/sqlch128.test.ts +107 -0
  318. package/src/lint/post-synth/sqlch128.ts +230 -0
  319. package/src/lint/rules/postgres-templates.ts +2 -2
  320. package/src/lsp/postgres-template.ts +20 -0
  321. package/src/mcp/postgres.ts +1 -1
  322. package/src/migrate/from-postgres/cli.test.ts +165 -0
  323. package/src/migrate/from-postgres/detect.ts +7 -0
  324. package/src/migrate/from-postgres/emit.ts +96 -0
  325. package/src/migrate/from-postgres/example.test.ts +205 -0
  326. package/src/migrate/from-postgres/index.ts +122 -0
  327. package/src/migrate/from-postgres/translate.test.ts +242 -0
  328. package/src/migrate/from-postgres/translate.ts +359 -0
  329. package/src/migrate/from-postgres/types.test.ts +116 -0
  330. package/src/migrate/from-postgres/types.ts +236 -0
  331. package/src/migrate/from-postgres/validate.e2e.test.ts +44 -0
  332. package/src/migrate/from-postgres/workspace.e2e.test.ts +114 -0
  333. package/src/migration-classify.test.ts +150 -0
  334. package/src/migration-classify.ts +45 -0
  335. package/src/migration-replay.e2e.test.ts +155 -0
  336. package/src/migration-replay.test.ts +173 -0
  337. package/src/migration-replay.ts +289 -0
  338. package/src/op/__snapshots__/watch-pipeline.test.ts.snap +2 -2
  339. package/src/op/activities/postgres-migration.ts +4 -0
  340. package/src/op/activity-contracts.ts +2 -0
  341. package/src/op/watch-pipeline.test.ts +8 -1
  342. package/src/plugin.ts +51 -2
  343. package/src/postgres/access/acl.ts +1 -1
  344. package/src/postgres/access/import.ts +1 -1
  345. package/src/postgres/apply/apply.ts +14 -1
  346. package/src/postgres/apply/statements.ts +225 -4
  347. package/src/postgres/constraint-names.ts +71 -0
  348. package/src/postgres/database-kinds.test.ts +865 -0
  349. package/src/postgres/entities.ts +541 -5
  350. package/src/postgres/entity-types.ts +10 -0
  351. package/src/postgres/import/generator.ts +54 -2
  352. package/src/postgres/import/live-export.ts +1 -0
  353. package/src/postgres/live/catalog-kinds.ts +494 -0
  354. package/src/postgres/live/catalog.ts +6 -1
  355. package/src/postgres/live/database-kinds.e2e.test.ts +164 -0
  356. package/src/postgres/live/describe-resources.ts +13 -2
  357. package/src/postgres/live/undeclarable.e2e.test.ts +13 -6
  358. package/src/postgres/migrate/backfill.ts +13 -1
  359. package/src/postgres/migrate/carry.ts +103 -8
  360. package/src/postgres/migrate/followups.e2e.test.ts +218 -0
  361. package/src/postgres/migrate/followups.test.ts +199 -0
  362. package/src/postgres/migrate/kinds.e2e.test.ts +5 -5
  363. package/src/postgres/migrate/observe.ts +56 -15
  364. package/src/postgres/migrate/op.ts +28 -1
  365. package/src/postgres/migrate/partition.e2e.test.ts +129 -0
  366. package/src/postgres/migrate/partition.test.ts +206 -0
  367. package/src/postgres/migrate/replication.ts +66 -0
  368. package/src/postgres/migrate/steps.ts +157 -12
  369. package/src/postgres/migrate/subscriber.e2e.test.ts +141 -0
  370. package/src/postgres/migrate/subscriber.test.ts +59 -0
  371. package/src/postgres/parser.ts +455 -4
  372. package/src/postgres/plan/deep.ts +42 -4
  373. package/src/postgres/plan/diff.ts +137 -1
  374. package/src/postgres/plan/normalize.ts +277 -1
  375. package/src/postgres/plan/rules.ts +32 -4
  376. package/src/postgres/plan/schema.ts +1 -1
  377. package/src/postgres/plan/statements.test.ts +78 -0
  378. package/src/postgres/plan/statements.ts +299 -0
  379. package/src/postgres/secret-options.ts +10 -0
  380. package/src/postgres/testing/roundtrip-schema.ts +24 -1
  381. package/src/postgres.ts +33 -0
  382. package/src/serializer.ts +13 -2
  383. package/src/skills/chant-sql-postgres-migration.md +4 -3
  384. package/src/skills/chant-sql-postgres.md +11 -1
  385. package/src/skills/chant-sql.md +2 -1
  386. package/src/sql-files.test.ts +33 -0
  387. package/src/sql-types-command.ts +38 -16
  388. package/src/sql-types.ts +11 -6
  389. package/src/sqlserver/fixture.test.ts +186 -0
  390. package/src/sqlserver/import-cli.test.ts +61 -0
  391. package/src/sqlserver/lexer.ts +260 -0
  392. package/src/sqlserver/parse.ts +865 -0
  393. package/src/sqlserver/translate.test.ts +396 -0
  394. package/src/sqlserver/translate.ts +558 -0
  395. package/src/sqlserver/types.test.ts +102 -0
  396. package/src/sqlserver/types.ts +154 -0
  397. package/src/sqlserver/validate.e2e.test.ts +32 -0
  398. package/src/sqlserver/validate.test.ts +49 -0
  399. package/src/sqlserver/validate.ts +76 -0
  400. package/src/validate.ts +10 -0
  401. package/src/workspace-kinds.test.ts +11 -0
  402. package/workspace-kinds.json +100 -2
@@ -0,0 +1,213 @@
1
+ /**
2
+ * The needs-review catalog: the judgment calls that turn a table from another
3
+ * database into a ClickHouse table, each as a finding with the evidence it
4
+ * used. A source reader (`chant import` of SQL Server, #4398; `chant migrate`
5
+ * of Postgres, #4399) does the mechanical work, a type map and a rename,
6
+ * and asks this module for everything that is a decision.
7
+ *
8
+ * Nothing here knows a source dialect. A reader describes its table in the
9
+ * neutral facts below (a candidate sort key, a column's nullability, a
10
+ * constraint) and gets back the ClickHouse choice, a finding to report, and
11
+ * for a constraint the comment lines to keep in the DDL. The rules are the
12
+ * same whichever database the table came from.
13
+ *
14
+ * ## API
15
+ *
16
+ * - {@link sortKeyReview}: `ORDER BY` from the candidates the source offers,
17
+ * in the priority `explicit-order`, `clustering-key`, `primary-key`,
18
+ * `unique-key`, then `tuple()`. Returns `orderBy`, the `settings` the key
19
+ * needs (`allow_nullable_key` when a key column is `Nullable`), and a
20
+ * finding that names the chosen candidate and the others it passed over.
21
+ * - {@link engineReview}: `MergeTree` for an append-only table;
22
+ * `ReplacingMergeTree(_version, _deleted)` for a CDC mirror, with the two
23
+ * columns it adds in `extraColumns`. `cdcColumns` names them otherwise
24
+ * (the Postgres pair uses the `CdcMirror` composite's `_is_deleted`).
25
+ * - {@link nullableReview}: a column's final type. A `NOT NULL` column keeps
26
+ * its type with no finding. A nullable column becomes `Nullable(T)` with a
27
+ * finding; when it has a default the finding says the default could
28
+ * replace `Nullable`.
29
+ * - {@link lowCardinalityReview}: a finding for a `String` column whose name
30
+ * and declared length suggest few distinct values. It never changes the
31
+ * type; offline, the name and the type are all there is to read.
32
+ * - {@link constraintReview}: foreign keys, checks, unique and exclusion
33
+ * constraints, which ClickHouse does not enforce. Returns `comments` (SQL `--` lines to
34
+ * put before the `CREATE`) and one finding per constraint.
35
+ * - {@link REVIEW_RULES}: every rule id with its summary and the ClickHouse
36
+ * documentation it rests on, for report metadata.
37
+ * - {@link findingText}: a finding as one line (object, message, evidence,
38
+ * suggestion), the form a SARIF `message` takes.
39
+ *
40
+ * A finding's `severity` is `warning` for a decision the author must confirm
41
+ * and `info` for a note that changes nothing. The caller maps findings to its
42
+ * own diagnostic type; `at` carries the source line and column when the
43
+ * reader knows them.
44
+ *
45
+ * Every ClickHouse type and engine this module writes is checked against the
46
+ * pinned catalog (`src/generated/clickhouse.ts`, ClickHouse 26.8) in
47
+ * `review-catalog.test.ts`, so a pin move that drops one fails there.
48
+ *
49
+ * Sources: the MergeTree sorting key and `allow_nullable_key`
50
+ * (https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree),
51
+ * `ReplacingMergeTree(ver, is_deleted)`
52
+ * (https://clickhouse.com/docs/engines/table-engines/mergetree-family/replacingmergetree),
53
+ * `Nullable` (https://clickhouse.com/docs/sql-reference/data-types/nullable),
54
+ * `LowCardinality`
55
+ * (https://clickhouse.com/docs/sql-reference/data-types/lowcardinality).
56
+ */
57
+ export type ReviewSeverity = "warning" | "info";
58
+ export type ReviewRuleId = "SQLRV001" | "SQLRV002" | "SQLRV003" | "SQLRV004" | "SQLRV005" | "SQLRV006" | "SQLRV007" | "SQLRV008" | "SQLRV009" | "SQLRV010" | "SQLRV011" | "SQLRV012";
59
+ export interface ReviewRule {
60
+ id: ReviewRuleId;
61
+ name: string;
62
+ summary: string;
63
+ docs: readonly string[];
64
+ }
65
+ /**
66
+ * The rules. SQLRV001 to SQLRV005 are the shared ones; the rest are raised by
67
+ * a source reader for what only its dialect has, and live here so a report
68
+ * lists one catalog.
69
+ */
70
+ export declare const REVIEW_RULES: Readonly<Record<ReviewRuleId, ReviewRule>>;
71
+ export interface SourcePosition {
72
+ /** 1-based. */
73
+ line: number;
74
+ /** 1-based. */
75
+ column: number;
76
+ }
77
+ export interface ReviewFinding {
78
+ ruleId: ReviewRuleId;
79
+ severity: ReviewSeverity;
80
+ /** The table or view the finding is about, as the source names it. */
81
+ object: string;
82
+ /** The column, when the finding is about one. */
83
+ column?: string;
84
+ message: string;
85
+ /** What the decision was read from: each entry is a fact in the source. */
86
+ evidence: readonly string[];
87
+ suggestion?: string;
88
+ at?: SourcePosition;
89
+ }
90
+ /** A finding as one line. */
91
+ export declare function findingText(f: ReviewFinding): string;
92
+ /**
93
+ * Where a candidate sort key came from, strongest first. `explicit-order` is
94
+ * an ordering the author declared for storage (a columnstore `ORDER`),
95
+ * `clustering-key` the key the source stores rows in (a clustered index),
96
+ * then the primary key and the first unique key.
97
+ */
98
+ export type SortKeyKind = "explicit-order" | "clustering-key" | "primary-key" | "unique-key";
99
+ export interface SortKeyCandidate {
100
+ kind: SortKeyKind;
101
+ /** The index or constraint name, for the evidence. */
102
+ name?: string;
103
+ columns: readonly string[];
104
+ /** Columns the source sorts descending; ClickHouse's `ORDER BY` drops the direction. */
105
+ descending?: readonly string[];
106
+ /** The fact this candidate was read from, e.g. `CREATE CLUSTERED INDEX CX_t`. */
107
+ source: string;
108
+ }
109
+ export interface SortKeyInput {
110
+ object: string;
111
+ candidates: readonly SortKeyCandidate[];
112
+ /** Each column's ClickHouse type, by name; `Nullable(...)` marks a nullable key column. */
113
+ columnTypes: Readonly<Record<string, string>>;
114
+ at?: SourcePosition;
115
+ }
116
+ export interface SortKeyResult {
117
+ orderBy: string[];
118
+ /** MergeTree settings the key needs. */
119
+ settings: Record<string, string>;
120
+ finding: ReviewFinding;
121
+ }
122
+ export declare function sortKeyReview(input: SortKeyInput): SortKeyResult;
123
+ export interface EngineInput {
124
+ object: string;
125
+ /**
126
+ * `append` for a table that is loaded and queried, `cdc` for a mirror of a
127
+ * table that changes in place (#4399): rows arrive as new versions and a
128
+ * delete arrives as a marker row.
129
+ */
130
+ mode: "append" | "cdc";
131
+ /** Facts about the source table that bear on the choice, as plain sentences. */
132
+ facts?: readonly string[];
133
+ /** The columns the source enforces unique, when it does. */
134
+ uniqueKey?: readonly string[];
135
+ /**
136
+ * For `cdc`, the names of the version and deleted columns, when the pipeline
137
+ * or the `CdcMirror` composite names them other than `_version` and
138
+ * `_deleted`. The names are the caller's; the catalog only writes them.
139
+ */
140
+ cdcColumns?: {
141
+ version: string;
142
+ deleted: string;
143
+ };
144
+ at?: SourcePosition;
145
+ }
146
+ export interface EngineResult {
147
+ /** The text after `ENGINE =`. */
148
+ engine: string;
149
+ /** Columns the engine needs and the source does not have. */
150
+ extraColumns: Array<{
151
+ name: string;
152
+ type: string;
153
+ }>;
154
+ finding: ReviewFinding;
155
+ }
156
+ export declare const CDC_VERSION_COLUMN: {
157
+ readonly name: "_version";
158
+ readonly type: "UInt64";
159
+ };
160
+ export declare const CDC_DELETED_COLUMN: {
161
+ readonly name: "_deleted";
162
+ readonly type: "UInt8";
163
+ };
164
+ export declare function engineReview(input: EngineInput): EngineResult;
165
+ export interface NullableInput {
166
+ object: string;
167
+ column: string;
168
+ /** The column's ClickHouse type before `Nullable`. */
169
+ type: string;
170
+ sourceNullable: boolean;
171
+ /** The default as the ClickHouse expression it became, or the source text when it did not translate. */
172
+ defaultExpr?: string;
173
+ at?: SourcePosition;
174
+ }
175
+ export interface NullableResult {
176
+ type: string;
177
+ finding?: ReviewFinding;
178
+ }
179
+ export declare function nullableReview(input: NullableInput): NullableResult;
180
+ export interface LowCardinalityInput {
181
+ object: string;
182
+ column: string;
183
+ /** The ClickHouse type as emitted. Only `String` and `Nullable(String)` are candidates. */
184
+ type: string;
185
+ /** The source's declared maximum length, when it has one. */
186
+ maxLength?: number;
187
+ at?: SourcePosition;
188
+ }
189
+ /** The longest declared length that still counts as supporting evidence. */
190
+ export declare const LOW_CARDINALITY_MAX_LENGTH = 50;
191
+ export declare function lowCardinalityReview(input: LowCardinalityInput): ReviewFinding | undefined;
192
+ export interface ConstraintFact {
193
+ kind: "foreign-key" | "check" | "unique" | "exclusion";
194
+ name?: string;
195
+ columns?: readonly string[];
196
+ references?: {
197
+ table: string;
198
+ columns: readonly string[];
199
+ };
200
+ /** A check's expression, or an exclusion's `USING method (element WITH operator, ...)`, as the source wrote it. */
201
+ expression?: string;
202
+ at?: SourcePosition;
203
+ }
204
+ export interface ConstraintResult {
205
+ /** `-- ` lines to put before the `CREATE`; never contain a line break. */
206
+ comments: string[];
207
+ findings: ReviewFinding[];
208
+ }
209
+ export declare function constraintReview(input: {
210
+ object: string;
211
+ constraints: readonly ConstraintFact[];
212
+ }): ConstraintResult;
213
+ //# sourceMappingURL=review-catalog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"review-catalog.d.ts","sourceRoot":"","sources":["../../src/clickhouse/review-catalog.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,330 @@
1
+ /**
2
+ * The needs-review catalog: the judgment calls that turn a table from another
3
+ * database into a ClickHouse table, each as a finding with the evidence it
4
+ * used. A source reader (`chant import` of SQL Server, #4398; `chant migrate`
5
+ * of Postgres, #4399) does the mechanical work, a type map and a rename,
6
+ * and asks this module for everything that is a decision.
7
+ *
8
+ * Nothing here knows a source dialect. A reader describes its table in the
9
+ * neutral facts below (a candidate sort key, a column's nullability, a
10
+ * constraint) and gets back the ClickHouse choice, a finding to report, and
11
+ * for a constraint the comment lines to keep in the DDL. The rules are the
12
+ * same whichever database the table came from.
13
+ *
14
+ * ## API
15
+ *
16
+ * - {@link sortKeyReview}: `ORDER BY` from the candidates the source offers,
17
+ * in the priority `explicit-order`, `clustering-key`, `primary-key`,
18
+ * `unique-key`, then `tuple()`. Returns `orderBy`, the `settings` the key
19
+ * needs (`allow_nullable_key` when a key column is `Nullable`), and a
20
+ * finding that names the chosen candidate and the others it passed over.
21
+ * - {@link engineReview}: `MergeTree` for an append-only table;
22
+ * `ReplacingMergeTree(_version, _deleted)` for a CDC mirror, with the two
23
+ * columns it adds in `extraColumns`. `cdcColumns` names them otherwise
24
+ * (the Postgres pair uses the `CdcMirror` composite's `_is_deleted`).
25
+ * - {@link nullableReview}: a column's final type. A `NOT NULL` column keeps
26
+ * its type with no finding. A nullable column becomes `Nullable(T)` with a
27
+ * finding; when it has a default the finding says the default could
28
+ * replace `Nullable`.
29
+ * - {@link lowCardinalityReview}: a finding for a `String` column whose name
30
+ * and declared length suggest few distinct values. It never changes the
31
+ * type; offline, the name and the type are all there is to read.
32
+ * - {@link constraintReview}: foreign keys, checks, unique and exclusion
33
+ * constraints, which ClickHouse does not enforce. Returns `comments` (SQL `--` lines to
34
+ * put before the `CREATE`) and one finding per constraint.
35
+ * - {@link REVIEW_RULES}: every rule id with its summary and the ClickHouse
36
+ * documentation it rests on, for report metadata.
37
+ * - {@link findingText}: a finding as one line (object, message, evidence,
38
+ * suggestion), the form a SARIF `message` takes.
39
+ *
40
+ * A finding's `severity` is `warning` for a decision the author must confirm
41
+ * and `info` for a note that changes nothing. The caller maps findings to its
42
+ * own diagnostic type; `at` carries the source line and column when the
43
+ * reader knows them.
44
+ *
45
+ * Every ClickHouse type and engine this module writes is checked against the
46
+ * pinned catalog (`src/generated/clickhouse.ts`, ClickHouse 26.8) in
47
+ * `review-catalog.test.ts`, so a pin move that drops one fails there.
48
+ *
49
+ * Sources: the MergeTree sorting key and `allow_nullable_key`
50
+ * (https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree),
51
+ * `ReplacingMergeTree(ver, is_deleted)`
52
+ * (https://clickhouse.com/docs/engines/table-engines/mergetree-family/replacingmergetree),
53
+ * `Nullable` (https://clickhouse.com/docs/sql-reference/data-types/nullable),
54
+ * `LowCardinality`
55
+ * (https://clickhouse.com/docs/sql-reference/data-types/lowcardinality).
56
+ */
57
+ const CH_MERGETREE = "https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree";
58
+ /**
59
+ * The rules. SQLRV001 to SQLRV005 are the shared ones; the rest are raised by
60
+ * a source reader for what only its dialect has, and live here so a report
61
+ * lists one catalog.
62
+ */
63
+ export const REVIEW_RULES = {
64
+ SQLRV001: {
65
+ id: "SQLRV001",
66
+ name: "sort-key",
67
+ summary: "The ORDER BY key is a suggestion from the source's indexes.",
68
+ docs: [CH_MERGETREE],
69
+ },
70
+ SQLRV002: {
71
+ id: "SQLRV002",
72
+ name: "engine",
73
+ summary: "The table engine is a choice the source does not make.",
74
+ docs: [CH_MERGETREE, "https://clickhouse.com/docs/engines/table-engines/mergetree-family/replacingmergetree"],
75
+ },
76
+ SQLRV003: {
77
+ id: "SQLRV003",
78
+ name: "nullable",
79
+ summary: "A nullable column becomes Nullable(T), which costs storage and speed; a default can replace it.",
80
+ docs: ["https://clickhouse.com/docs/sql-reference/data-types/nullable"],
81
+ },
82
+ SQLRV004: {
83
+ id: "SQLRV004",
84
+ name: "low-cardinality",
85
+ summary: "A String column that may hold few distinct values could be LowCardinality(String).",
86
+ docs: ["https://clickhouse.com/docs/sql-reference/data-types/lowcardinality"],
87
+ },
88
+ SQLRV005: {
89
+ id: "SQLRV005",
90
+ name: "constraint",
91
+ summary: "ClickHouse does not enforce this constraint; it is kept as a comment.",
92
+ docs: ["https://clickhouse.com/docs/sql-reference/statements/create/table"],
93
+ },
94
+ SQLRV006: {
95
+ id: "SQLRV006",
96
+ name: "generated-column",
97
+ summary: "An identity, sequence, computed or system-generated column has no ClickHouse equivalent.",
98
+ docs: ["https://clickhouse.com/docs/sql-reference/statements/create/table"],
99
+ },
100
+ SQLRV007: {
101
+ id: "SQLRV007",
102
+ name: "type-judgment",
103
+ summary: "The type has no exact ClickHouse match; the nearest one was chosen.",
104
+ docs: ["https://clickhouse.com/docs/sql-reference/data-types"],
105
+ },
106
+ SQLRV008: {
107
+ id: "SQLRV008",
108
+ name: "default-expression",
109
+ summary: "A default expression was translated or dropped.",
110
+ docs: ["https://clickhouse.com/docs/sql-reference/statements/create/table"],
111
+ },
112
+ SQLRV009: {
113
+ id: "SQLRV009",
114
+ name: "storage-option",
115
+ summary: "A storage option of the source (filegroup, partitioning, compression, versioning) has no counterpart here.",
116
+ docs: [CH_MERGETREE],
117
+ },
118
+ SQLRV010: {
119
+ id: "SQLRV010",
120
+ name: "query-text",
121
+ summary: "A view body is copied as written and is not translated.",
122
+ docs: ["https://clickhouse.com/docs/sql-reference/statements/create/view"],
123
+ },
124
+ SQLRV011: {
125
+ id: "SQLRV011",
126
+ name: "not-carried",
127
+ summary: "An object or statement of the source is not carried over, and is named here.",
128
+ docs: [],
129
+ },
130
+ SQLRV012: {
131
+ id: "SQLRV012",
132
+ name: "emulator-rejected",
133
+ summary: "The ClickHouse emulator refused a statement the import would write.",
134
+ docs: [],
135
+ },
136
+ };
137
+ /** A finding as one line. */
138
+ export function findingText(f) {
139
+ const where = f.column ? `${f.object}.${f.column}` : f.object;
140
+ const parts = [`${where}: ${f.message}`];
141
+ if (f.evidence.length > 0)
142
+ parts.push(`Evidence: ${f.evidence.join("; ")}.`);
143
+ if (f.suggestion)
144
+ parts.push(`Suggestion: ${f.suggestion}`);
145
+ return parts.join(" ");
146
+ }
147
+ const q = (name) => (/^[A-Za-z_][A-Za-z0-9_]*$/.test(name) ? name : `\`${name.replace(/`/g, "\\`")}\``);
148
+ const list = (names) => names.join(", ");
149
+ const SORT_KEY_PRIORITY = ["explicit-order", "clustering-key", "primary-key", "unique-key"];
150
+ export function sortKeyReview(input) {
151
+ const ranked = SORT_KEY_PRIORITY.flatMap((kind) => input.candidates.filter((c) => c.kind === kind && c.columns.length > 0));
152
+ const chosen = ranked[0];
153
+ const evidence = [];
154
+ const settings = {};
155
+ let orderBy = [];
156
+ let message;
157
+ let suggestion;
158
+ if (chosen) {
159
+ orderBy = [...chosen.columns];
160
+ evidence.push(`${chosen.source} (${list(chosen.columns)})`);
161
+ for (const other of ranked.slice(1))
162
+ evidence.push(`passed over: ${other.source} (${list(other.columns)})`);
163
+ if (chosen.descending && chosen.descending.length > 0)
164
+ evidence.push(`descending in the source, ascending here: ${list(chosen.descending)}`);
165
+ const nullable = orderBy.filter((c) => (input.columnTypes[c] ?? "").startsWith("Nullable("));
166
+ if (nullable.length > 0) {
167
+ settings.allow_nullable_key = "1";
168
+ evidence.push(`Nullable key column${nullable.length > 1 ? "s" : ""}: ${list(nullable)}, so allow_nullable_key = 1 is set`);
169
+ }
170
+ message = `ORDER BY (${list(orderBy.map(q))}) suggested from the ${chosen.kind.replace("-", " ")}.`;
171
+ suggestion = "Put the columns your queries filter on first, and the one with the fewest distinct values before the one with the most.";
172
+ }
173
+ else {
174
+ orderBy = [];
175
+ evidence.push("no clustering key, primary key or unique key in the source");
176
+ message = "ORDER BY tuple() used because the source gives no key to suggest.";
177
+ suggestion = "Choose the columns your queries filter on; a MergeTree table without a sort key cannot skip granules.";
178
+ }
179
+ return {
180
+ orderBy,
181
+ settings,
182
+ finding: { ruleId: "SQLRV001", severity: "warning", object: input.object, message, evidence, ...(suggestion ? { suggestion } : {}), ...(input.at ? { at: input.at } : {}) },
183
+ };
184
+ }
185
+ export const CDC_VERSION_COLUMN = { name: "_version", type: "UInt64" };
186
+ export const CDC_DELETED_COLUMN = { name: "_deleted", type: "UInt8" };
187
+ export function engineReview(input) {
188
+ const evidence = [...(input.facts ?? [])];
189
+ const unique = input.uniqueKey && input.uniqueKey.length > 0 ? list(input.uniqueKey) : undefined;
190
+ if (input.mode === "cdc") {
191
+ evidence.push(`the table is mirrored from a source that updates rows in place${unique ? `, keyed on (${unique})` : ""}`);
192
+ const version = input.cdcColumns?.version ?? CDC_VERSION_COLUMN.name;
193
+ const deleted = input.cdcColumns?.deleted ?? CDC_DELETED_COLUMN.name;
194
+ return {
195
+ engine: `ReplacingMergeTree(${version}, ${deleted})`,
196
+ extraColumns: [
197
+ { name: version, type: CDC_VERSION_COLUMN.type },
198
+ { name: deleted, type: CDC_DELETED_COLUMN.type },
199
+ ],
200
+ finding: {
201
+ ruleId: "SQLRV002",
202
+ severity: "warning",
203
+ object: input.object,
204
+ message: `ReplacingMergeTree(${version}, ${deleted}) chosen for a mirror; it adds the columns ${version} and ${deleted}.`,
205
+ evidence,
206
+ suggestion: `The sort key must be the source key, because rows with an equal sort key collapse to the highest ${version} on merge. Read with FINAL, or filter on ${deleted}, to see the collapsed rows before a merge.`,
207
+ ...(input.at ? { at: input.at } : {}),
208
+ },
209
+ };
210
+ }
211
+ if (unique)
212
+ evidence.push(`the source enforces uniqueness on (${unique}); MergeTree does not`);
213
+ return {
214
+ engine: "MergeTree",
215
+ extraColumns: [],
216
+ finding: {
217
+ ruleId: "SQLRV002",
218
+ severity: "warning",
219
+ object: input.object,
220
+ message: "MergeTree chosen; the source has no engine to carry over.",
221
+ evidence,
222
+ suggestion: unique
223
+ ? "If rows can arrive twice, ReplacingMergeTree collapses duplicates of the sort key on merge, not on insert."
224
+ : "Pick another MergeTree variant for pre-aggregation (SummingMergeTree, AggregatingMergeTree) when the table is a rollup.",
225
+ ...(input.at ? { at: input.at } : {}),
226
+ },
227
+ };
228
+ }
229
+ export function nullableReview(input) {
230
+ if (!input.sourceNullable)
231
+ return { type: input.type };
232
+ const evidence = [`${input.column} allows NULL in the source`];
233
+ let suggestion;
234
+ if (input.defaultExpr !== undefined) {
235
+ evidence.push(`it has the default ${input.defaultExpr}`);
236
+ suggestion = `If NULL is never stored on purpose, declare ${input.type} DEFAULT ${input.defaultExpr} and load the default instead of NULL.`;
237
+ }
238
+ else {
239
+ evidence.push("it has no default");
240
+ suggestion = `If a sentinel value can stand for missing, declare ${input.type} DEFAULT <sentinel>; a Nullable column keeps a separate null mask.`;
241
+ }
242
+ return {
243
+ type: `Nullable(${input.type})`,
244
+ finding: {
245
+ ruleId: "SQLRV003",
246
+ severity: "warning",
247
+ object: input.object,
248
+ column: input.column,
249
+ message: `Kept as Nullable(${input.type}) so no stored NULL is lost.`,
250
+ evidence,
251
+ suggestion,
252
+ ...(input.at ? { at: input.at } : {}),
253
+ },
254
+ };
255
+ }
256
+ // --- LowCardinality -------------------------------------------------------
257
+ /** Last words of a column name that usually mean a small set of values. */
258
+ const LOW_CARDINALITY_WORDS = new Set("status state type kind category country currency region level channel gender lang language locale unit code flag method mode grade tier priority".split(" "));
259
+ /** A column name's last word: `order_status` and `OrderStatus` both give `status`. */
260
+ function lastWord(name) {
261
+ const words = name.replace(/([a-z0-9])([A-Z])/g, "$1_$2").split(/[^A-Za-z0-9]+/).filter(Boolean);
262
+ return (words[words.length - 1] ?? "").toLowerCase();
263
+ }
264
+ /** The longest declared length that still counts as supporting evidence. */
265
+ export const LOW_CARDINALITY_MAX_LENGTH = 50;
266
+ export function lowCardinalityReview(input) {
267
+ if (input.type !== "String" && input.type !== "Nullable(String)")
268
+ return undefined;
269
+ if (!LOW_CARDINALITY_WORDS.has(lastWord(input.column)))
270
+ return undefined;
271
+ const evidence = [`the name ${input.column} ends in a word that usually names a small set of values`, `the type is ${input.type}`];
272
+ if (input.maxLength !== undefined && input.maxLength <= LOW_CARDINALITY_MAX_LENGTH)
273
+ evidence.push(`the declared length is ${String(input.maxLength)}`);
274
+ evidence.push("no data was read, so the distinct count is unknown");
275
+ const wrapped = input.type.startsWith("Nullable(") ? "LowCardinality(Nullable(String))" : "LowCardinality(String)";
276
+ return {
277
+ ruleId: "SQLRV004",
278
+ severity: "warning",
279
+ object: input.object,
280
+ column: input.column,
281
+ message: `${input.column} is a LowCardinality candidate and stays ${input.type}.`,
282
+ evidence,
283
+ suggestion: `ClickHouse documents ${wrapped} as helpful below roughly ten thousand distinct values; count them with uniqExact(${q(input.column)}) before changing the type.`,
284
+ ...(input.at ? { at: input.at } : {}),
285
+ };
286
+ }
287
+ const oneLine = (s) => s.replace(/\s+/g, " ").trim();
288
+ export function constraintReview(input) {
289
+ const comments = [];
290
+ const findings = [];
291
+ for (const c of input.constraints) {
292
+ const label = c.name ? ` ${c.name}` : "";
293
+ let text;
294
+ let message;
295
+ let suggestion;
296
+ if (c.kind === "foreign-key") {
297
+ const target = c.references ? `${c.references.table} (${list(c.references.columns)})` : "an unknown table";
298
+ text = `FOREIGN KEY${label} (${list(c.columns ?? [])}) REFERENCES ${target}`;
299
+ message = `Foreign key${label} is not enforced by ClickHouse and is kept as a comment.`;
300
+ suggestion = "Check referential integrity in the load pipeline, or join on the column and accept orphan rows.";
301
+ }
302
+ else if (c.kind === "unique") {
303
+ text = `UNIQUE${label} (${list(c.columns ?? [])})`;
304
+ message = `Unique constraint${label} is not enforced by ClickHouse and is kept as a comment.`;
305
+ suggestion = "A MergeTree sort key does not make rows unique. ReplacingMergeTree collapses duplicates on merge only.";
306
+ }
307
+ else if (c.kind === "exclusion") {
308
+ text = `EXCLUDE${label} ${oneLine(c.expression ?? "")}`;
309
+ message = `Exclusion constraint${label} is not enforced by ClickHouse and is kept as a comment.`;
310
+ suggestion = "ClickHouse has no constraint that rejects overlapping rows. Check for overlaps in the load, or in a query.";
311
+ }
312
+ else {
313
+ text = `CHECK${label} ${oneLine(c.expression ?? "")}`;
314
+ message = `Check constraint${label} is not translated and is kept as a comment.`;
315
+ suggestion = "ClickHouse has CONSTRAINT name CHECK expr, enforced on INSERT. Rewrite the expression in ClickHouse SQL to use it.";
316
+ }
317
+ comments.push(`-- ${oneLine(text)}`);
318
+ findings.push({
319
+ ruleId: "SQLRV005",
320
+ severity: "warning",
321
+ object: input.object,
322
+ ...(c.kind !== "check" && c.kind !== "exclusion" && c.columns && c.columns.length === 1 ? { column: c.columns[0] } : {}),
323
+ message,
324
+ evidence: [oneLine(text)],
325
+ suggestion,
326
+ ...(c.at ? { at: c.at } : {}),
327
+ });
328
+ }
329
+ return { comments, findings };
330
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"classifier-page.d.ts","sourceRoot":"","sources":["../../src/codegen/classifier-page.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAcH,wBAAgB,oBAAoB,IAAI,MAAM,CAiF7C"}
1
+ {"version":3,"file":"classifier-page.d.ts","sourceRoot":"","sources":["../../src/codegen/classifier-page.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAeH,wBAAgB,oBAAoB,IAAI,MAAM,CAwH7C"}
@@ -8,6 +8,7 @@ const LABEL = {
8
8
  drop: "drop",
9
9
  metadata: "metadata only",
10
10
  rewrite: "background rewrite",
11
+ replace: "replace table",
11
12
  rebuild: "rebuild",
12
13
  };
13
14
  const cell = (s) => s.replace(/\|/g, "\\|");
@@ -16,7 +17,7 @@ export function renderClassifierPage() {
16
17
  return `---
17
18
  title: "Planning ClickHouse Changes"
18
19
  label: "Planning and the Change Classifier"
19
- description: "How a ClickHouse schema change is classified as metadata only, a background rewrite or a rebuild, each with the ALTER restriction behind it"
20
+ description: "How a ClickHouse schema change is classified as metadata only, a background rewrite, a replacement or a rebuild, each with the ALTER restriction behind it"
20
21
  diataxis: reference
21
22
  group: "ClickHouse"
22
23
  order: 1
@@ -30,9 +31,10 @@ Every change between two ClickHouse schemas is classified before anything runs:
30
31
  |---|---|
31
32
  | metadata only | the server records the change and touches no existing data |
32
33
  | background rewrite | a mutation rewrites existing parts in the background, with no rollback |
34
+ | replace table | ClickHouse cannot alter a stream-engine table, and it stores no rows, so the applier drops and creates it around the views that read it |
33
35
  | rebuild | ClickHouse cannot make the change to the existing table, and the data has to be copied into a new one; a plan refuses to make it in place |
34
36
 
35
- Two commands report the classification, and \`chant lifecycle plan\` reports it as each update's disruption (metadata only is \`in-place\`, a rewrite \`rolling\`, a rebuild \`replace\`):
37
+ Two commands report the classification, and \`chant lifecycle plan\` reports it as each update's disruption (metadata only is \`in-place\`, a rewrite \`rolling\`, a replacement or a rebuild \`replace\`):
36
38
 
37
39
  \`\`\`bash
38
40
  chant sql diff base.json head.json # two chant build outputs, offline
@@ -41,13 +43,28 @@ chant sql plan prod schema.json # a build output against the prod server
41
43
 
42
44
  Both exit 2 when a change needs a rebuild. \`chant sql diff\` compares a pull request's base and head builds with no server. \`chant sql plan\` reads the server \`sql.profiles.<env>\` binds, and asks that server's formatter about any expression the normalization rules leave different, so the server's own rewriting (\`INTERVAL 1 DAY\` as \`toIntervalDay(1)\`, \`a+b*2\` as \`a + (b * 2)\`) is not reported as a change.
43
45
 
44
- \`chant sql plan\` also exits 2 when a declared database holds an object whose definition it cannot read. It names each one under \`Refused\` (\`unreadable\` in \`--json\`) instead of leaving it out. Dictionaries are read and planned like the other objects: any change but a comment replaces one (SQLCH245).
46
+ \`chant sql plan\` also exits 2 when a declared database holds an object whose definition it cannot read. It names each one under \`Refused\` (\`unreadable\` in \`--json\`) instead of leaving it out. It exits 2 as well when the build names a named collection the server doesn't have, naming each under \`Refused\` (\`namedCollections.missing\` in \`--json\`); see [Named collections](../clickhouse-ddl/#named-collections). Dictionaries are read and planned like the other objects: any change but a comment replaces one (SQLCH245).
45
47
 
46
48
  A clause chant's parser does not know ([Plain .sql Files](../sql-files/#clauses-chant-does-not-read)) is compared as text, and the rest of its object is planned as usual. A change to one is SQLCH290, refused for review with no rebuild Op suggested, since chant cannot tell what the change takes. A clause only the server prints is a hint, not a change: a newer server printing a clause with its default looks the same as a clause removed from the declaration.
47
49
 
50
+ ## Stream tables
51
+
52
+ A table on Kafka, S3Queue, AzureQueue, RabbitMQ, NATS or FileLog stores no rows. It is the consumer that a materialized view reads through, and the position it has reached lives in the broker's committed offsets or in Keeper. There is no \`ALTER\` for its engine arguments, settings or columns, and there is nothing to copy, so a change to one is neither metadata nor a rebuild. It is SQLCH225, in the replace class (\`diffStreamTable\` in \`src/clickhouse/plan/diff.ts\`). The plan refuses nothing for it.
53
+
54
+ The applier makes the change in place, in this order (\`replaceStreamSteps\` in \`src/clickhouse/apply/statements.ts\`): \`DETACH TABLE\` for each materialized view on the server that reads the table, \`DROP TABLE ... SYNC\`, the declared \`CREATE TABLE\`, then \`ATTACH TABLE\` for the same views. The plan names the views in a hint. Messages wait in the broker, and files wait in the bucket, while the views are detached. A change that moves a table to or from a stream engine is still SQLCH223, a rebuild, and \`ClickHouseRebuildOp\` refuses a stream-engine table by name (\`streamRefusal\` in \`src/clickhouse/rebuild/observe.ts\`).
55
+
56
+ Two replacements lose the table's position, and the change carries a note saying so (\`positionWarnings\` in \`src/clickhouse/plan/stream.ts\`):
57
+
58
+ - A different \`kafka_group_name\`, as a setting or as the third engine argument, is a different consumer group. It starts from its own committed offsets, or from the start of the topic when it has none.
59
+ - A different S3Queue \`keeper_path\` is a different record of processed files. Every file already seen is processed again.
60
+
61
+ An apply killed between the detach and the attach leaves the views detached, and a detached view is not in \`system.tables\`. Nothing re-attaches it: run \`ATTACH TABLE\` for each view by hand, then plan again. This has not been run against a server.
62
+
63
+ The \`StreamIngest\` composite declares the stream table, the view and the MergeTree target together: see [Composites](../composites/#streamingest).
64
+
48
65
  ## After the plan
49
66
 
50
- The plan only reports. [\`clickhouseApply\`](../applying/) makes the metadata-only and background-rewrite changes, and refuses a rebuild the same way the plan does, sending nothing for that object. A rebuild runs as \`ClickHouseRebuildOp\`, a gated migration Op that creates the new table, backfills it, verifies it and swaps it in: see [Rebuilding a Table](../rebuild/). Both commands print the Op declaration to start from for each refused table.
67
+ The plan only reports. [\`clickhouseApply\`](../applying/) makes the metadata-only, background-rewrite and stream-table changes, and refuses a rebuild the same way the plan does, sending nothing for that object. A rebuild runs as \`ClickHouseRebuildOp\`, a gated migration Op that creates the new table, backfills it, verifies it and swaps it in: see [Rebuilding a Table](../rebuild/). Both commands print the Op declaration to start from for each refused table.
51
68
 
52
69
  \`chant migrate\` plays no part in any of this. It translates a file from one lexicon's format into another's, such as a GitHub Actions workflow into GitLab CI, and does not run schema migrations.
53
70
 
@@ -70,6 +87,29 @@ A rebuild is never DDL: it is a step naming \`ClickHouseRebuildOp\`, or for a vi
70
87
 
71
88
  \`--topology\` renders the statements for where they will run: \`single\` (the default), \`cluster:<name>\`, \`replicated\` or \`cloud\`. On a cluster every statement carries \`ON CLUSTER\` and a MergeTree-family table becomes \`Replicated*MergeTree\` with its Keeper path; in a \`Replicated\` database the tables are \`Replicated*MergeTree\` with no path and no \`ON CLUSTER\`. \`diffStatements(before, after, { topology })\` takes the same choice; see [Applying to a Server](../applying/#topology).
72
89
 
90
+ ## Migration files on a pull request
91
+
92
+ A workspace member that is a goose, golang-migrate, clickhouse-migrations or Flyway directory (see [Workspace kinds](/chant/reference/workspace-kinds/)) has no declaration to diff. On a pull request, \`chant components pr-plan\` lists each migration file the pull request adds to such a member, and the plan note gives every statement in it the class the rules below give the same change. This is the "check" level of adopting chant beside an existing migration tool: it reads files, applies nothing and contacts no server, so it needs no \`--env\`.
93
+
94
+ The up statements are the ones \`chant sql replay\` would run: goose's \`-- +goose Up\` section, the whole \`.up.sql\` file for golang-migrate, the whole file for clickhouse-migrations, and a Flyway file after placeholder substitution with the values in \`flyway.toml\` or \`flyway.conf\`. A file the base commit already has is not new, whatever the pull request does to it. Undo files are left out.
95
+
96
+ \`\`\`text
97
+ \`db/00002_orders.sql\` (member \`ledger\`, postgres)
98
+ - 1. \`CREATE INDEX orders_status_idx ON orders (status)\`: needs CONCURRENTLY (SQLPG241, SHARE)
99
+ - 2. \`ALTER TABLE orders ALTER COLUMN a TYPE bigint\`: undecided between SQLPG206 metadata only and SQLPG207 ACCESS EXCLUSIVE rewrite or scan
100
+ \`\`\`
101
+
102
+ Each statement is read with the dialect's parser (\`CREATE\`, \`GRANT\`, \`COMMENT ON\`) or word by word (\`ALTER\`, \`DROP\`, \`RENAME\`), and the lock on a Postgres statement is the one its rule's text names. The code is \`lexicons/sql/src/postgres/plan/statements.ts\` and \`lexicons/sql/src/clickhouse/plan/statements.ts\`.
103
+
104
+ A statement alone cannot always decide a rule, and then the note names the candidates and does not guess:
105
+
106
+ - \`ALTER COLUMN ... TYPE\` is SQLPG206 or SQLPG207 by the column's old type, and SQLPG208 as well with a \`USING\` expression.
107
+ - \`MODIFY COLUMN <type>\` is SQLCH210 or SQLCH211, \`DROP COLUMN\` SQLCH202 or SQLCH213, and \`RENAME COLUMN\` SQLCH212 or SQLCH213, by whether the column is in a key. When the same file creates the table, its keys are known and the statement is classified.
108
+ - \`MODIFY ORDER BY\` is SQLCH220, a rebuild. It is SQLCH216 or SQLCH220 when the same \`ALTER\` adds the columns the new key ends with, unless the file created the table and shows the old key is kept.
109
+ - \`CREATE OR REPLACE VIEW\` is SQLPG250 or SQLPG251 by whether the view keeps its columns.
110
+
111
+ A statement that reads or writes rows (\`INSERT\`, \`UPDATE\`, \`TRUNCATE\`) is listed as data. A schema change no rule covers, such as \`ALTER TABLE ... OWNER TO\` or a ClickHouse \`DROP PARTITION\`, is listed as having no class.
112
+
73
113
  ## Identity and renames
74
114
 
75
115
  An object is identified by its export name between two builds, so a changed name in the SQL under the same export is a rename. Against a server, which has no export names, an object is identified by \`database.name\`; a declaration renamed since the server last saw it says so with \`-- previously: <old name>\` before its CREATE.
@@ -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,CAmKjF"}
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,CAsKjF"}