@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
@@ -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";
@@ -79670,26 +79670,43 @@ init_cjs_shims();
79670
79670
  var import_node_child_process3 = require("child_process");
79671
79671
  var fs6 = __toESM(require("fs"), 1);
79672
79672
  var path4 = __toESM(require("path"), 1);
79673
- function resolveAlembicBin(projectDir) {
79674
- const candidates = [
79673
+ var uvOnPath;
79674
+ function hasUv() {
79675
+ if (uvOnPath !== void 0) return uvOnPath;
79676
+ try {
79677
+ (0, import_node_child_process3.execFileSync)("uv", ["--version"], { stdio: "ignore" });
79678
+ uvOnPath = true;
79679
+ } catch {
79680
+ uvOnPath = false;
79681
+ }
79682
+ return uvOnPath;
79683
+ }
79684
+ function resolveAlembicInvocation(projectDir, uvAvailable = hasUv()) {
79685
+ const venvCandidates = [
79675
79686
  path4.join(projectDir, ".venv", "bin", "alembic"),
79676
79687
  path4.join(projectDir, "venv", "bin", "alembic")
79677
79688
  ];
79678
- for (const candidate of candidates) {
79689
+ for (const candidate of venvCandidates) {
79679
79690
  try {
79680
- if (fs6.existsSync(candidate)) return candidate;
79691
+ if (fs6.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
79681
79692
  } catch {
79682
79693
  }
79683
79694
  }
79684
- return "alembic";
79695
+ try {
79696
+ if (uvAvailable && fs6.existsSync(path4.join(projectDir, "pyproject.toml"))) {
79697
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
79698
+ }
79699
+ } catch {
79700
+ }
79701
+ return { bin: "alembic", prefixArgs: [] };
79685
79702
  }
79686
79703
  function spawnAlembic(projectDir, args, dsn) {
79687
79704
  return new Promise((resolve, reject) => {
79688
- const bin = resolveAlembicBin(projectDir);
79705
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir);
79689
79706
  const env = { ...process.env };
79690
79707
  env.PYTHONPATH = [projectDir, process.env.PYTHONPATH].filter(Boolean).join(path4.delimiter);
79691
79708
  if (dsn) env.DATABASE_URL = dsn;
79692
- const child = (0, import_node_child_process3.spawn)(bin, args, {
79709
+ const child = (0, import_node_child_process3.spawn)(bin, [...prefixArgs, ...args], {
79693
79710
  cwd: projectDir,
79694
79711
  env,
79695
79712
  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";
@@ -754,29 +754,46 @@ import * as fs6 from "fs";
754
754
  import * as path5 from "path";
755
755
 
756
756
  // scripts/lakebase/schema-migrate-runners/alembic.ts
757
- import { spawn } from "child_process";
757
+ import { spawn, execFileSync as execFileSync3 } from "child_process";
758
758
  import * as fs5 from "fs";
759
759
  import * as path4 from "path";
760
- function resolveAlembicBin(projectDir) {
761
- const candidates = [
760
+ var uvOnPath;
761
+ function hasUv() {
762
+ if (uvOnPath !== void 0) return uvOnPath;
763
+ try {
764
+ execFileSync3("uv", ["--version"], { stdio: "ignore" });
765
+ uvOnPath = true;
766
+ } catch {
767
+ uvOnPath = false;
768
+ }
769
+ return uvOnPath;
770
+ }
771
+ function resolveAlembicInvocation(projectDir, uvAvailable = hasUv()) {
772
+ const venvCandidates = [
762
773
  path4.join(projectDir, ".venv", "bin", "alembic"),
763
774
  path4.join(projectDir, "venv", "bin", "alembic")
764
775
  ];
765
- for (const candidate of candidates) {
776
+ for (const candidate of venvCandidates) {
766
777
  try {
767
- if (fs5.existsSync(candidate)) return candidate;
778
+ if (fs5.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
768
779
  } catch {
769
780
  }
770
781
  }
771
- return "alembic";
782
+ try {
783
+ if (uvAvailable && fs5.existsSync(path4.join(projectDir, "pyproject.toml"))) {
784
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
785
+ }
786
+ } catch {
787
+ }
788
+ return { bin: "alembic", prefixArgs: [] };
772
789
  }
773
790
  function spawnAlembic(projectDir, args, dsn) {
774
791
  return new Promise((resolve, reject) => {
775
- const bin = resolveAlembicBin(projectDir);
792
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir);
776
793
  const env = { ...process.env };
777
794
  env.PYTHONPATH = [projectDir, process.env.PYTHONPATH].filter(Boolean).join(path4.delimiter);
778
795
  if (dsn) env.DATABASE_URL = dsn;
779
- const child = spawn(bin, args, {
796
+ const child = spawn(bin, [...prefixArgs, ...args], {
780
797
  cwd: projectDir,
781
798
  env,
782
799
  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"]
@@ -79288,8 +79288,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79288
79288
  var cached;
79289
79289
  function substrateSelfVersion() {
79290
79290
  if (cached !== void 0) return cached;
79291
- if ("0.3.0".length > 0) {
79292
- cached = "0.3.0";
79291
+ if ("0.3.2".length > 0) {
79292
+ cached = "0.3.2";
79293
79293
  return cached;
79294
79294
  }
79295
79295
  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";
@@ -79324,8 +79324,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79324
79324
  var cached;
79325
79325
  function substrateSelfVersion() {
79326
79326
  if (cached !== void 0) return cached;
79327
- if ("0.3.0".length > 0) {
79328
- cached = "0.3.0";
79327
+ if ("0.3.2".length > 0) {
79328
+ cached = "0.3.2";
79329
79329
  return cached;
79330
79330
  }
79331
79331
  cached = "unknown";
@@ -79578,26 +79578,43 @@ init_cjs_shims();
79578
79578
  var import_node_child_process3 = require("child_process");
79579
79579
  var fs7 = __toESM(require("fs"), 1);
79580
79580
  var path5 = __toESM(require("path"), 1);
79581
- function resolveAlembicBin(projectDir) {
79582
- const candidates = [
79581
+ var uvOnPath;
79582
+ function hasUv() {
79583
+ if (uvOnPath !== void 0) return uvOnPath;
79584
+ try {
79585
+ (0, import_node_child_process3.execFileSync)("uv", ["--version"], { stdio: "ignore" });
79586
+ uvOnPath = true;
79587
+ } catch {
79588
+ uvOnPath = false;
79589
+ }
79590
+ return uvOnPath;
79591
+ }
79592
+ function resolveAlembicInvocation(projectDir, uvAvailable = hasUv()) {
79593
+ const venvCandidates = [
79583
79594
  path5.join(projectDir, ".venv", "bin", "alembic"),
79584
79595
  path5.join(projectDir, "venv", "bin", "alembic")
79585
79596
  ];
79586
- for (const candidate of candidates) {
79597
+ for (const candidate of venvCandidates) {
79587
79598
  try {
79588
- if (fs7.existsSync(candidate)) return candidate;
79599
+ if (fs7.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
79589
79600
  } catch {
79590
79601
  }
79591
79602
  }
79592
- return "alembic";
79603
+ try {
79604
+ if (uvAvailable && fs7.existsSync(path5.join(projectDir, "pyproject.toml"))) {
79605
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
79606
+ }
79607
+ } catch {
79608
+ }
79609
+ return { bin: "alembic", prefixArgs: [] };
79593
79610
  }
79594
79611
  function spawnAlembic(projectDir, args, dsn) {
79595
79612
  return new Promise((resolve2, reject) => {
79596
- const bin = resolveAlembicBin(projectDir);
79613
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir);
79597
79614
  const env = { ...process.env };
79598
79615
  env.PYTHONPATH = [projectDir, process.env.PYTHONPATH].filter(Boolean).join(path5.delimiter);
79599
79616
  if (dsn) env.DATABASE_URL = dsn;
79600
- const child = (0, import_node_child_process3.spawn)(bin, args, {
79617
+ const child = (0, import_node_child_process3.spawn)(bin, [...prefixArgs, ...args], {
79601
79618
  cwd: projectDir,
79602
79619
  env,
79603
79620
  stdio: ["ignore", "pipe", "pipe"]
@@ -427,8 +427,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
427
427
  var cached;
428
428
  function substrateSelfVersion() {
429
429
  if (cached !== void 0) return cached;
430
- if ("0.3.0".length > 0) {
431
- cached = "0.3.0";
430
+ if ("0.3.2".length > 0) {
431
+ cached = "0.3.2";
432
432
  return cached;
433
433
  }
434
434
  cached = "unknown";
@@ -674,29 +674,46 @@ import * as fs7 from "fs";
674
674
  import * as path6 from "path";
675
675
 
676
676
  // scripts/lakebase/schema-migrate-runners/alembic.ts
677
- import { spawn } from "child_process";
677
+ import { spawn, execFileSync as execFileSync3 } from "child_process";
678
678
  import * as fs6 from "fs";
679
679
  import * as path5 from "path";
680
- function resolveAlembicBin(projectDir) {
681
- const candidates = [
680
+ var uvOnPath;
681
+ function hasUv() {
682
+ if (uvOnPath !== void 0) return uvOnPath;
683
+ try {
684
+ execFileSync3("uv", ["--version"], { stdio: "ignore" });
685
+ uvOnPath = true;
686
+ } catch {
687
+ uvOnPath = false;
688
+ }
689
+ return uvOnPath;
690
+ }
691
+ function resolveAlembicInvocation(projectDir, uvAvailable = hasUv()) {
692
+ const venvCandidates = [
682
693
  path5.join(projectDir, ".venv", "bin", "alembic"),
683
694
  path5.join(projectDir, "venv", "bin", "alembic")
684
695
  ];
685
- for (const candidate of candidates) {
696
+ for (const candidate of venvCandidates) {
686
697
  try {
687
- if (fs6.existsSync(candidate)) return candidate;
698
+ if (fs6.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
688
699
  } catch {
689
700
  }
690
701
  }
691
- return "alembic";
702
+ try {
703
+ if (uvAvailable && fs6.existsSync(path5.join(projectDir, "pyproject.toml"))) {
704
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
705
+ }
706
+ } catch {
707
+ }
708
+ return { bin: "alembic", prefixArgs: [] };
692
709
  }
693
710
  function spawnAlembic(projectDir, args, dsn) {
694
711
  return new Promise((resolve2, reject) => {
695
- const bin = resolveAlembicBin(projectDir);
712
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir);
696
713
  const env = { ...process.env };
697
714
  env.PYTHONPATH = [projectDir, process.env.PYTHONPATH].filter(Boolean).join(path5.delimiter);
698
715
  if (dsn) env.DATABASE_URL = dsn;
699
- const child = spawn(bin, args, {
716
+ const child = spawn(bin, [...prefixArgs, ...args], {
700
717
  cwd: projectDir,
701
718
  env,
702
719
  stdio: ["ignore", "pipe", "pipe"]
@@ -79783,8 +79783,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
79783
79783
  var cached;
79784
79784
  function substrateSelfVersion() {
79785
79785
  if (cached !== void 0) return cached;
79786
- if ("0.3.0".length > 0) {
79787
- cached = "0.3.0";
79786
+ if ("0.3.2".length > 0) {
79787
+ cached = "0.3.2";
79788
79788
  return cached;
79789
79789
  }
79790
79790
  cached = "unknown";
@@ -80815,26 +80815,43 @@ init_cjs_shims();
80815
80815
  var import_node_child_process5 = require("child_process");
80816
80816
  var fs10 = __toESM(require("fs"), 1);
80817
80817
  var path8 = __toESM(require("path"), 1);
80818
- function resolveAlembicBin(projectDir) {
80819
- const candidates = [
80818
+ var uvOnPath;
80819
+ function hasUv() {
80820
+ if (uvOnPath !== void 0) return uvOnPath;
80821
+ try {
80822
+ (0, import_node_child_process5.execFileSync)("uv", ["--version"], { stdio: "ignore" });
80823
+ uvOnPath = true;
80824
+ } catch {
80825
+ uvOnPath = false;
80826
+ }
80827
+ return uvOnPath;
80828
+ }
80829
+ function resolveAlembicInvocation(projectDir, uvAvailable = hasUv()) {
80830
+ const venvCandidates = [
80820
80831
  path8.join(projectDir, ".venv", "bin", "alembic"),
80821
80832
  path8.join(projectDir, "venv", "bin", "alembic")
80822
80833
  ];
80823
- for (const candidate of candidates) {
80834
+ for (const candidate of venvCandidates) {
80824
80835
  try {
80825
- if (fs10.existsSync(candidate)) return candidate;
80836
+ if (fs10.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
80826
80837
  } catch {
80827
80838
  }
80828
80839
  }
80829
- return "alembic";
80840
+ try {
80841
+ if (uvAvailable && fs10.existsSync(path8.join(projectDir, "pyproject.toml"))) {
80842
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
80843
+ }
80844
+ } catch {
80845
+ }
80846
+ return { bin: "alembic", prefixArgs: [] };
80830
80847
  }
80831
80848
  function spawnAlembic(projectDir, args, dsn) {
80832
80849
  return new Promise((resolve3, reject) => {
80833
- const bin = resolveAlembicBin(projectDir);
80850
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir);
80834
80851
  const env = { ...process.env };
80835
80852
  env.PYTHONPATH = [projectDir, process.env.PYTHONPATH].filter(Boolean).join(path8.delimiter);
80836
80853
  if (dsn) env.DATABASE_URL = dsn;
80837
- const child = (0, import_node_child_process5.spawn)(bin, args, {
80854
+ const child = (0, import_node_child_process5.spawn)(bin, [...prefixArgs, ...args], {
80838
80855
  cwd: projectDir,
80839
80856
  env,
80840
80857
  stdio: ["ignore", "pipe", "pipe"]
@@ -864,8 +864,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
864
864
  var cached;
865
865
  function substrateSelfVersion() {
866
866
  if (cached !== void 0) return cached;
867
- if ("0.3.0".length > 0) {
868
- cached = "0.3.0";
867
+ if ("0.3.2".length > 0) {
868
+ cached = "0.3.2";
869
869
  return cached;
870
870
  }
871
871
  cached = "unknown";
@@ -1886,29 +1886,46 @@ import * as fs10 from "fs";
1886
1886
  import * as path9 from "path";
1887
1887
 
1888
1888
  // scripts/lakebase/schema-migrate-runners/alembic.ts
1889
- import { spawn } from "child_process";
1889
+ import { spawn, execFileSync as execFileSync5 } from "child_process";
1890
1890
  import * as fs9 from "fs";
1891
1891
  import * as path8 from "path";
1892
- function resolveAlembicBin(projectDir) {
1893
- const candidates = [
1892
+ var uvOnPath;
1893
+ function hasUv() {
1894
+ if (uvOnPath !== void 0) return uvOnPath;
1895
+ try {
1896
+ execFileSync5("uv", ["--version"], { stdio: "ignore" });
1897
+ uvOnPath = true;
1898
+ } catch {
1899
+ uvOnPath = false;
1900
+ }
1901
+ return uvOnPath;
1902
+ }
1903
+ function resolveAlembicInvocation(projectDir, uvAvailable = hasUv()) {
1904
+ const venvCandidates = [
1894
1905
  path8.join(projectDir, ".venv", "bin", "alembic"),
1895
1906
  path8.join(projectDir, "venv", "bin", "alembic")
1896
1907
  ];
1897
- for (const candidate of candidates) {
1908
+ for (const candidate of venvCandidates) {
1898
1909
  try {
1899
- if (fs9.existsSync(candidate)) return candidate;
1910
+ if (fs9.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
1900
1911
  } catch {
1901
1912
  }
1902
1913
  }
1903
- return "alembic";
1914
+ try {
1915
+ if (uvAvailable && fs9.existsSync(path8.join(projectDir, "pyproject.toml"))) {
1916
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
1917
+ }
1918
+ } catch {
1919
+ }
1920
+ return { bin: "alembic", prefixArgs: [] };
1904
1921
  }
1905
1922
  function spawnAlembic(projectDir, args, dsn) {
1906
1923
  return new Promise((resolve3, reject) => {
1907
- const bin = resolveAlembicBin(projectDir);
1924
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir);
1908
1925
  const env = { ...process.env };
1909
1926
  env.PYTHONPATH = [projectDir, process.env.PYTHONPATH].filter(Boolean).join(path8.delimiter);
1910
1927
  if (dsn) env.DATABASE_URL = dsn;
1911
- const child = spawn(bin, args, {
1928
+ const child = spawn(bin, [...prefixArgs, ...args], {
1912
1929
  cwd: projectDir,
1913
1930
  env,
1914
1931
  stdio: ["ignore", "pipe", "pipe"]
@@ -88240,8 +88240,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
88240
88240
  var cached;
88241
88241
  function substrateSelfVersion() {
88242
88242
  if (cached !== void 0) return cached;
88243
- if ("0.3.0".length > 0) {
88244
- cached = "0.3.0";
88243
+ if ("0.3.2".length > 0) {
88244
+ cached = "0.3.2";
88245
88245
  return cached;
88246
88246
  }
88247
88247
  cached = "unknown";
@@ -89118,26 +89118,43 @@ init_cjs_shims();
89118
89118
  var import_node_child_process6 = require("child_process");
89119
89119
  var fs9 = __toESM(require("fs"), 1);
89120
89120
  var path7 = __toESM(require("path"), 1);
89121
- function resolveAlembicBin(projectDir) {
89122
- const candidates = [
89121
+ var uvOnPath;
89122
+ function hasUv() {
89123
+ if (uvOnPath !== void 0) return uvOnPath;
89124
+ try {
89125
+ (0, import_node_child_process6.execFileSync)("uv", ["--version"], { stdio: "ignore" });
89126
+ uvOnPath = true;
89127
+ } catch {
89128
+ uvOnPath = false;
89129
+ }
89130
+ return uvOnPath;
89131
+ }
89132
+ function resolveAlembicInvocation(projectDir, uvAvailable = hasUv()) {
89133
+ const venvCandidates = [
89123
89134
  path7.join(projectDir, ".venv", "bin", "alembic"),
89124
89135
  path7.join(projectDir, "venv", "bin", "alembic")
89125
89136
  ];
89126
- for (const candidate of candidates) {
89137
+ for (const candidate of venvCandidates) {
89127
89138
  try {
89128
- if (fs9.existsSync(candidate)) return candidate;
89139
+ if (fs9.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
89129
89140
  } catch {
89130
89141
  }
89131
89142
  }
89132
- return "alembic";
89143
+ try {
89144
+ if (uvAvailable && fs9.existsSync(path7.join(projectDir, "pyproject.toml"))) {
89145
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
89146
+ }
89147
+ } catch {
89148
+ }
89149
+ return { bin: "alembic", prefixArgs: [] };
89133
89150
  }
89134
89151
  function spawnAlembic(projectDir, args, dsn) {
89135
89152
  return new Promise((resolve3, reject) => {
89136
- const bin = resolveAlembicBin(projectDir);
89153
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir);
89137
89154
  const env = { ...process.env };
89138
89155
  env.PYTHONPATH = [projectDir, process.env.PYTHONPATH].filter(Boolean).join(path7.delimiter);
89139
89156
  if (dsn) env.DATABASE_URL = dsn;
89140
- const child = (0, import_node_child_process6.spawn)(bin, args, {
89157
+ const child = (0, import_node_child_process6.spawn)(bin, [...prefixArgs, ...args], {
89141
89158
  cwd: projectDir,
89142
89159
  env,
89143
89160
  stdio: ["ignore", "pipe", "pipe"]
@@ -9393,8 +9393,8 @@ var PKG_NAME = "@databricks-solutions/lakebase-scm-utils";
9393
9393
  var cached;
9394
9394
  function substrateSelfVersion() {
9395
9395
  if (cached !== void 0) return cached;
9396
- if ("0.3.0".length > 0) {
9397
- cached = "0.3.0";
9396
+ if ("0.3.2".length > 0) {
9397
+ cached = "0.3.2";
9398
9398
  return cached;
9399
9399
  }
9400
9400
  cached = "unknown";
@@ -10268,29 +10268,46 @@ import * as path9 from "path";
10268
10268
 
10269
10269
  // scripts/lakebase/schema-migrate-runners/alembic.ts
10270
10270
  init_esm_shims();
10271
- import { spawn } from "child_process";
10271
+ import { spawn, execFileSync as execFileSync6 } from "child_process";
10272
10272
  import * as fs8 from "fs";
10273
10273
  import * as path8 from "path";
10274
- function resolveAlembicBin(projectDir) {
10275
- const candidates = [
10274
+ var uvOnPath;
10275
+ function hasUv() {
10276
+ if (uvOnPath !== void 0) return uvOnPath;
10277
+ try {
10278
+ execFileSync6("uv", ["--version"], { stdio: "ignore" });
10279
+ uvOnPath = true;
10280
+ } catch {
10281
+ uvOnPath = false;
10282
+ }
10283
+ return uvOnPath;
10284
+ }
10285
+ function resolveAlembicInvocation(projectDir, uvAvailable = hasUv()) {
10286
+ const venvCandidates = [
10276
10287
  path8.join(projectDir, ".venv", "bin", "alembic"),
10277
10288
  path8.join(projectDir, "venv", "bin", "alembic")
10278
10289
  ];
10279
- for (const candidate of candidates) {
10290
+ for (const candidate of venvCandidates) {
10280
10291
  try {
10281
- if (fs8.existsSync(candidate)) return candidate;
10292
+ if (fs8.existsSync(candidate)) return { bin: candidate, prefixArgs: [] };
10282
10293
  } catch {
10283
10294
  }
10284
10295
  }
10285
- return "alembic";
10296
+ try {
10297
+ if (uvAvailable && fs8.existsSync(path8.join(projectDir, "pyproject.toml"))) {
10298
+ return { bin: "uv", prefixArgs: ["run", "alembic"] };
10299
+ }
10300
+ } catch {
10301
+ }
10302
+ return { bin: "alembic", prefixArgs: [] };
10286
10303
  }
10287
10304
  function spawnAlembic(projectDir, args, dsn) {
10288
10305
  return new Promise((resolve3, reject) => {
10289
- const bin = resolveAlembicBin(projectDir);
10306
+ const { bin, prefixArgs } = resolveAlembicInvocation(projectDir);
10290
10307
  const env = { ...process.env };
10291
10308
  env.PYTHONPATH = [projectDir, process.env.PYTHONPATH].filter(Boolean).join(path8.delimiter);
10292
10309
  if (dsn) env.DATABASE_URL = dsn;
10293
- const child = spawn(bin, args, {
10310
+ const child = spawn(bin, [...prefixArgs, ...args], {
10294
10311
  cwd: projectDir,
10295
10312
  env,
10296
10313
  stdio: ["ignore", "pipe", "pipe"]