@sdt-tools/cli 0.2.0 → 0.2.5

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 (205) hide show
  1. package/dist/advise-tests-6DRSZMBL.js +87 -0
  2. package/dist/advise-tests-6DRSZMBL.js.map +1 -0
  3. package/dist/ai-G4MJWHTM.js +89 -0
  4. package/dist/ai-G4MJWHTM.js.map +1 -0
  5. package/dist/anonymize-QR6JGXA7.js +123 -0
  6. package/dist/anonymize-QR6JGXA7.js.map +1 -0
  7. package/dist/approval-YVHYTV53.js +73 -0
  8. package/dist/approval-YVHYTV53.js.map +1 -0
  9. package/dist/approval-chain-54KKJZS3.js +120 -0
  10. package/dist/approval-chain-54KKJZS3.js.map +1 -0
  11. package/dist/audit-log-QZFH7LUX.js +159 -0
  12. package/dist/audit-log-QZFH7LUX.js.map +1 -0
  13. package/dist/backlog-V2YUIQDL.js +76 -0
  14. package/dist/backlog-V2YUIQDL.js.map +1 -0
  15. package/dist/bisect-GEVYAVL5.js +111 -0
  16. package/dist/bisect-GEVYAVL5.js.map +1 -0
  17. package/dist/bookmarks-57LKS7P6.js +107 -0
  18. package/dist/bookmarks-57LKS7P6.js.map +1 -0
  19. package/dist/branch-W2MGMPSH.js +88 -0
  20. package/dist/branch-W2MGMPSH.js.map +1 -0
  21. package/dist/build-VNIQFKSP.js +23 -0
  22. package/dist/build-VNIQFKSP.js.map +1 -0
  23. package/dist/catalog-JLB5VCEV.js +137 -0
  24. package/dist/catalog-JLB5VCEV.js.map +1 -0
  25. package/dist/changelog-M7XGDYSY.js +220 -0
  26. package/dist/changelog-M7XGDYSY.js.map +1 -0
  27. package/dist/chunk-DGUM43GV.js +11 -0
  28. package/dist/chunk-DGUM43GV.js.map +1 -0
  29. package/dist/chunk-EWXM4KJN.js +25 -0
  30. package/dist/chunk-EWXM4KJN.js.map +1 -0
  31. package/dist/chunk-JP2EZLR5.js +50 -0
  32. package/dist/chunk-JP2EZLR5.js.map +1 -0
  33. package/dist/chunk-VM2H4LAO.js +15 -0
  34. package/dist/chunk-VM2H4LAO.js.map +1 -0
  35. package/dist/chunk-ZWY4ZRHL.js +44 -0
  36. package/dist/chunk-ZWY4ZRHL.js.map +1 -0
  37. package/dist/cli.js +506 -19014
  38. package/dist/cli.js.map +1 -1
  39. package/dist/compare-5O6UTWPJ.js +405 -0
  40. package/dist/compare-5O6UTWPJ.js.map +1 -0
  41. package/dist/compare-profiles-7ZSNIW7B.js +218 -0
  42. package/dist/compare-profiles-7ZSNIW7B.js.map +1 -0
  43. package/dist/completion-I5U5VVAX.js +82 -0
  44. package/dist/completion-I5U5VVAX.js.map +1 -0
  45. package/dist/connection-SYTH4V53.js +110 -0
  46. package/dist/connection-SYTH4V53.js.map +1 -0
  47. package/dist/cost-estimate-TJDDH6TO.js +328 -0
  48. package/dist/cost-estimate-TJDDH6TO.js.map +1 -0
  49. package/dist/data-compare-UK2UXAS3.js +134 -0
  50. package/dist/data-compare-UK2UXAS3.js.map +1 -0
  51. package/dist/data-fit-Q45ENBRL.js +125 -0
  52. package/dist/data-fit-Q45ENBRL.js.map +1 -0
  53. package/dist/deploy-status-UUHKVDTI.js +58 -0
  54. package/dist/deploy-status-UUHKVDTI.js.map +1 -0
  55. package/dist/design-PO6UPBL7.js +138 -0
  56. package/dist/design-PO6UPBL7.js.map +1 -0
  57. package/dist/diagnose-6IFMELFR.js +145 -0
  58. package/dist/diagnose-6IFMELFR.js.map +1 -0
  59. package/dist/discover-A7OSZAHK.js +78 -0
  60. package/dist/discover-A7OSZAHK.js.map +1 -0
  61. package/dist/docs-CVRKGUSW.js +177 -0
  62. package/dist/docs-CVRKGUSW.js.map +1 -0
  63. package/dist/drift-XDA3BDYN.js +226 -0
  64. package/dist/drift-XDA3BDYN.js.map +1 -0
  65. package/dist/drift-gate-V7QSIOGZ.js +94 -0
  66. package/dist/drift-gate-V7QSIOGZ.js.map +1 -0
  67. package/dist/error-lookup-7ZWCZJ44.js +56 -0
  68. package/dist/error-lookup-7ZWCZJ44.js.map +1 -0
  69. package/dist/errorReporting-ZRNJ3VW7.js +109 -0
  70. package/dist/errorReporting-ZRNJ3VW7.js.map +1 -0
  71. package/dist/exec-PKBHLI7T.js +121 -0
  72. package/dist/exec-PKBHLI7T.js.map +1 -0
  73. package/dist/explain-LWKJOTL7.js +192 -0
  74. package/dist/explain-LWKJOTL7.js.map +1 -0
  75. package/dist/explorer-QOVM6VBD.js +61 -0
  76. package/dist/explorer-QOVM6VBD.js.map +1 -0
  77. package/dist/export-IYYBZ5HE.js +42 -0
  78. package/dist/export-IYYBZ5HE.js.map +1 -0
  79. package/dist/extract-VMMVRQVT.js +102 -0
  80. package/dist/extract-VMMVRQVT.js.map +1 -0
  81. package/dist/features-LE6BDZ2S.js +59 -0
  82. package/dist/features-LE6BDZ2S.js.map +1 -0
  83. package/dist/feedback-M7DM2EQC.js +161 -0
  84. package/dist/feedback-M7DM2EQC.js.map +1 -0
  85. package/dist/find-EME2JG2I.js +176 -0
  86. package/dist/find-EME2JG2I.js.map +1 -0
  87. package/dist/format-TRLWLMGS.js +141 -0
  88. package/dist/format-TRLWLMGS.js.map +1 -0
  89. package/dist/generate-6NAZGZDV.js +152 -0
  90. package/dist/generate-6NAZGZDV.js.map +1 -0
  91. package/dist/graph-QNQDAUO7.js +161 -0
  92. package/dist/graph-QNQDAUO7.js.map +1 -0
  93. package/dist/history-RONA7ZTI.js +199 -0
  94. package/dist/history-RONA7ZTI.js.map +1 -0
  95. package/dist/hosts-YBXY2ZG5.js +49 -0
  96. package/dist/hosts-YBXY2ZG5.js.map +1 -0
  97. package/dist/impact-T2JSANHS.js +59 -0
  98. package/dist/impact-T2JSANHS.js.map +1 -0
  99. package/dist/import-AELYLY6A.js +32 -0
  100. package/dist/import-AELYLY6A.js.map +1 -0
  101. package/dist/index.cjs +36 -6
  102. package/dist/index.cjs.map +1 -1
  103. package/dist/index.js +60 -25
  104. package/dist/index.js.map +1 -1
  105. package/dist/init-SWRRJMGI.js +57 -0
  106. package/dist/init-SWRRJMGI.js.map +1 -0
  107. package/dist/install-hooks-6SIAGTAF.js +109 -0
  108. package/dist/install-hooks-6SIAGTAF.js.map +1 -0
  109. package/dist/license-OAF22PLZ.js +46 -0
  110. package/dist/license-OAF22PLZ.js.map +1 -0
  111. package/dist/lineage-EW66XJ6O.js +552 -0
  112. package/dist/lineage-EW66XJ6O.js.map +1 -0
  113. package/dist/lint-FQ2OTYTQ.js +143 -0
  114. package/dist/lint-FQ2OTYTQ.js.map +1 -0
  115. package/dist/mcp-3QI4TH4N.js +344 -0
  116. package/dist/mcp-3QI4TH4N.js.map +1 -0
  117. package/dist/migrate-from-dbt-JVTXPWKQ.js +156 -0
  118. package/dist/migrate-from-dbt-JVTXPWKQ.js.map +1 -0
  119. package/dist/migrate-platform-NTRTOGNR.js +91 -0
  120. package/dist/migrate-platform-NTRTOGNR.js.map +1 -0
  121. package/dist/optimize-CJYWMAWA.js +105 -0
  122. package/dist/optimize-CJYWMAWA.js.map +1 -0
  123. package/dist/perf-LL2CPCJF.js +205 -0
  124. package/dist/perf-LL2CPCJF.js.map +1 -0
  125. package/dist/pii-FBDRDQ2E.js +136 -0
  126. package/dist/pii-FBDRDQ2E.js.map +1 -0
  127. package/dist/pilot-CCQERKPH.js +29 -0
  128. package/dist/pilot-CCQERKPH.js.map +1 -0
  129. package/dist/pr-comment-S5FF4QRX.js +79 -0
  130. package/dist/pr-comment-S5FF4QRX.js.map +1 -0
  131. package/dist/preview-5U4YVCRM.js +47 -0
  132. package/dist/preview-5U4YVCRM.js.map +1 -0
  133. package/dist/profile-7VC57KD2.js +101 -0
  134. package/dist/profile-7VC57KD2.js.map +1 -0
  135. package/dist/promote-AASEFTIA.js +408 -0
  136. package/dist/promote-AASEFTIA.js.map +1 -0
  137. package/dist/publish-Y2J56K4Y.js +715 -0
  138. package/dist/publish-Y2J56K4Y.js.map +1 -0
  139. package/dist/purge-QMXZKCMD.js +57 -0
  140. package/dist/purge-QMXZKCMD.js.map +1 -0
  141. package/dist/query-log-6OM4GI7W.js +112 -0
  142. package/dist/query-log-6OM4GI7W.js.map +1 -0
  143. package/dist/refactor-LTZQLJ35.js +5799 -0
  144. package/dist/refactor-LTZQLJ35.js.map +1 -0
  145. package/dist/refresh-4TY2AGOU.js +38 -0
  146. package/dist/refresh-4TY2AGOU.js.map +1 -0
  147. package/dist/replay-OOC25FZN.js +117 -0
  148. package/dist/replay-OOC25FZN.js.map +1 -0
  149. package/dist/revert-ODMUVJW6.js +110 -0
  150. package/dist/revert-ODMUVJW6.js.map +1 -0
  151. package/dist/review-XXPWOBFP.js +158 -0
  152. package/dist/review-XXPWOBFP.js.map +1 -0
  153. package/dist/rollback-suggest-6G2HEKFR.js +79 -0
  154. package/dist/rollback-suggest-6G2HEKFR.js.map +1 -0
  155. package/dist/safer-alternative-QFVNLG3L.js +89 -0
  156. package/dist/safer-alternative-QFVNLG3L.js.map +1 -0
  157. package/dist/safety-7QWRSUEZ.js +168 -0
  158. package/dist/safety-7QWRSUEZ.js.map +1 -0
  159. package/dist/savings-RHIXP6IT.js +95 -0
  160. package/dist/savings-RHIXP6IT.js.map +1 -0
  161. package/dist/scan-secrets-5YCQ4UCU.js +54 -0
  162. package/dist/scan-secrets-5YCQ4UCU.js.map +1 -0
  163. package/dist/schema-CIZXCQD2.js +429 -0
  164. package/dist/schema-CIZXCQD2.js.map +1 -0
  165. package/dist/script-K7CIN2P6.js +153 -0
  166. package/dist/script-K7CIN2P6.js.map +1 -0
  167. package/dist/search-BUZ5NXZZ.js +151 -0
  168. package/dist/search-BUZ5NXZZ.js.map +1 -0
  169. package/dist/seed-76QAK276.js +96 -0
  170. package/dist/seed-76QAK276.js.map +1 -0
  171. package/dist/sketch-PTLKDIK3.js +88 -0
  172. package/dist/sketch-PTLKDIK3.js.map +1 -0
  173. package/dist/snapshot-XLPR2OZ5.js +177 -0
  174. package/dist/snapshot-XLPR2OZ5.js.map +1 -0
  175. package/dist/snippets-EK4DK5CN.js +74 -0
  176. package/dist/snippets-EK4DK5CN.js.map +1 -0
  177. package/dist/standards-7T2UY6DD.js +241 -0
  178. package/dist/standards-7T2UY6DD.js.map +1 -0
  179. package/dist/suggest-VGRYSAR6.js +39 -0
  180. package/dist/suggest-VGRYSAR6.js.map +1 -0
  181. package/dist/suggest-constraints-MY5WKUHA.js +160 -0
  182. package/dist/suggest-constraints-MY5WKUHA.js.map +1 -0
  183. package/dist/suite-TRNGZWQM.js +88 -0
  184. package/dist/suite-TRNGZWQM.js.map +1 -0
  185. package/dist/telemetry-3U2QLA2S.js +75 -0
  186. package/dist/telemetry-3U2QLA2S.js.map +1 -0
  187. package/dist/template-ZERIXVXF.js +403 -0
  188. package/dist/template-ZERIXVXF.js.map +1 -0
  189. package/dist/test-5M2ED3WT.js +169 -0
  190. package/dist/test-5M2ED3WT.js.map +1 -0
  191. package/dist/trial-U732FONV.js +31 -0
  192. package/dist/trial-U732FONV.js.map +1 -0
  193. package/dist/validate-T6D2WCOK.js +106 -0
  194. package/dist/validate-T6D2WCOK.js.map +1 -0
  195. package/dist/verify-KXVASEEG.js +76 -0
  196. package/dist/verify-KXVASEEG.js.map +1 -0
  197. package/dist/watch-I6K4BNMA.js +80 -0
  198. package/dist/watch-I6K4BNMA.js.map +1 -0
  199. package/dist/xcompare-TPFLQO6W.js +87 -0
  200. package/dist/xcompare-TPFLQO6W.js.map +1 -0
  201. package/package.json +2 -2
  202. package/dist/cli.cjs +0 -19040
  203. package/dist/cli.cjs.map +0 -1
  204. package/dist/cli.d.cts +0 -1
  205. package/dist/cli.d.ts +0 -1
package/dist/index.js CHANGED
@@ -18,7 +18,10 @@ var logger = {
18
18
  // src/commands/init.ts
19
19
  function initCommand() {
20
20
  const cmd = new Command("init");
21
- cmd.description("Initialize a new SDT project in the current directory.").option("--name <name>", "Project name", "NewSnowflakeProject").option("--scope <scope>", "Project scope: account | database | schema", "database").option("--db <database>", "Database name (required for database/schema scope)").option("--schema <schema>", "Schema name (required for schema scope)").option("--dir <dir>", "Target directory (default: cwd)", process.cwd()).action(async (opts) => {
21
+ cmd.description("Initialize a new SDT project in the current directory.").option("--name <name>", "Project name", "NewSnowflakeProject").option("--scope <scope>", "Project scope: account | database | schema", "database").option("--db <database>", "Database name (required for database/schema scope)").option("--schema <schema>", "Schema name (required for schema scope)").option("--dir <dir>", "Target directory (default: cwd)", process.cwd()).option(
22
+ "--force",
23
+ "Overwrite an existing <name>.sdtproj in the target directory. Without this flag, init refuses to clobber an existing project file so a re-run never silently discards your project configuration."
24
+ ).action(async (opts) => {
22
25
  const scopeType = String(opts.scope);
23
26
  if (!["account", "database", "schema"].includes(scopeType)) {
24
27
  throw new Error(`Invalid --scope: ${opts.scope}. Use account | database | schema.`);
@@ -36,6 +39,15 @@ function initCommand() {
36
39
  await fs.mkdir(root, { recursive: true });
37
40
  const project10 = newProjectTemplate(String(opts.name), scope);
38
41
  const projectPath = path.join(root, `${project10.name}.sdtproj`);
42
+ if (!opts.force) {
43
+ try {
44
+ await fs.access(projectPath);
45
+ logger.error(`${projectPath} already exists; pass --force to overwrite.`);
46
+ process.exitCode = 1;
47
+ return;
48
+ } catch {
49
+ }
50
+ }
39
51
  await saveProject(projectPath, project10);
40
52
  const seedFolders = ["databases", "scripts/pre", "scripts/post"];
41
53
  for (const f of seedFolders) await fs.mkdir(path.join(root, f), { recursive: true });
@@ -318,7 +330,13 @@ function compareCommand() {
318
330
  const cmd = new Command4("compare");
319
331
  cmd.description(
320
332
  "Compare two schemas. Sources may be .sdtproj, .sdtpac, or snowflake://<profile>[/db[/schema]]."
321
- ).argument("<source>", "Left side of the comparison").argument("<target>", "Right side of the comparison").option("-o, --output <path>", "Write JSON result to this path").option("--format <format>", "Output format: json | summary | markdown", "summary").option("--ignore-case", "Treat unquoted identifiers case-insensitively", false).option(
333
+ ).argument("[source]", "Left side of the comparison (or use --source)").argument("[target]", "Right side of the comparison (or use --target)").option(
334
+ "--source <path>",
335
+ "Left side of the comparison (flag form of the positional source arg)"
336
+ ).option(
337
+ "--target <path>",
338
+ "Right side of the comparison (flag form of the positional target arg)"
339
+ ).option("-o, --output <path>", "Write JSON result to this path").option("--format <format>", "Output format: json | summary | markdown", "summary").option("--ignore-case", "Treat unquoted identifiers case-insensitively", false).option(
322
340
  "--no-slice",
323
341
  "Disable the source project's Slice (if it has one). Default: a project's slice is applied automatically."
324
342
  ).option(
@@ -343,7 +361,14 @@ function compareCommand() {
343
361
  ).option(
344
362
  "--no-history",
345
363
  "Skip writing the compare-history audit record (AUDITCMP.1). Default: every compare run writes a record to `.sdt/history/compare/`, exportable via `sdt audit-log emit`."
346
- ).action(async (sourceArg, targetArg, opts) => {
364
+ ).action(async (sourceArgPos, targetArgPos, opts) => {
365
+ const sourceArg = opts.source ? String(opts.source) : sourceArgPos ? String(sourceArgPos) : "";
366
+ const targetArg = opts.target ? String(opts.target) : targetArgPos ? String(targetArgPos) : "";
367
+ if (!sourceArg || !targetArg) {
368
+ throw new Error(
369
+ "compare needs a source and a target \u2014 pass them positionally (`sdt compare <source> <target>`) or via `--source`/`--target`."
370
+ );
371
+ }
347
372
  const nameMapping = await buildMappingFromOptions(opts);
348
373
  const source = await resolveSource(String(sourceArg));
349
374
  const target = await resolveSource(String(targetArg));
@@ -1512,7 +1537,12 @@ function driftCommand() {
1512
1537
  import { promises as fs6 } from "fs";
1513
1538
  import path6 from "path";
1514
1539
  import { Command as Command7 } from "commander";
1515
- import { project, validate as validateNs, variables as variablesNs } from "@sdt-tools/core";
1540
+ import {
1541
+ catalog as catalog2,
1542
+ project,
1543
+ validate as validateNs,
1544
+ variables as variablesNs
1545
+ } from "@sdt-tools/core";
1516
1546
  function validateCommand() {
1517
1547
  const cmd = new Command7("validate");
1518
1548
  cmd.description(
@@ -1541,12 +1571,17 @@ function validateCommand() {
1541
1571
  logger.dim(` Profiles: ${Object.keys(loaded.project.deploymentProfiles ?? {}).length}`);
1542
1572
  if (opts.checkVariables) {
1543
1573
  const projRoot = path6.dirname(path6.resolve(String(opts.project)));
1544
- const fileContents = await Promise.all(
1545
- files.map(async (f) => {
1574
+ const { results } = await catalog2.mapPool(
1575
+ files,
1576
+ async (f) => {
1546
1577
  const relPath = path6.relative(projRoot, f).split(path6.sep).join("/");
1547
1578
  const content = await fs6.readFile(f, "utf8");
1548
1579
  return { path: relPath, content };
1549
- })
1580
+ },
1581
+ { concurrency: 16, stopOnError: true }
1582
+ );
1583
+ const fileContents = results.filter(
1584
+ (r) => r !== void 0
1550
1585
  );
1551
1586
  const profilesBlock = loaded.project.deploymentProfiles ?? {};
1552
1587
  const profileVariableKeys = Object.values(profilesBlock).map(
@@ -4690,7 +4725,7 @@ async function readStdin() {
4690
4725
  // src/commands/compare-profiles.ts
4691
4726
  import { promises as fs23 } from "fs";
4692
4727
  import { Command as Command28 } from "commander";
4693
- import { catalog as catalog2, compareProfiles, pac as pac9, project as project9 } from "@sdt-tools/core";
4728
+ import { catalog as catalog3, compareProfiles, pac as pac9, project as project9 } from "@sdt-tools/core";
4694
4729
  function compareProfilesCommand() {
4695
4730
  const cmd = new Command28("compare-profiles");
4696
4731
  cmd.description("Manage saved compare profiles (.sdt/compare-profiles.json).");
@@ -4839,7 +4874,7 @@ function compareProfilesCommand() {
4839
4874
  }
4840
4875
  async function resolveEndpointFqns(endpoint, root) {
4841
4876
  if (endpoint.kind === "connection") {
4842
- const cache = new catalog2.CatalogCache({ root, connection: endpoint.reference });
4877
+ const cache = new catalog3.CatalogCache({ root, connection: endpoint.reference });
4843
4878
  const snapshot = await cache.get();
4844
4879
  if (snapshot.databases.length === 0) {
4845
4880
  return {
@@ -4899,7 +4934,7 @@ async function readStdin2() {
4899
4934
 
4900
4935
  // src/commands/explorer.ts
4901
4936
  import { Command as Command29 } from "commander";
4902
- import { catalog as catalog3, objectExplorer } from "@sdt-tools/core";
4937
+ import { catalog as catalog4, objectExplorer } from "@sdt-tools/core";
4903
4938
  function explorerCommand() {
4904
4939
  const cmd = new Command29("explorer");
4905
4940
  cmd.description(
@@ -4909,7 +4944,7 @@ function explorerCommand() {
4909
4944
  "Truncate tree at depth N (0 = root only, 1 = +databases, 2 = +schemas, 3 = +object-groups, 4 = +objects). Default unlimited.",
4910
4945
  (v) => parseInt(v, 10)
4911
4946
  ).option("--json", "Emit tree as JSON instead of ASCII.").action(async (opts) => {
4912
- const cache = new catalog3.CatalogCache({
4947
+ const cache = new catalog4.CatalogCache({
4913
4948
  root: String(opts.root),
4914
4949
  connection: String(opts.connection)
4915
4950
  });
@@ -4952,7 +4987,7 @@ function renderChild(node, prefix, isLast) {
4952
4987
 
4953
4988
  // src/commands/catalog.ts
4954
4989
  import { Command as Command30 } from "commander";
4955
- import { catalog as catalog4 } from "@sdt-tools/core";
4990
+ import { catalog as catalog5 } from "@sdt-tools/core";
4956
4991
  import { getProfile as getProfile9, SnowflakeConnection as SnowflakeConnection9 } from "@sdt-tools/core/connection";
4957
4992
  var BUILTIN_DATABASES = /* @__PURE__ */ new Set(["SNOWFLAKE", "SNOWFLAKE_SAMPLE_DATA", "UTIL_DB"]);
4958
4993
  function catalogCommand() {
@@ -4967,7 +5002,7 @@ function catalogCommand() {
4967
5002
  ).option("--no-fingerprint-skip", "Force a full scan even when fingerprints are unchanged.").action(async (opts) => {
4968
5003
  const profile = await getProfile9(String(opts.connection));
4969
5004
  const conn = new SnowflakeConnection9(profile);
4970
- const cache = new catalog4.CatalogCache({
5005
+ const cache = new catalog5.CatalogCache({
4971
5006
  root: String(opts.root),
4972
5007
  connection: profile.name
4973
5008
  });
@@ -4986,27 +5021,27 @@ function catalogCommand() {
4986
5021
  const cachedByDb = new Map(cached.databases.map((d) => [d.database, d]));
4987
5022
  const concurrency = Math.max(1, Number(opts.concurrency) || 10);
4988
5023
  const fingerprintSkip = opts.fingerprintSkip !== false;
4989
- const { results, errors } = await catalog4.mapPool(
5024
+ const { results, errors } = await catalog5.mapPool(
4990
5025
  dbs,
4991
5026
  async (db) => {
4992
5027
  let freshFingerprint = null;
4993
5028
  try {
4994
5029
  const fpRes = await conn.query(
4995
- catalog4.fingerprintSqlForDatabase(db)
5030
+ catalog5.fingerprintSqlForDatabase(db)
4996
5031
  );
4997
- freshFingerprint = catalog4.parseFingerprintRow(fpRes.rows);
5032
+ freshFingerprint = catalog5.parseFingerprintRow(fpRes.rows);
4998
5033
  } catch (err) {
4999
5034
  logger.warn(
5000
5035
  `fingerprint(${db}) failed; falling through to full scan: ${err.message}`
5001
5036
  );
5002
5037
  }
5003
5038
  const cachedDb = cachedByDb.get(db);
5004
- if (fingerprintSkip && cachedDb && cachedDb.fingerprint != null && freshFingerprint != null && catalog4.isFresh(cachedDb.fingerprint, freshFingerprint)) {
5039
+ if (fingerprintSkip && cachedDb && cachedDb.fingerprint != null && freshFingerprint != null && catalog5.isFresh(cachedDb.fingerprint, freshFingerprint)) {
5005
5040
  logger.dim(` ${db}: fresh; reusing cache`);
5006
5041
  return { database: db, fingerprint: cachedDb.fingerprint, schemas: cachedDb.schemas };
5007
5042
  }
5008
- const scanRes = await conn.query(catalog4.bulkScanSqlForDatabase(db));
5009
- const schemas = catalog4.parseBulkScanRows(db, scanRes.rows);
5043
+ const scanRes = await conn.query(catalog5.bulkScanSqlForDatabase(db));
5044
+ const schemas = catalog5.parseBulkScanRows(db, scanRes.rows);
5010
5045
  const fingerprint = freshFingerprint ?? null;
5011
5046
  logger.dim(
5012
5047
  ` ${db}: ${schemas.length} schemas / ${schemas.reduce((sum, s) => sum + s.objects.length, 0)} objects`
@@ -5018,8 +5053,8 @@ function catalogCommand() {
5018
5053
  for (const e of errors) {
5019
5054
  logger.warn(`scan failed for "${dbs[e.index]}": ${e.error.message}`);
5020
5055
  }
5021
- const snapshot = catalog4.refreshFingerprints({
5022
- version: catalog4.CATALOG_SNAPSHOT_VERSION,
5056
+ const snapshot = catalog5.refreshFingerprints({
5057
+ version: catalog5.CATALOG_SNAPSHOT_VERSION,
5023
5058
  connection: profile.name,
5024
5059
  snapshotAt: (/* @__PURE__ */ new Date()).toISOString(),
5025
5060
  fingerprint: null,
@@ -5032,7 +5067,7 @@ function catalogCommand() {
5032
5067
  }
5033
5068
  });
5034
5069
  cmd.command("show").description("Pretty-print or JSON-dump the cached snapshot for a connection.").requiredOption("-c, --connection <name>", "Connection profile name.").option("--root <path>", "Project root. Default cwd.", process.cwd()).option("--json", "Emit JSON instead of summary.").action(async (opts) => {
5035
- const cache = new catalog4.CatalogCache({
5070
+ const cache = new catalog5.CatalogCache({
5036
5071
  root: String(opts.root),
5037
5072
  connection: String(opts.connection)
5038
5073
  });
@@ -5059,7 +5094,7 @@ function catalogCommand() {
5059
5094
  }
5060
5095
  });
5061
5096
  cmd.command("clear").description("Delete the cached snapshot for a connection.").requiredOption("-c, --connection <name>", "Connection profile name.").option("--root <path>", "Project root. Default cwd.", process.cwd()).action(async (opts) => {
5062
- const cache = new catalog4.CatalogCache({
5097
+ const cache = new catalog5.CatalogCache({
5063
5098
  root: String(opts.root),
5064
5099
  connection: String(opts.connection)
5065
5100
  });
@@ -5200,7 +5235,7 @@ import { Command as Command32 } from "commander";
5200
5235
  import { promises as fs25 } from "fs";
5201
5236
  import os from "os";
5202
5237
  import path20 from "path";
5203
- import { catalog as catalog5 } from "@sdt-tools/core";
5238
+ import { catalog as catalog6 } from "@sdt-tools/core";
5204
5239
  function buildDriftReport(results) {
5205
5240
  const allFqns = /* @__PURE__ */ new Set();
5206
5241
  const byFqn = /* @__PURE__ */ new Map();
@@ -5263,7 +5298,7 @@ async function loadProfileNames(profilesOpt, profilesDir) {
5263
5298
  }
5264
5299
  async function defaultSearchFn(profile, pattern, opts) {
5265
5300
  const root = opts.root ?? process.cwd();
5266
- const cache = new catalog5.CatalogCache({ root, connection: profile });
5301
+ const cache = new catalog6.CatalogCache({ root, connection: profile });
5267
5302
  const snapshot = await cache.get();
5268
5303
  if (snapshot.databases.length === 0) {
5269
5304
  throw new Error(