@databricks-solutions/lakebase-scm-utils 0.3.0 → 0.3.2

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 (38) hide show
  1. package/README.md +10 -4
  2. package/dist/scripts/index.cjs +2336 -2262
  3. package/dist/scripts/index.js +395 -321
  4. package/dist/scripts/lakebase/ci-resolve-branch.cli.cjs +26 -9
  5. package/dist/scripts/lakebase/ci-resolve-branch.cli.js +27 -10
  6. package/dist/scripts/lakebase/collapse-heads.cli.cjs +26 -9
  7. package/dist/scripts/lakebase/collapse-heads.cli.js +27 -10
  8. package/dist/scripts/lakebase/detect-language.cli.cjs +26 -9
  9. package/dist/scripts/lakebase/detect-language.cli.js +27 -10
  10. package/dist/scripts/lakebase/doctor.cli.cjs +26 -9
  11. package/dist/scripts/lakebase/doctor.cli.js +27 -10
  12. package/dist/scripts/lakebase/get-connection.cli.cjs +2 -2
  13. package/dist/scripts/lakebase/get-connection.cli.js +2 -2
  14. package/dist/scripts/lakebase/index.cjs +2333 -2223
  15. package/dist/scripts/lakebase/index.js +389 -279
  16. package/dist/scripts/lakebase/infra-runner.cli.cjs +26 -9
  17. package/dist/scripts/lakebase/infra-runner.cli.js +27 -10
  18. package/dist/scripts/lakebase/new-migration.cli.cjs +26 -9
  19. package/dist/scripts/lakebase/new-migration.cli.js +27 -10
  20. package/dist/scripts/lakebase/schema-diff.cli.cjs +2 -2
  21. package/dist/scripts/lakebase/schema-diff.cli.js +2 -2
  22. package/dist/scripts/lakebase/schema-migrate.cli.cjs +26 -9
  23. package/dist/scripts/lakebase/schema-migrate.cli.js +27 -10
  24. package/dist/scripts/lakebase/scm-claim-feature.cli.cjs +26 -9
  25. package/dist/scripts/lakebase/scm-claim-feature.cli.js +27 -10
  26. package/dist/scripts/lakebase/scm-doctor.cli.cjs +26 -9
  27. package/dist/scripts/lakebase/scm-doctor.cli.js +27 -10
  28. package/dist/scripts/lakebase/scm-merge.cli.cjs +26 -9
  29. package/dist/scripts/lakebase/scm-merge.cli.js +27 -10
  30. package/dist/scripts/lakebase/scm-reconcile-tier.cli.cjs +26 -9
  31. package/dist/scripts/lakebase/scm-reconcile-tier.cli.js +28 -11
  32. package/dist/scripts/util/index.cjs +2 -2
  33. package/dist/scripts/util/index.js +2 -2
  34. package/package.json +1 -1
  35. package/scripts/lakebase/client-lockfile.ts +102 -0
  36. package/scripts/lakebase/create-project.ts +19 -0
  37. package/scripts/lakebase/schema-migrate-runners/alembic.ts +58 -14
  38. package/templates/project/client/playwright.config.ts +35 -10
@@ -79629,8 +79629,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79629
79629
  var cached;
79630
79630
  function substrateSelfVersion() {
79631
79631
  if (cached !== void 0) return cached;
79632
- if ("0.3.0".length > 0) {
79633
- cached = "0.3.0";
79632
+ if ("0.3.2".length > 0) {
79633
+ cached = "0.3.2";
79634
79634
  return cached;
79635
79635
  }
79636
79636
  cached = "unknown";
@@ -79883,26 +79883,43 @@ init_cjs_shims();
79883
79883
  var import_node_child_process3 = require("child_process");
79884
79884
  var fs7 = __toESM(require("fs"), 1);
79885
79885
  var path5 = __toESM(require("path"), 1);
79886
- function resolveAlembicBin(projectDir) {
79887
- const candidates = [
79886
+ var uvOnPath;
79887
+ function hasUv() {
79888
+ if (uvOnPath !== void 0) return uvOnPath;
79889
+ try {
79890
+ (0, import_node_child_process3.execFileSync)("uv", ["--version"], { stdio: "ignore" });
79891
+ uvOnPath = true;
79892
+ } catch {
79893
+ uvOnPath = false;
79894
+ }
79895
+ return uvOnPath;
79896
+ }
79897
+ function resolveAlembicInvocation(projectDir, uvAvailable = hasUv()) {
79898
+ const venvCandidates = [
79888
79899
  path5.join(projectDir, ".venv", "bin", "alembic"),
79889
79900
  path5.join(projectDir, "venv", "bin", "alembic")
79890
79901
  ];
79891
- for (const candidate of candidates) {
79902
+ for (const candidate of venvCandidates) {
79892
79903
  try {
79893
- if (fs7.existsSync(candidate)) return candidate;
79904
+ if (fs7.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
79894
79905
  } catch {
79895
79906
  }
79896
79907
  }
79897
- return "alembic";
79908
+ try {
79909
+ if (uvAvailable && fs7.existsSync(path5.join(projectDir, "pyproject.toml"))) {
79910
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
79911
+ }
79912
+ } catch {
79913
+ }
79914
+ return { bin: "alembic", prefixArgs: [] };
79898
79915
  }
79899
79916
  function spawnAlembic(projectDir, args, dsn) {
79900
79917
  return new Promise((resolve2, reject) => {
79901
- const bin = resolveAlembicBin(projectDir);
79918
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir);
79902
79919
  const env = { ...process.env };
79903
79920
  env.PYTHONPATH = [projectDir, process.env.PYTHONPATH].filter(Boolean).join(path5.delimiter);
79904
79921
  if (dsn) env.DATABASE_URL = dsn;
79905
- const child = (0, import_node_child_process3.spawn)(bin, args, {
79922
+ const child = (0, import_node_child_process3.spawn)(bin, [...prefixArgs, ...args], {
79906
79923
  cwd: projectDir,
79907
79924
  env,
79908
79925
  stdio: ["ignore", "pipe", "pipe"]
@@ -721,8 +721,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
721
721
  var cached;
722
722
  function substrateSelfVersion() {
723
723
  if (cached !== void 0) return cached;
724
- if ("0.3.0".length > 0) {
725
- cached = "0.3.0";
724
+ if ("0.3.2".length > 0) {
725
+ cached = "0.3.2";
726
726
  return cached;
727
727
  }
728
728
  cached = "unknown";
@@ -968,29 +968,46 @@ import * as fs7 from "fs";
968
968
  import * as path6 from "path";
969
969
 
970
970
  // scripts/lakebase/schema-migrate-runners/alembic.ts
971
- import { spawn } from "child_process";
971
+ import { spawn, execFileSync as execFileSync3 } from "child_process";
972
972
  import * as fs6 from "fs";
973
973
  import * as path5 from "path";
974
- function resolveAlembicBin(projectDir) {
975
- const candidates = [
974
+ var uvOnPath;
975
+ function hasUv() {
976
+ if (uvOnPath !== void 0) return uvOnPath;
977
+ try {
978
+ execFileSync3("uv", ["--version"], { stdio: "ignore" });
979
+ uvOnPath = true;
980
+ } catch {
981
+ uvOnPath = false;
982
+ }
983
+ return uvOnPath;
984
+ }
985
+ function resolveAlembicInvocation(projectDir, uvAvailable = hasUv()) {
986
+ const venvCandidates = [
976
987
  path5.join(projectDir, ".venv", "bin", "alembic"),
977
988
  path5.join(projectDir, "venv", "bin", "alembic")
978
989
  ];
979
- for (const candidate of candidates) {
990
+ for (const candidate of venvCandidates) {
980
991
  try {
981
- if (fs6.existsSync(candidate)) return candidate;
992
+ if (fs6.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
982
993
  } catch {
983
994
  }
984
995
  }
985
- return "alembic";
996
+ try {
997
+ if (uvAvailable && fs6.existsSync(path5.join(projectDir, "pyproject.toml"))) {
998
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
999
+ }
1000
+ } catch {
1001
+ }
1002
+ return { bin: "alembic", prefixArgs: [] };
986
1003
  }
987
1004
  function spawnAlembic(projectDir, args, dsn) {
988
1005
  return new Promise((resolve2, reject) => {
989
- const bin = resolveAlembicBin(projectDir);
1006
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir);
990
1007
  const env = { ...process.env };
991
1008
  env.PYTHONPATH = [projectDir, process.env.PYTHONPATH].filter(Boolean).join(path5.delimiter);
992
1009
  if (dsn) env.DATABASE_URL = dsn;
993
- const child = spawn(bin, args, {
1010
+ const child = spawn(bin, [...prefixArgs, ...args], {
994
1011
  cwd: projectDir,
995
1012
  env,
996
1013
  stdio: ["ignore", "pipe", "pipe"]
@@ -79290,8 +79290,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79290
79290
  var cached;
79291
79291
  function substrateSelfVersion() {
79292
79292
  if (cached !== void 0) return cached;
79293
- if ("0.3.0".length > 0) {
79294
- cached = "0.3.0";
79293
+ if ("0.3.2".length > 0) {
79294
+ cached = "0.3.2";
79295
79295
  return cached;
79296
79296
  }
79297
79297
  cached = "unknown";
@@ -79475,26 +79475,43 @@ init_cjs_shims();
79475
79475
  var import_node_child_process3 = require("child_process");
79476
79476
  var fs6 = __toESM(require("fs"), 1);
79477
79477
  var path4 = __toESM(require("path"), 1);
79478
- function resolveAlembicBin(projectDir) {
79479
- const candidates = [
79478
+ var uvOnPath;
79479
+ function hasUv() {
79480
+ if (uvOnPath !== void 0) return uvOnPath;
79481
+ try {
79482
+ (0, import_node_child_process3.execFileSync)("uv", ["--version"], { stdio: "ignore" });
79483
+ uvOnPath = true;
79484
+ } catch {
79485
+ uvOnPath = false;
79486
+ }
79487
+ return uvOnPath;
79488
+ }
79489
+ function resolveAlembicInvocation(projectDir, uvAvailable = hasUv()) {
79490
+ const venvCandidates = [
79480
79491
  path4.join(projectDir, ".venv", "bin", "alembic"),
79481
79492
  path4.join(projectDir, "venv", "bin", "alembic")
79482
79493
  ];
79483
- for (const candidate of candidates) {
79494
+ for (const candidate of venvCandidates) {
79484
79495
  try {
79485
- if (fs6.existsSync(candidate)) return candidate;
79496
+ if (fs6.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
79486
79497
  } catch {
79487
79498
  }
79488
79499
  }
79489
- return "alembic";
79500
+ try {
79501
+ if (uvAvailable && fs6.existsSync(path4.join(projectDir, "pyproject.toml"))) {
79502
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
79503
+ }
79504
+ } catch {
79505
+ }
79506
+ return { bin: "alembic", prefixArgs: [] };
79490
79507
  }
79491
79508
  function spawnAlembic(projectDir, args, dsn) {
79492
79509
  return new Promise((resolve, reject) => {
79493
- const bin = resolveAlembicBin(projectDir);
79510
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir);
79494
79511
  const env = { ...process.env };
79495
79512
  env.PYTHONPATH = [projectDir, process.env.PYTHONPATH].filter(Boolean).join(path4.delimiter);
79496
79513
  if (dsn) env.DATABASE_URL = dsn;
79497
- const child = (0, import_node_child_process3.spawn)(bin, args, {
79514
+ const child = (0, import_node_child_process3.spawn)(bin, [...prefixArgs, ...args], {
79498
79515
  cwd: projectDir,
79499
79516
  env,
79500
79517
  stdio: ["ignore", "pipe", "pipe"]
@@ -393,8 +393,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
393
393
  var cached;
394
394
  function substrateSelfVersion() {
395
395
  if (cached !== void 0) return cached;
396
- if ("0.3.0".length > 0) {
397
- cached = "0.3.0";
396
+ if ("0.3.2".length > 0) {
397
+ cached = "0.3.2";
398
398
  return cached;
399
399
  }
400
400
  cached = "unknown";
@@ -569,29 +569,46 @@ import * as fs6 from "fs";
569
569
  import * as path5 from "path";
570
570
 
571
571
  // scripts/lakebase/schema-migrate-runners/alembic.ts
572
- import { spawn } from "child_process";
572
+ import { spawn, execFileSync as execFileSync3 } from "child_process";
573
573
  import * as fs5 from "fs";
574
574
  import * as path4 from "path";
575
- function resolveAlembicBin(projectDir) {
576
- const candidates = [
575
+ var uvOnPath;
576
+ function hasUv() {
577
+ if (uvOnPath !== void 0) return uvOnPath;
578
+ try {
579
+ execFileSync3("uv", ["--version"], { stdio: "ignore" });
580
+ uvOnPath = true;
581
+ } catch {
582
+ uvOnPath = false;
583
+ }
584
+ return uvOnPath;
585
+ }
586
+ function resolveAlembicInvocation(projectDir, uvAvailable = hasUv()) {
587
+ const venvCandidates = [
577
588
  path4.join(projectDir, ".venv", "bin", "alembic"),
578
589
  path4.join(projectDir, "venv", "bin", "alembic")
579
590
  ];
580
- for (const candidate of candidates) {
591
+ for (const candidate of venvCandidates) {
581
592
  try {
582
- if (fs5.existsSync(candidate)) return candidate;
593
+ if (fs5.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
583
594
  } catch {
584
595
  }
585
596
  }
586
- return "alembic";
597
+ try {
598
+ if (uvAvailable && fs5.existsSync(path4.join(projectDir, "pyproject.toml"))) {
599
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
600
+ }
601
+ } catch {
602
+ }
603
+ return { bin: "alembic", prefixArgs: [] };
587
604
  }
588
605
  function spawnAlembic(projectDir, args, dsn) {
589
606
  return new Promise((resolve, reject) => {
590
- const bin = resolveAlembicBin(projectDir);
607
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir);
591
608
  const env = { ...process.env };
592
609
  env.PYTHONPATH = [projectDir, process.env.PYTHONPATH].filter(Boolean).join(path4.delimiter);
593
610
  if (dsn) env.DATABASE_URL = dsn;
594
- const child = spawn(bin, args, {
611
+ const child = spawn(bin, [...prefixArgs, ...args], {
595
612
  cwd: projectDir,
596
613
  env,
597
614
  stdio: ["ignore", "pipe", "pipe"]
@@ -79290,8 +79290,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79290
79290
  var cached;
79291
79291
  function substrateSelfVersion() {
79292
79292
  if (cached !== void 0) return cached;
79293
- if ("0.3.0".length > 0) {
79294
- cached = "0.3.0";
79293
+ if ("0.3.2".length > 0) {
79294
+ cached = "0.3.2";
79295
79295
  return cached;
79296
79296
  }
79297
79297
  cached = "unknown";
@@ -79544,26 +79544,43 @@ init_cjs_shims();
79544
79544
  var import_node_child_process3 = require("child_process");
79545
79545
  var fs7 = __toESM(require("fs"), 1);
79546
79546
  var path5 = __toESM(require("path"), 1);
79547
- function resolveAlembicBin(projectDir2) {
79548
- const candidates = [
79547
+ var uvOnPath;
79548
+ function hasUv() {
79549
+ if (uvOnPath !== void 0) return uvOnPath;
79550
+ try {
79551
+ (0, import_node_child_process3.execFileSync)("uv", ["--version"], { stdio: "ignore" });
79552
+ uvOnPath = true;
79553
+ } catch {
79554
+ uvOnPath = false;
79555
+ }
79556
+ return uvOnPath;
79557
+ }
79558
+ function resolveAlembicInvocation(projectDir2, uvAvailable = hasUv()) {
79559
+ const venvCandidates = [
79549
79560
  path5.join(projectDir2, ".venv", "bin", "alembic"),
79550
79561
  path5.join(projectDir2, "venv", "bin", "alembic")
79551
79562
  ];
79552
- for (const candidate of candidates) {
79563
+ for (const candidate of venvCandidates) {
79553
79564
  try {
79554
- if (fs7.existsSync(candidate)) return candidate;
79565
+ if (fs7.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
79555
79566
  } catch {
79556
79567
  }
79557
79568
  }
79558
- return "alembic";
79569
+ try {
79570
+ if (uvAvailable && fs7.existsSync(path5.join(projectDir2, "pyproject.toml"))) {
79571
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
79572
+ }
79573
+ } catch {
79574
+ }
79575
+ return { bin: "alembic", prefixArgs: [] };
79559
79576
  }
79560
79577
  function spawnAlembic(projectDir2, args, dsn) {
79561
79578
  return new Promise((resolve2, reject) => {
79562
- const bin = resolveAlembicBin(projectDir2);
79579
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir2);
79563
79580
  const env = { ...process.env };
79564
79581
  env.PYTHONPATH = [projectDir2, process.env.PYTHONPATH].filter(Boolean).join(path5.delimiter);
79565
79582
  if (dsn) env.DATABASE_URL = dsn;
79566
- const child = (0, import_node_child_process3.spawn)(bin, args, {
79583
+ const child = (0, import_node_child_process3.spawn)(bin, [...prefixArgs, ...args], {
79567
79584
  cwd: projectDir2,
79568
79585
  env,
79569
79586
  stdio: ["ignore", "pipe", "pipe"]
@@ -393,8 +393,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
393
393
  var cached;
394
394
  function substrateSelfVersion() {
395
395
  if (cached !== void 0) return cached;
396
- if ("0.3.0".length > 0) {
397
- cached = "0.3.0";
396
+ if ("0.3.2".length > 0) {
397
+ cached = "0.3.2";
398
398
  return cached;
399
399
  }
400
400
  cached = "unknown";
@@ -640,29 +640,46 @@ import * as fs7 from "fs";
640
640
  import * as path6 from "path";
641
641
 
642
642
  // scripts/lakebase/schema-migrate-runners/alembic.ts
643
- import { spawn } from "child_process";
643
+ import { spawn, execFileSync as execFileSync3 } from "child_process";
644
644
  import * as fs6 from "fs";
645
645
  import * as path5 from "path";
646
- function resolveAlembicBin(projectDir2) {
647
- const candidates = [
646
+ var uvOnPath;
647
+ function hasUv() {
648
+ if (uvOnPath !== void 0) return uvOnPath;
649
+ try {
650
+ execFileSync3("uv", ["--version"], { stdio: "ignore" });
651
+ uvOnPath = true;
652
+ } catch {
653
+ uvOnPath = false;
654
+ }
655
+ return uvOnPath;
656
+ }
657
+ function resolveAlembicInvocation(projectDir2, uvAvailable = hasUv()) {
658
+ const venvCandidates = [
648
659
  path5.join(projectDir2, ".venv", "bin", "alembic"),
649
660
  path5.join(projectDir2, "venv", "bin", "alembic")
650
661
  ];
651
- for (const candidate of candidates) {
662
+ for (const candidate of venvCandidates) {
652
663
  try {
653
- if (fs6.existsSync(candidate)) return candidate;
664
+ if (fs6.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
654
665
  } catch {
655
666
  }
656
667
  }
657
- return "alembic";
668
+ try {
669
+ if (uvAvailable && fs6.existsSync(path5.join(projectDir2, "pyproject.toml"))) {
670
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
671
+ }
672
+ } catch {
673
+ }
674
+ return { bin: "alembic", prefixArgs: [] };
658
675
  }
659
676
  function spawnAlembic(projectDir2, args, dsn) {
660
677
  return new Promise((resolve2, reject) => {
661
- const bin = resolveAlembicBin(projectDir2);
678
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir2);
662
679
  const env = { ...process.env };
663
680
  env.PYTHONPATH = [projectDir2, process.env.PYTHONPATH].filter(Boolean).join(path5.delimiter);
664
681
  if (dsn) env.DATABASE_URL = dsn;
665
- const child = spawn(bin, args, {
682
+ const child = spawn(bin, [...prefixArgs, ...args], {
666
683
  cwd: projectDir2,
667
684
  env,
668
685
  stdio: ["ignore", "pipe", "pipe"]
@@ -79382,8 +79382,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79382
79382
  var cached;
79383
79383
  function substrateSelfVersion() {
79384
79384
  if (cached !== void 0) return cached;
79385
- if ("0.3.0".length > 0) {
79386
- cached = "0.3.0";
79385
+ if ("0.3.2".length > 0) {
79386
+ cached = "0.3.2";
79387
79387
  return cached;
79388
79388
  }
79389
79389
  cached = "unknown";
@@ -79636,26 +79636,43 @@ init_cjs_shims();
79636
79636
  var import_node_child_process3 = require("child_process");
79637
79637
  var fs8 = __toESM(require("fs"), 1);
79638
79638
  var path6 = __toESM(require("path"), 1);
79639
- function resolveAlembicBin(projectDir) {
79640
- const candidates = [
79639
+ var uvOnPath;
79640
+ function hasUv() {
79641
+ if (uvOnPath !== void 0) return uvOnPath;
79642
+ try {
79643
+ (0, import_node_child_process3.execFileSync)("uv", ["--version"], { stdio: "ignore" });
79644
+ uvOnPath = true;
79645
+ } catch {
79646
+ uvOnPath = false;
79647
+ }
79648
+ return uvOnPath;
79649
+ }
79650
+ function resolveAlembicInvocation(projectDir, uvAvailable = hasUv()) {
79651
+ const venvCandidates = [
79641
79652
  path6.join(projectDir, ".venv", "bin", "alembic"),
79642
79653
  path6.join(projectDir, "venv", "bin", "alembic")
79643
79654
  ];
79644
- for (const candidate of candidates) {
79655
+ for (const candidate of venvCandidates) {
79645
79656
  try {
79646
- if (fs8.existsSync(candidate)) return candidate;
79657
+ if (fs8.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
79647
79658
  } catch {
79648
79659
  }
79649
79660
  }
79650
- return "alembic";
79661
+ try {
79662
+ if (uvAvailable && fs8.existsSync(path6.join(projectDir, "pyproject.toml"))) {
79663
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
79664
+ }
79665
+ } catch {
79666
+ }
79667
+ return { bin: "alembic", prefixArgs: [] };
79651
79668
  }
79652
79669
  function spawnAlembic(projectDir, args, dsn) {
79653
79670
  return new Promise((resolve2, reject) => {
79654
- const bin = resolveAlembicBin(projectDir);
79671
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir);
79655
79672
  const env = { ...process.env };
79656
79673
  env.PYTHONPATH = [projectDir, process.env.PYTHONPATH].filter(Boolean).join(path6.delimiter);
79657
79674
  if (dsn) env.DATABASE_URL = dsn;
79658
- const child = (0, import_node_child_process3.spawn)(bin, args, {
79675
+ const child = (0, import_node_child_process3.spawn)(bin, [...prefixArgs, ...args], {
79659
79676
  cwd: projectDir,
79660
79677
  env,
79661
79678
  stdio: ["ignore", "pipe", "pipe"]
@@ -484,8 +484,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
484
484
  var cached;
485
485
  function substrateSelfVersion() {
486
486
  if (cached !== void 0) return cached;
487
- if ("0.3.0".length > 0) {
488
- cached = "0.3.0";
487
+ if ("0.3.2".length > 0) {
488
+ cached = "0.3.2";
489
489
  return cached;
490
490
  }
491
491
  cached = "unknown";
@@ -731,29 +731,46 @@ import * as fs8 from "fs";
731
731
  import * as path7 from "path";
732
732
 
733
733
  // scripts/lakebase/schema-migrate-runners/alembic.ts
734
- import { spawn } from "child_process";
734
+ import { spawn, execFileSync as execFileSync3 } from "child_process";
735
735
  import * as fs7 from "fs";
736
736
  import * as path6 from "path";
737
- function resolveAlembicBin(projectDir) {
738
- const candidates = [
737
+ var uvOnPath;
738
+ function hasUv() {
739
+ if (uvOnPath !== void 0) return uvOnPath;
740
+ try {
741
+ execFileSync3("uv", ["--version"], { stdio: "ignore" });
742
+ uvOnPath = true;
743
+ } catch {
744
+ uvOnPath = false;
745
+ }
746
+ return uvOnPath;
747
+ }
748
+ function resolveAlembicInvocation(projectDir, uvAvailable = hasUv()) {
749
+ const venvCandidates = [
739
750
  path6.join(projectDir, ".venv", "bin", "alembic"),
740
751
  path6.join(projectDir, "venv", "bin", "alembic")
741
752
  ];
742
- for (const candidate of candidates) {
753
+ for (const candidate of venvCandidates) {
743
754
  try {
744
- if (fs7.existsSync(candidate)) return candidate;
755
+ if (fs7.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
745
756
  } catch {
746
757
  }
747
758
  }
748
- return "alembic";
759
+ try {
760
+ if (uvAvailable && fs7.existsSync(path6.join(projectDir, "pyproject.toml"))) {
761
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
762
+ }
763
+ } catch {
764
+ }
765
+ return { bin: "alembic", prefixArgs: [] };
749
766
  }
750
767
  function spawnAlembic(projectDir, args, dsn) {
751
768
  return new Promise((resolve2, reject) => {
752
- const bin = resolveAlembicBin(projectDir);
769
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir);
753
770
  const env = { ...process.env };
754
771
  env.PYTHONPATH = [projectDir, process.env.PYTHONPATH].filter(Boolean).join(path6.delimiter);
755
772
  if (dsn) env.DATABASE_URL = dsn;
756
- const child = spawn(bin, args, {
773
+ const child = spawn(bin, [...prefixArgs, ...args], {
757
774
  cwd: projectDir,
758
775
  env,
759
776
  stdio: ["ignore", "pipe", "pipe"]
@@ -79285,8 +79285,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79285
79285
  var cached;
79286
79286
  function substrateSelfVersion() {
79287
79287
  if (cached !== void 0) return cached;
79288
- if ("0.3.0".length > 0) {
79289
- cached = "0.3.0";
79288
+ if ("0.3.2".length > 0) {
79289
+ cached = "0.3.2";
79290
79290
  return cached;
79291
79291
  }
79292
79292
  cached = "unknown";
@@ -389,8 +389,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
389
389
  var cached;
390
390
  function substrateSelfVersion() {
391
391
  if (cached !== void 0) return cached;
392
- if ("0.3.0".length > 0) {
393
- cached = "0.3.0";
392
+ if ("0.3.2".length > 0) {
393
+ cached = "0.3.2";
394
394
  return cached;
395
395
  }
396
396
  cached = "unknown";