@intentius/chant-lexicon-sql 0.124.46 → 0.124.48

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (360) 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/stream.d.ts +40 -0
  37. package/dist/clickhouse/plan/stream.d.ts.map +1 -0
  38. package/dist/clickhouse/plan/stream.js +107 -0
  39. package/dist/clickhouse/rebuild/observe.d.ts +3 -1
  40. package/dist/clickhouse/rebuild/observe.d.ts.map +1 -1
  41. package/dist/clickhouse/rebuild/observe.js +14 -1
  42. package/dist/clickhouse/review-catalog.d.ts +213 -0
  43. package/dist/clickhouse/review-catalog.d.ts.map +1 -0
  44. package/dist/clickhouse/review-catalog.js +330 -0
  45. package/dist/codegen/classifier-page.d.ts.map +1 -1
  46. package/dist/codegen/classifier-page.js +21 -4
  47. package/dist/codegen/clickhouse-module.d.ts.map +1 -1
  48. package/dist/codegen/clickhouse-module.js +3 -0
  49. package/dist/codegen/coverage-page.d.ts.map +1 -1
  50. package/dist/codegen/coverage-page.js +5 -3
  51. package/dist/codegen/docs.js +1 -1
  52. package/dist/codegen/postgres-classifier-page.js +1 -1
  53. package/dist/codegen/registry.d.ts.map +1 -1
  54. package/dist/codegen/registry.js +5 -0
  55. package/dist/composites/catalog.d.ts.map +1 -1
  56. package/dist/composites/catalog.js +100 -0
  57. package/dist/composites/clickhouse.d.ts +2 -0
  58. package/dist/composites/clickhouse.d.ts.map +1 -1
  59. package/dist/composites/clickhouse.js +2 -0
  60. package/dist/composites/otel-tables.d.ts +100 -0
  61. package/dist/composites/otel-tables.d.ts.map +1 -0
  62. package/dist/composites/otel-tables.js +282 -0
  63. package/dist/composites/stream-ingest.d.ts +63 -0
  64. package/dist/composites/stream-ingest.d.ts.map +1 -0
  65. package/dist/composites/stream-ingest.js +39 -0
  66. package/dist/coverage/clickhouse.json +1 -1
  67. package/dist/coverage/postgres.json +7 -7
  68. package/dist/coverage.d.ts +16 -6
  69. package/dist/coverage.d.ts.map +1 -1
  70. package/dist/coverage.js +10 -5
  71. package/dist/drizzle-command.d.ts +17 -0
  72. package/dist/drizzle-command.d.ts.map +1 -0
  73. package/dist/drizzle-command.js +91 -0
  74. package/dist/drizzle.d.ts +70 -0
  75. package/dist/drizzle.d.ts.map +1 -0
  76. package/dist/drizzle.js +684 -0
  77. package/dist/files/clickhouse.d.ts.map +1 -1
  78. package/dist/files/clickhouse.js +8 -1
  79. package/dist/files/common.d.ts +13 -0
  80. package/dist/files/common.d.ts.map +1 -1
  81. package/dist/files/common.js +5 -0
  82. package/dist/files/postgres.js +12 -2
  83. package/dist/generated/clickhouse.d.ts +2 -0
  84. package/dist/generated/clickhouse.d.ts.map +1 -1
  85. package/dist/generated/clickhouse.js +2 -0
  86. package/dist/import-parser.d.ts +21 -1
  87. package/dist/import-parser.d.ts.map +1 -1
  88. package/dist/import-parser.js +79 -5
  89. package/dist/index.d.ts +1 -1
  90. package/dist/index.d.ts.map +1 -1
  91. package/dist/index.js +1 -1
  92. package/dist/integrity.json +6 -5
  93. package/dist/lint/post-synth/audit-entries.d.ts.map +1 -1
  94. package/dist/lint/post-synth/audit-entries.js +1 -0
  95. package/dist/lint/post-synth/index.d.ts.map +1 -1
  96. package/dist/lint/post-synth/index.js +2 -0
  97. package/dist/lint/post-synth/sqlch128.d.ts +18 -0
  98. package/dist/lint/post-synth/sqlch128.d.ts.map +1 -0
  99. package/dist/lint/post-synth/sqlch128.js +222 -0
  100. package/dist/lint/rules/postgres-templates.js +2 -2
  101. package/dist/lsp/postgres-template.d.ts.map +1 -1
  102. package/dist/lsp/postgres-template.js +11 -0
  103. package/dist/manifest.json +1 -1
  104. package/dist/mcp/postgres.js +1 -1
  105. package/dist/meta.json +25 -0
  106. package/dist/migrate/from-postgres/detect.d.ts +4 -0
  107. package/dist/migrate/from-postgres/detect.d.ts.map +1 -0
  108. package/dist/migrate/from-postgres/detect.js +7 -0
  109. package/dist/migrate/from-postgres/emit.d.ts +26 -0
  110. package/dist/migrate/from-postgres/emit.d.ts.map +1 -0
  111. package/dist/migrate/from-postgres/emit.js +86 -0
  112. package/dist/migrate/from-postgres/index.d.ts +51 -0
  113. package/dist/migrate/from-postgres/index.d.ts.map +1 -0
  114. package/dist/migrate/from-postgres/index.js +115 -0
  115. package/dist/migrate/from-postgres/translate.d.ts +73 -0
  116. package/dist/migrate/from-postgres/translate.d.ts.map +1 -0
  117. package/dist/migrate/from-postgres/translate.js +261 -0
  118. package/dist/migrate/from-postgres/types.d.ts +51 -0
  119. package/dist/migrate/from-postgres/types.d.ts.map +1 -0
  120. package/dist/migrate/from-postgres/types.js +211 -0
  121. package/dist/migration-replay.d.ts +73 -0
  122. package/dist/migration-replay.d.ts.map +1 -0
  123. package/dist/migration-replay.js +294 -0
  124. package/dist/okf/index.md +6 -0
  125. package/dist/okf/rules/SQLCH128.md +11 -0
  126. package/dist/okf/types/PostgresForeignDataWrapper.md +9 -0
  127. package/dist/okf/types/PostgresForeignServer.md +9 -0
  128. package/dist/okf/types/PostgresOperator.md +9 -0
  129. package/dist/okf/types/PostgresPublication.md +9 -0
  130. package/dist/okf/types/PostgresStatistics.md +9 -0
  131. package/dist/op/activities/postgres-migration.d.ts.map +1 -1
  132. package/dist/op/activities/postgres-migration.js +4 -0
  133. package/dist/op/activity-contracts.d.ts +20 -0
  134. package/dist/op/activity-contracts.d.ts.map +1 -1
  135. package/dist/op/activity-contracts.js +2 -0
  136. package/dist/plugin.d.ts.map +1 -1
  137. package/dist/plugin.js +36 -2
  138. package/dist/postgres/apply/apply.js +8 -1
  139. package/dist/postgres/apply/statements.d.ts.map +1 -1
  140. package/dist/postgres/apply/statements.js +87 -2
  141. package/dist/postgres/constraint-names.d.ts +30 -0
  142. package/dist/postgres/constraint-names.d.ts.map +1 -0
  143. package/dist/postgres/constraint-names.js +72 -0
  144. package/dist/postgres/entities.d.ts +110 -1
  145. package/dist/postgres/entities.d.ts.map +1 -1
  146. package/dist/postgres/entities.js +146 -0
  147. package/dist/postgres/entity-types.d.ts +5 -0
  148. package/dist/postgres/entity-types.d.ts.map +1 -1
  149. package/dist/postgres/entity-types.js +5 -0
  150. package/dist/postgres/import/generator.d.ts.map +1 -1
  151. package/dist/postgres/import/generator.js +50 -2
  152. package/dist/postgres/import/live-export.d.ts.map +1 -1
  153. package/dist/postgres/import/live-export.js +2 -0
  154. package/dist/postgres/live/catalog-kinds.d.ts +14 -0
  155. package/dist/postgres/live/catalog-kinds.d.ts.map +1 -1
  156. package/dist/postgres/live/catalog-kinds.js +206 -0
  157. package/dist/postgres/live/catalog.d.ts +2 -0
  158. package/dist/postgres/live/catalog.d.ts.map +1 -1
  159. package/dist/postgres/live/catalog.js +3 -1
  160. package/dist/postgres/live/describe-resources.d.ts.map +1 -1
  161. package/dist/postgres/live/describe-resources.js +10 -2
  162. package/dist/postgres/migrate/backfill.d.ts +2 -0
  163. package/dist/postgres/migrate/backfill.d.ts.map +1 -1
  164. package/dist/postgres/migrate/backfill.js +7 -1
  165. package/dist/postgres/migrate/carry.d.ts +45 -1
  166. package/dist/postgres/migrate/carry.d.ts.map +1 -1
  167. package/dist/postgres/migrate/carry.js +72 -8
  168. package/dist/postgres/migrate/observe.d.ts +28 -4
  169. package/dist/postgres/migrate/observe.d.ts.map +1 -1
  170. package/dist/postgres/migrate/observe.js +41 -12
  171. package/dist/postgres/migrate/op.d.ts +26 -1
  172. package/dist/postgres/migrate/op.d.ts.map +1 -1
  173. package/dist/postgres/migrate/op.js +3 -1
  174. package/dist/postgres/migrate/steps.d.ts +35 -2
  175. package/dist/postgres/migrate/steps.d.ts.map +1 -1
  176. package/dist/postgres/migrate/steps.js +158 -12
  177. package/dist/postgres/parser.d.ts +72 -1
  178. package/dist/postgres/parser.d.ts.map +1 -1
  179. package/dist/postgres/parser.js +194 -2
  180. package/dist/postgres/plan/deep.d.ts.map +1 -1
  181. package/dist/postgres/plan/deep.js +29 -1
  182. package/dist/postgres/plan/diff.d.ts.map +1 -1
  183. package/dist/postgres/plan/diff.js +39 -1
  184. package/dist/postgres/plan/normalize.d.ts +17 -2
  185. package/dist/postgres/plan/normalize.d.ts.map +1 -1
  186. package/dist/postgres/plan/normalize.js +109 -1
  187. package/dist/postgres/plan/rules.d.ts +1 -0
  188. package/dist/postgres/plan/rules.d.ts.map +1 -1
  189. package/dist/postgres/plan/rules.js +3 -2
  190. package/dist/postgres/plan/schema.js +1 -1
  191. package/dist/postgres/secret-options.d.ts +10 -0
  192. package/dist/postgres/secret-options.d.ts.map +1 -0
  193. package/dist/postgres/secret-options.js +9 -0
  194. package/dist/postgres/testing/roundtrip-schema.d.ts +3 -2
  195. package/dist/postgres/testing/roundtrip-schema.d.ts.map +1 -1
  196. package/dist/postgres/testing/roundtrip-schema.js +13 -1
  197. package/dist/postgres.d.ts +1 -1
  198. package/dist/postgres.d.ts.map +1 -1
  199. package/dist/postgres.js +1 -1
  200. package/dist/rules/audit-entries.ts +1 -0
  201. package/dist/rules/postgres-templates.ts +2 -2
  202. package/dist/rules/sqlch128.ts +230 -0
  203. package/dist/serializer.d.ts +5 -0
  204. package/dist/serializer.d.ts.map +1 -1
  205. package/dist/serializer.js +13 -2
  206. package/dist/sql-types-command.d.ts +13 -0
  207. package/dist/sql-types-command.d.ts.map +1 -1
  208. package/dist/sql-types-command.js +31 -16
  209. package/dist/sql-types.d.ts +22 -0
  210. package/dist/sql-types.d.ts.map +1 -1
  211. package/dist/sql-types.js +10 -6
  212. package/dist/sqlserver/lexer.d.ts +37 -0
  213. package/dist/sqlserver/lexer.d.ts.map +1 -0
  214. package/dist/sqlserver/lexer.js +254 -0
  215. package/dist/sqlserver/parse.d.ts +185 -0
  216. package/dist/sqlserver/parse.d.ts.map +1 -0
  217. package/dist/sqlserver/parse.js +767 -0
  218. package/dist/sqlserver/translate.d.ts +34 -0
  219. package/dist/sqlserver/translate.d.ts.map +1 -0
  220. package/dist/sqlserver/translate.js +495 -0
  221. package/dist/sqlserver/types.d.ts +44 -0
  222. package/dist/sqlserver/types.d.ts.map +1 -0
  223. package/dist/sqlserver/types.js +133 -0
  224. package/dist/sqlserver/validate.d.ts +31 -0
  225. package/dist/sqlserver/validate.d.ts.map +1 -0
  226. package/dist/sqlserver/validate.js +67 -0
  227. package/dist/validate.d.ts.map +1 -1
  228. package/dist/validate.js +5 -0
  229. package/package.json +2 -2
  230. package/src/change-set.ts +2 -1
  231. package/src/clickhouse/apply/statements.ts +25 -0
  232. package/src/clickhouse/import/live-export.ts +20 -5
  233. package/src/clickhouse/live/named-collections.e2e.test.ts +88 -0
  234. package/src/clickhouse/live/named-collections.ts +61 -0
  235. package/src/clickhouse/live/undeclarable.e2e.test.ts +5 -3
  236. package/src/clickhouse/live/undeclarable.ts +20 -4
  237. package/src/clickhouse/named-collections.test.ts +187 -0
  238. package/src/clickhouse/named-collections.ts +224 -0
  239. package/src/clickhouse/parser.ts +2 -1
  240. package/src/clickhouse/plan/commands.ts +17 -2
  241. package/src/clickhouse/plan/diff.ts +57 -1
  242. package/src/clickhouse/plan/disruption.ts +5 -0
  243. package/src/clickhouse/plan/rebuild-handoff.ts +3 -0
  244. package/src/clickhouse/plan/report.ts +6 -1
  245. package/src/clickhouse/plan/rules.ts +14 -4
  246. package/src/clickhouse/plan/stream-s3queue.e2e.test.ts +148 -0
  247. package/src/clickhouse/plan/stream.test.ts +237 -0
  248. package/src/clickhouse/plan/stream.ts +111 -0
  249. package/src/clickhouse/rebuild/observe.ts +15 -1
  250. package/src/clickhouse/review-catalog.test.ts +181 -0
  251. package/src/clickhouse/review-catalog.ts +489 -0
  252. package/src/codegen/classifier-page.ts +21 -4
  253. package/src/codegen/clickhouse-module.ts +3 -0
  254. package/src/codegen/coverage-page.ts +5 -3
  255. package/src/codegen/docs.ts +1 -1
  256. package/src/codegen/postgres-classifier-page.ts +1 -1
  257. package/src/codegen/registry.ts +5 -0
  258. package/src/composites/catalog.test.ts +6 -1
  259. package/src/composites/catalog.ts +100 -0
  260. package/src/composites/clickhouse.ts +2 -0
  261. package/src/composites/composites.test.ts +1 -1
  262. package/src/composites/otel-tables.test.ts +118 -0
  263. package/src/composites/otel-tables.ts +339 -0
  264. package/src/composites/stream-ingest.test.ts +114 -0
  265. package/src/composites/stream-ingest.ts +82 -0
  266. package/src/core/undeclarable.test.ts +6 -5
  267. package/src/coverage/clickhouse.json +1 -1
  268. package/src/coverage/postgres.json +7 -7
  269. package/src/coverage.test.ts +27 -2
  270. package/src/coverage.ts +18 -7
  271. package/src/drizzle-command.ts +94 -0
  272. package/src/drizzle-kit.e2e.test.ts +89 -0
  273. package/src/drizzle-types.e2e.test.ts +67 -0
  274. package/src/drizzle.test.ts +358 -0
  275. package/src/drizzle.ts +737 -0
  276. package/src/files/clickhouse.ts +8 -1
  277. package/src/files/common.ts +14 -1
  278. package/src/files/postgres.ts +12 -2
  279. package/src/generated/clickhouse.ts +3 -0
  280. package/src/generated/lexicon-sql.json +25 -0
  281. package/src/import-parser.sqlserver.test.ts +92 -0
  282. package/src/import-parser.ts +79 -5
  283. package/src/index.ts +1 -1
  284. package/src/lint/post-synth/audit-entries.ts +1 -0
  285. package/src/lint/post-synth/index.ts +2 -0
  286. package/src/lint/post-synth/sqlch128.test.ts +107 -0
  287. package/src/lint/post-synth/sqlch128.ts +230 -0
  288. package/src/lint/rules/postgres-templates.ts +2 -2
  289. package/src/lsp/postgres-template.ts +11 -0
  290. package/src/mcp/postgres.ts +1 -1
  291. package/src/migrate/from-postgres/cli.test.ts +165 -0
  292. package/src/migrate/from-postgres/detect.ts +7 -0
  293. package/src/migrate/from-postgres/emit.ts +96 -0
  294. package/src/migrate/from-postgres/example.test.ts +205 -0
  295. package/src/migrate/from-postgres/index.ts +122 -0
  296. package/src/migrate/from-postgres/translate.test.ts +242 -0
  297. package/src/migrate/from-postgres/translate.ts +359 -0
  298. package/src/migrate/from-postgres/types.test.ts +116 -0
  299. package/src/migrate/from-postgres/types.ts +236 -0
  300. package/src/migrate/from-postgres/validate.e2e.test.ts +44 -0
  301. package/src/migrate/from-postgres/workspace.e2e.test.ts +114 -0
  302. package/src/migration-replay.e2e.test.ts +155 -0
  303. package/src/migration-replay.test.ts +173 -0
  304. package/src/migration-replay.ts +289 -0
  305. package/src/op/__snapshots__/watch-pipeline.test.ts.snap +2 -2
  306. package/src/op/activities/postgres-migration.ts +4 -0
  307. package/src/op/activity-contracts.ts +2 -0
  308. package/src/plugin.ts +37 -2
  309. package/src/postgres/apply/apply.ts +9 -1
  310. package/src/postgres/apply/statements.ts +74 -1
  311. package/src/postgres/constraint-names.ts +71 -0
  312. package/src/postgres/database-kinds.test.ts +384 -0
  313. package/src/postgres/entities.ts +266 -1
  314. package/src/postgres/entity-types.ts +5 -0
  315. package/src/postgres/import/generator.ts +42 -2
  316. package/src/postgres/import/live-export.ts +1 -0
  317. package/src/postgres/live/catalog-kinds.ts +223 -0
  318. package/src/postgres/live/catalog.ts +6 -1
  319. package/src/postgres/live/database-kinds.e2e.test.ts +164 -0
  320. package/src/postgres/live/describe-resources.ts +11 -2
  321. package/src/postgres/live/undeclarable.e2e.test.ts +13 -6
  322. package/src/postgres/migrate/backfill.ts +13 -1
  323. package/src/postgres/migrate/carry.ts +103 -8
  324. package/src/postgres/migrate/followups.e2e.test.ts +218 -0
  325. package/src/postgres/migrate/followups.test.ts +199 -0
  326. package/src/postgres/migrate/kinds.e2e.test.ts +5 -5
  327. package/src/postgres/migrate/observe.ts +53 -14
  328. package/src/postgres/migrate/op.ts +28 -1
  329. package/src/postgres/migrate/partition.e2e.test.ts +129 -0
  330. package/src/postgres/migrate/partition.test.ts +206 -0
  331. package/src/postgres/migrate/steps.ts +157 -12
  332. package/src/postgres/parser.ts +234 -2
  333. package/src/postgres/plan/deep.ts +28 -1
  334. package/src/postgres/plan/diff.ts +36 -1
  335. package/src/postgres/plan/normalize.ts +122 -1
  336. package/src/postgres/plan/rules.ts +10 -3
  337. package/src/postgres/plan/schema.ts +1 -1
  338. package/src/postgres/secret-options.ts +10 -0
  339. package/src/postgres/testing/roundtrip-schema.ts +13 -1
  340. package/src/postgres.ts +16 -0
  341. package/src/serializer.ts +13 -2
  342. package/src/skills/chant-sql-postgres-migration.md +3 -3
  343. package/src/skills/chant-sql-postgres.md +6 -1
  344. package/src/skills/chant-sql.md +2 -1
  345. package/src/sql-types-command.ts +38 -16
  346. package/src/sql-types.ts +11 -6
  347. package/src/sqlserver/fixture.test.ts +186 -0
  348. package/src/sqlserver/import-cli.test.ts +61 -0
  349. package/src/sqlserver/lexer.ts +260 -0
  350. package/src/sqlserver/parse.ts +865 -0
  351. package/src/sqlserver/translate.test.ts +396 -0
  352. package/src/sqlserver/translate.ts +558 -0
  353. package/src/sqlserver/types.test.ts +102 -0
  354. package/src/sqlserver/types.ts +154 -0
  355. package/src/sqlserver/validate.e2e.test.ts +32 -0
  356. package/src/sqlserver/validate.test.ts +49 -0
  357. package/src/sqlserver/validate.ts +76 -0
  358. package/src/validate.ts +5 -0
  359. package/src/workspace-kinds.test.ts +11 -0
  360. package/workspace-kinds.json +100 -2
package/dist/sql-types.js CHANGED
@@ -90,14 +90,14 @@ function originOf(entity, exportName, projectDir) {
90
90
  return `${file ? posix(file) : "?"}: ${exportName}${composite}`;
91
91
  }
92
92
  /** The names a relation's `.columns` record holds at run time, in order. */
93
- const runtimeColumns = (entity) => Object.keys(entity?.columns ?? {});
93
+ export const runtimeColumns = (entity) => Object.keys(entity?.columns ?? {});
94
94
  /** Whether `expr` is the column `column` alone, bare or qualified (`o.user_id`). */
95
95
  function isBareColumn(expr, quoted) {
96
96
  const unqualified = expr.trim().replace(/^(?:"(?:[^"]|"")+"|`(?:[^`]|``)+`|[A-Za-z_][\w$]*)\./, "");
97
97
  return unqualified === quoted;
98
98
  }
99
99
  /** A view's column that passes one column through: that column's export and name. */
100
- function passthrough(o, name, quote) {
100
+ export function passthrough(o, name, quote) {
101
101
  const edge = (o.lineage ?? []).find((e) => e.output === name);
102
102
  const ref = edge?.from.length === 1 ? edge.from[0] : undefined;
103
103
  if (!edge || !ref)
@@ -124,7 +124,7 @@ function spell(canonical, t) {
124
124
  }
125
125
  const arrayOf = (ts) => `${/[|&]/.test(ts) && !/^\{.*\}$/s.test(ts) ? `(${ts})` : ts}[]`;
126
126
  /** A Postgres type's spelling, row type, and whether the type itself forbids NULL (a serial, a NOT NULL domain). */
127
- function pgType(p, text, depth = 0) {
127
+ export function pgType(p, text, depth = 0) {
128
128
  const t = parseType(text);
129
129
  if (!t || depth > 5)
130
130
  return { sqlType: text?.trim() || "unknown", ts: "unknown", notNull: false };
@@ -268,7 +268,7 @@ function renderEntry(e, lines) {
268
268
  lines.push(" };");
269
269
  }
270
270
  /** The dialect a build's entities declare, else the config's, else ClickHouse. */
271
- function dialectOf(entities, config) {
271
+ export function dialectOf(entities, config) {
272
272
  try {
273
273
  return filesDialect(entities, config);
274
274
  }
@@ -276,6 +276,11 @@ function dialectOf(entities, config) {
276
276
  return "clickhouse";
277
277
  }
278
278
  }
279
+ /** The build's sql output as `chant build` writes it: the objects, and the Postgres major they were built for. */
280
+ export function serializedObjects(entities, config) {
281
+ const out = sqlSerializer.serialize(new Map(entities), undefined, { config });
282
+ return JSON.parse(typeof out === "string" ? out : out.primary);
283
+ }
279
284
  /**
280
285
  * The `sql-types.d.ts` for a build's entities: one module that augments the
281
286
  * dialect's `SqlSchema` with each table, view and dictionary, in key order.
@@ -288,8 +293,7 @@ export function renderSqlTypes(entities, opts = {}) {
288
293
  const sqlEntities = new Map([...entities].filter(([, e]) => isPostgresObject(e) || isClickHouseObject(e)));
289
294
  let entries = [];
290
295
  if (sqlEntities.size > 0) {
291
- const out = sqlSerializer.serialize(new Map(entities), undefined, { config });
292
- const doc = JSON.parse(typeof out === "string" ? out : out.primary);
296
+ const doc = serializedObjects(entities, config);
293
297
  entries = dialect === "postgres" ? postgresEntries(doc.objects, doc.postgresMajor ?? PINNED_MAJOR, entities, projectDir) : clickhouseEntries(doc.objects, entities, projectDir);
294
298
  }
295
299
  const byKey = new Map();
@@ -0,0 +1,37 @@
1
+ /**
2
+ * A T-SQL tokenizer for the statements `chant import` reads from SQL Server.
3
+ *
4
+ * T-SQL differs from the lexers the other dialects use in four places: an
5
+ * identifier can be `[bracketed]` (a `]` inside is written `]]`) or
6
+ * "double quoted", a string can carry an `N` prefix, a line holding only `GO`
7
+ * ends a batch (it is a client command, not a statement), and statements need
8
+ * no terminating `;`. Comments (`--` and nestable `/* *\/`) are dropped; each
9
+ * token keeps its 1-based line and column in the source.
10
+ */
11
+ export type TokenKind = "word" | "qident" | "string" | "number" | "variable" | "punct" | "go";
12
+ export interface Token {
13
+ kind: TokenKind;
14
+ /** As written: a `qident` keeps its brackets; a string its quotes. */
15
+ text: string;
16
+ /** A `qident`'s name, a string's value, a word's text. */
17
+ value: string;
18
+ line: number;
19
+ column: number;
20
+ /** Offset of the first character. */
21
+ start: number;
22
+ /** Offset after the last. */
23
+ end: number;
24
+ }
25
+ export declare class TsqlLexError extends Error {
26
+ readonly line: number;
27
+ readonly column: number;
28
+ constructor(message: string, line: number, column: number);
29
+ }
30
+ /** Tokenize a file. A `GO` on a line of its own (optionally with a count) becomes one `go` token. */
31
+ export declare function tokenize(text: string): Token[];
32
+ /** Tokens split into batches at `go` tokens; empty batches are dropped. */
33
+ export declare function batches(tokens: readonly Token[]): Token[][];
34
+ export declare const upper: (t: Token | undefined) => string;
35
+ /** The source text of a run of tokens, from the first token's start to the last token's end. */
36
+ export declare function sourceOf(text: string, tokens: readonly Token[]): string;
37
+ //# sourceMappingURL=lexer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lexer.d.ts","sourceRoot":"","sources":["../../src/sqlserver/lexer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,OAAO,GAAG,IAAI,CAAC;AAE9F,MAAM,WAAW,KAAK;IACpB,IAAI,EAAE,SAAS,CAAC;IAChB,sEAAsE;IACtE,IAAI,EAAE,MAAM,CAAC;IACb,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,qCAAqC;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,6BAA6B;IAC7B,GAAG,EAAE,MAAM,CAAC;CACb;AAED,qBAAa,YAAa,SAAQ,KAAK;IAGnC,QAAQ,CAAC,IAAI,EAAE,MAAM;IACrB,QAAQ,CAAC,MAAM,EAAE,MAAM;gBAFvB,OAAO,EAAE,MAAM,EACN,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM;CAK1B;AAKD,qGAAqG;AACrG,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,EAAE,CA4K9C;AAyBD,2EAA2E;AAC3E,wBAAgB,OAAO,CAAC,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,CAW3D;AAED,eAAO,MAAM,KAAK,GAAI,GAAG,KAAK,GAAG,SAAS,KAAG,MAA+D,CAAC;AAE7G,gGAAgG;AAChG,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,KAAK,EAAE,GAAG,MAAM,CAGvE"}
@@ -0,0 +1,254 @@
1
+ /**
2
+ * A T-SQL tokenizer for the statements `chant import` reads from SQL Server.
3
+ *
4
+ * T-SQL differs from the lexers the other dialects use in four places: an
5
+ * identifier can be `[bracketed]` (a `]` inside is written `]]`) or
6
+ * "double quoted", a string can carry an `N` prefix, a line holding only `GO`
7
+ * ends a batch (it is a client command, not a statement), and statements need
8
+ * no terminating `;`. Comments (`--` and nestable `/* *\/`) are dropped; each
9
+ * token keeps its 1-based line and column in the source.
10
+ */
11
+ export class TsqlLexError extends Error {
12
+ constructor(message, line, column) {
13
+ super(`${message} (line ${String(line)}, column ${String(column)})`);
14
+ this.line = line;
15
+ this.column = column;
16
+ this.name = "TsqlLexError";
17
+ }
18
+ }
19
+ const WORD_START = /[A-Za-z_#@\u0080-￿]/;
20
+ const WORD_PART = /[A-Za-z0-9_#$@\u0080-￿]/;
21
+ /** Tokenize a file. A `GO` on a line of its own (optionally with a count) becomes one `go` token. */
22
+ export function tokenize(text) {
23
+ const tokens = [];
24
+ let i = 0;
25
+ let line = 1;
26
+ let lineStart = 0;
27
+ const n = text.length;
28
+ // A byte order mark starts files saved by SSMS and Visual Studio.
29
+ if (text.charCodeAt(0) === 0xfeff) {
30
+ i = 1;
31
+ lineStart = 1;
32
+ }
33
+ const push = (kind, start, end, value, startLine, startCol) => tokens.push({ kind, text: text.slice(start, end), value, line: startLine, column: startCol, start, end });
34
+ while (i < n) {
35
+ const c = text[i];
36
+ if (c === "\n") {
37
+ line++;
38
+ i++;
39
+ lineStart = i;
40
+ continue;
41
+ }
42
+ if (/\s/.test(c)) {
43
+ i++;
44
+ continue;
45
+ }
46
+ const col = i - lineStart + 1;
47
+ if (c === "-" && text[i + 1] === "-") {
48
+ while (i < n && text[i] !== "\n")
49
+ i++;
50
+ continue;
51
+ }
52
+ if (c === "/" && text[i + 1] === "*") {
53
+ let depth = 1;
54
+ const startLine = line;
55
+ const startCol = col;
56
+ i += 2;
57
+ while (i < n && depth > 0) {
58
+ if (text[i] === "/" && text[i + 1] === "*") {
59
+ depth++;
60
+ i += 2;
61
+ }
62
+ else if (text[i] === "*" && text[i + 1] === "/") {
63
+ depth--;
64
+ i += 2;
65
+ }
66
+ else {
67
+ if (text[i] === "\n") {
68
+ line++;
69
+ lineStart = i + 1;
70
+ }
71
+ i++;
72
+ }
73
+ }
74
+ if (depth > 0)
75
+ throw new TsqlLexError("unterminated /* comment", startLine, startCol);
76
+ continue;
77
+ }
78
+ if (c === "[") {
79
+ const start = i;
80
+ let value = "";
81
+ i++;
82
+ for (;;) {
83
+ if (i >= n)
84
+ throw new TsqlLexError("unterminated [identifier]", line, col);
85
+ if (text[i] === "]") {
86
+ if (text[i + 1] === "]") {
87
+ value += "]";
88
+ i += 2;
89
+ continue;
90
+ }
91
+ i++;
92
+ break;
93
+ }
94
+ if (text[i] === "\n") {
95
+ line++;
96
+ lineStart = i + 1;
97
+ }
98
+ value += text[i];
99
+ i++;
100
+ }
101
+ push("qident", start, i, value, line, col);
102
+ continue;
103
+ }
104
+ if (c === '"') {
105
+ const start = i;
106
+ let value = "";
107
+ i++;
108
+ for (;;) {
109
+ if (i >= n)
110
+ throw new TsqlLexError('unterminated "identifier"', line, col);
111
+ if (text[i] === '"') {
112
+ if (text[i + 1] === '"') {
113
+ value += '"';
114
+ i += 2;
115
+ continue;
116
+ }
117
+ i++;
118
+ break;
119
+ }
120
+ value += text[i];
121
+ i++;
122
+ }
123
+ push("qident", start, i, value, line, col);
124
+ continue;
125
+ }
126
+ if (c === "'" || ((c === "N" || c === "n") && text[i + 1] === "'")) {
127
+ const start = i;
128
+ const startLine = line;
129
+ if (c !== "'")
130
+ i++;
131
+ i++;
132
+ let value = "";
133
+ for (;;) {
134
+ if (i >= n)
135
+ throw new TsqlLexError("unterminated string", startLine, col);
136
+ if (text[i] === "'") {
137
+ if (text[i + 1] === "'") {
138
+ value += "'";
139
+ i += 2;
140
+ continue;
141
+ }
142
+ i++;
143
+ break;
144
+ }
145
+ if (text[i] === "\n") {
146
+ line++;
147
+ lineStart = i + 1;
148
+ }
149
+ value += text[i];
150
+ i++;
151
+ }
152
+ push("string", start, i, value, startLine, col);
153
+ continue;
154
+ }
155
+ if (/[0-9]/.test(c) || (c === "." && /[0-9]/.test(text[i + 1] ?? ""))) {
156
+ const start = i;
157
+ if (c === "0" && (text[i + 1] === "x" || text[i + 1] === "X")) {
158
+ i += 2;
159
+ while (i < n && /[0-9A-Fa-f]/.test(text[i]))
160
+ i++;
161
+ }
162
+ else {
163
+ while (i < n && /[0-9]/.test(text[i]))
164
+ i++;
165
+ if (text[i] === ".") {
166
+ i++;
167
+ while (i < n && /[0-9]/.test(text[i]))
168
+ i++;
169
+ }
170
+ if ((text[i] === "e" || text[i] === "E") && /[0-9+-]/.test(text[i + 1] ?? "")) {
171
+ i += 2;
172
+ while (i < n && /[0-9]/.test(text[i]))
173
+ i++;
174
+ }
175
+ }
176
+ push("number", start, i, text.slice(start, i), line, col);
177
+ continue;
178
+ }
179
+ if (c === "@" && text[i + 1] !== undefined && WORD_PART.test(text[i + 1])) {
180
+ const start = i;
181
+ i++;
182
+ while (i < n && WORD_PART.test(text[i]))
183
+ i++;
184
+ push("variable", start, i, text.slice(start, i), line, col);
185
+ continue;
186
+ }
187
+ if (WORD_START.test(c)) {
188
+ const start = i;
189
+ i++;
190
+ while (i < n && WORD_PART.test(text[i]))
191
+ i++;
192
+ const word = text.slice(start, i);
193
+ push("word", start, i, word, line, col);
194
+ continue;
195
+ }
196
+ // Two-character operators are one token so a `<>` is not a `<` and a `>`.
197
+ const two = text.slice(i, i + 2);
198
+ if (["<>", ">=", "<=", "!=", "+=", "-=", "*=", "/=", "||", "::"].includes(two)) {
199
+ push("punct", i, i + 2, two, line, col);
200
+ i += 2;
201
+ continue;
202
+ }
203
+ push("punct", i, i + 1, c, line, col);
204
+ i++;
205
+ }
206
+ return markBatchSeparators(tokens, text);
207
+ }
208
+ /** `GO` alone on its line (or `GO 5`) is a separator, not a word. */
209
+ function markBatchSeparators(tokens, text) {
210
+ const out = [];
211
+ for (let k = 0; k < tokens.length; k++) {
212
+ const t = tokens[k];
213
+ if (t.kind === "word" && t.value.toUpperCase() === "GO") {
214
+ const prev = tokens[k - 1];
215
+ const next = tokens[k + 1];
216
+ const alone = (a) => a === undefined || a.line !== t.line;
217
+ const count = next && next.kind === "number" && next.line === t.line ? next : undefined;
218
+ const after = count ? tokens[k + 2] : next;
219
+ // The line before `GO` ends the earlier statement, and a `GO` mid-line is a name.
220
+ if (alone(prev) && alone(after) && !/[A-Za-z0-9_]/.test(text.slice(t.end, t.end + 1))) {
221
+ out.push({ ...t, kind: "go" });
222
+ if (count)
223
+ k++;
224
+ continue;
225
+ }
226
+ }
227
+ out.push(t);
228
+ }
229
+ return out;
230
+ }
231
+ /** Tokens split into batches at `go` tokens; empty batches are dropped. */
232
+ export function batches(tokens) {
233
+ const out = [];
234
+ let cur = [];
235
+ for (const t of tokens) {
236
+ if (t.kind === "go") {
237
+ if (cur.length > 0)
238
+ out.push(cur);
239
+ cur = [];
240
+ }
241
+ else
242
+ cur.push(t);
243
+ }
244
+ if (cur.length > 0)
245
+ out.push(cur);
246
+ return out;
247
+ }
248
+ export const upper = (t) => (t && t.kind === "word" ? t.value.toUpperCase() : "");
249
+ /** The source text of a run of tokens, from the first token's start to the last token's end. */
250
+ export function sourceOf(text, tokens) {
251
+ if (tokens.length === 0)
252
+ return "";
253
+ return text.slice(tokens[0].start, tokens[tokens.length - 1].end);
254
+ }
@@ -0,0 +1,185 @@
1
+ /**
2
+ * T-SQL DDL into a syntax tree: `CREATE TABLE`, `CREATE [UNIQUE] [CLUSTERED |
3
+ * NONCLUSTERED] INDEX`, `CREATE [CLUSTERED | NONCLUSTERED] COLUMNSTORE
4
+ * INDEX ... [ORDER (...)]`, `CREATE VIEW`, `CREATE SCHEMA`, `ALTER TABLE ...
5
+ * ADD CONSTRAINT`, and `sp_addextendedproperty` descriptions.
6
+ *
7
+ * Grammar sources (Microsoft Learn, Transact-SQL reference):
8
+ * - CREATE TABLE: https://learn.microsoft.com/en-us/sql/t-sql/statements/create-table-transact-sql
9
+ * - CREATE INDEX: https://learn.microsoft.com/en-us/sql/t-sql/statements/create-index-transact-sql
10
+ * - CREATE COLUMNSTORE INDEX (the `ORDER (column [, ...n])` clause, which the
11
+ * SQL Server grammar places before or after `WITH`):
12
+ * https://learn.microsoft.com/en-us/sql/t-sql/statements/create-columnstore-index-transact-sql
13
+ *
14
+ * Every statement that is not one of these comes back as `refused` (a kind of
15
+ * object this source cannot read, named: `trigger [dbo].[trg_audit]`) or
16
+ * `ignored` (a session setting or a `DROP`, which declares nothing). Nothing
17
+ * is dropped without being returned.
18
+ */
19
+ import { type Token } from "./lexer.js";
20
+ export interface Loc {
21
+ line: number;
22
+ column: number;
23
+ }
24
+ /** A multi-part name, unquoted: `[Sales].[Orders]` is `["Sales", "Orders"]`. */
25
+ export interface QName {
26
+ parts: string[];
27
+ loc: Loc;
28
+ }
29
+ export interface KeyColumn {
30
+ name: string;
31
+ descending: boolean;
32
+ }
33
+ export type ConstraintKind = "primary-key" | "unique" | "foreign-key" | "check" | "default";
34
+ export interface ConstraintAst {
35
+ kind: ConstraintKind;
36
+ name?: string;
37
+ /** `CLUSTERED` or `NONCLUSTERED` when written. */
38
+ clustered?: boolean;
39
+ columns: KeyColumn[];
40
+ references?: {
41
+ table: QName;
42
+ columns: string[];
43
+ };
44
+ /** A check's or a default's expression, as written (outer parentheses kept). */
45
+ expression?: string;
46
+ expressionTokens?: Token[];
47
+ /** The column a column-level constraint was written on; the default's column. */
48
+ onColumn?: string;
49
+ /** `WITH (...)` or `ON ...` text after the key, which the translation names but does not carry. */
50
+ options: string[];
51
+ loc: Loc;
52
+ }
53
+ export interface ColumnAst {
54
+ name: string;
55
+ loc: Loc;
56
+ /** Lower-cased type name; `sysname` and alias types appear as written. */
57
+ type?: string;
58
+ /** Qualified type (`[dbo].[Flag]`) when the name has a schema. */
59
+ typeSchema?: string;
60
+ /** `max` is `"max"`. */
61
+ typeArgs: Array<number | "max">;
62
+ nullable?: boolean;
63
+ identity?: {
64
+ seed: string;
65
+ increment: string;
66
+ };
67
+ /** `AS (expr) [PERSISTED]` and no type. */
68
+ computed?: {
69
+ expression: string;
70
+ persisted: boolean;
71
+ };
72
+ /** `GENERATED ALWAYS AS ROW START | END | TRANSACTION_ID_* ...` as written. */
73
+ generated?: string;
74
+ collate?: string;
75
+ rowguid: boolean;
76
+ sparse: boolean;
77
+ /** Other column options carried as text and named in the review: `MASKED WITH`, `ENCRYPTED WITH`, `FILESTREAM`, `NOT FOR REPLICATION`. */
78
+ extras: string[];
79
+ }
80
+ export interface TableAst {
81
+ kind: "table";
82
+ name: QName;
83
+ columns: ColumnAst[];
84
+ constraints: ConstraintAst[];
85
+ /** `INDEX name [UNIQUE] [CLUSTERED|NONCLUSTERED] (cols)` inside the table. */
86
+ indexes: IndexAst[];
87
+ /** `PERIOD FOR SYSTEM_TIME (a, b)`. */
88
+ period?: {
89
+ start: string;
90
+ end: string;
91
+ };
92
+ /** Text of each clause after the column list: `WITH (...)`, `ON [PRIMARY]`, `TEXTIMAGE_ON ...`. */
93
+ options: string[];
94
+ /** `AS FileTable` / `AS NODE` / `AS EDGE`. */
95
+ asKind?: string;
96
+ loc: Loc;
97
+ }
98
+ export interface IndexAst {
99
+ kind: "index";
100
+ name: string;
101
+ /** Absent for an index written inside `CREATE TABLE`. */
102
+ table?: QName;
103
+ unique: boolean;
104
+ clustered: boolean;
105
+ columnstore: boolean;
106
+ columns: KeyColumn[];
107
+ include: string[];
108
+ /** The columnstore `ORDER (...)` columns. */
109
+ order: string[];
110
+ where?: string;
111
+ options: string[];
112
+ loc: Loc;
113
+ }
114
+ export interface ViewAst {
115
+ kind: "view";
116
+ name: QName;
117
+ columns: string[];
118
+ /** `WITH SCHEMABINDING, ...` */
119
+ options: string[];
120
+ /** The SELECT, as written, without the trailing `;`. */
121
+ body: string;
122
+ bodyTokens: Token[];
123
+ loc: Loc;
124
+ }
125
+ export interface SchemaAst {
126
+ kind: "schema";
127
+ name: string;
128
+ loc: Loc;
129
+ }
130
+ export interface AlterConstraintAst {
131
+ kind: "alter-constraint";
132
+ table: QName;
133
+ constraint: ConstraintAst;
134
+ loc: Loc;
135
+ }
136
+ export interface ExtendedPropertyAst {
137
+ kind: "extended-property";
138
+ /** `description` or the property's name. */
139
+ property: string;
140
+ value: string;
141
+ schema?: string;
142
+ table?: string;
143
+ column?: string;
144
+ /** `INDEX`, `CONSTRAINT`, `VIEW`, ... when level 2 is not a column. */
145
+ level2?: {
146
+ type: string;
147
+ name: string;
148
+ };
149
+ level1Type?: string;
150
+ loc: Loc;
151
+ }
152
+ export interface RefusedAst {
153
+ kind: "refused";
154
+ /** `trigger`, `procedure`, `function`, ... */
155
+ objectKind: string;
156
+ name: string;
157
+ reason: string;
158
+ loc: Loc;
159
+ }
160
+ export interface IgnoredAst {
161
+ kind: "ignored";
162
+ /** What the statement was, e.g. `SET ANSI_NULLS ON`. */
163
+ text: string;
164
+ reason: string;
165
+ loc: Loc;
166
+ }
167
+ export type StatementAst = TableAst | IndexAst | ViewAst | SchemaAst | AlterConstraintAst | ExtendedPropertyAst | RefusedAst | IgnoredAst;
168
+ export declare class TsqlParseError extends Error {
169
+ readonly loc: Loc;
170
+ constructor(message: string, loc: Loc);
171
+ }
172
+ /** A statement that began and could not be read: its first words, and why. */
173
+ export interface UnreadStatement {
174
+ text: string;
175
+ reason: string;
176
+ loc: Loc;
177
+ }
178
+ export interface ParseResult {
179
+ statements: StatementAst[];
180
+ /** Statements that begin like one this source reads and are malformed or use syntax it does not read. */
181
+ unread: UnreadStatement[];
182
+ }
183
+ /** Parse a file of T-SQL. Lexing errors throw `TsqlLexError`. */
184
+ export declare function parseTsql(text: string): ParseResult;
185
+ //# sourceMappingURL=parse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["../../src/sqlserver/parse.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAsC,KAAK,KAAK,EAAE,MAAM,SAAS,CAAC;AAEzE,MAAM,WAAW,GAAG;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gFAAgF;AAChF,MAAM,WAAW,KAAK;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,EAAE,GAAG,CAAC;CACV;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,MAAM,cAAc,GAAG,aAAa,GAAG,QAAQ,GAAG,aAAa,GAAG,OAAO,GAAG,SAAS,CAAC;AAE5F,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,cAAc,CAAC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