drizzle-kit 0.19.0-3126e54 → 0.19.0-c1c76b7

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 (2) hide show
  1. package/index.cjs +54 -859
  2. package/package.json +1 -1
package/index.cjs CHANGED
@@ -4202,7 +4202,7 @@ var require_hanji = __commonJS({
4202
4202
  return;
4203
4203
  }
4204
4204
  exports.render = render6;
4205
- function renderWithTask3(view, task) {
4205
+ function renderWithTask4(view, task) {
4206
4206
  return __awaiter(this, void 0, void 0, function* () {
4207
4207
  const terminal = new TaskTerminal(view, process.stdout);
4208
4208
  terminal.requestLayout();
@@ -4211,7 +4211,7 @@ var require_hanji = __commonJS({
4211
4211
  return result;
4212
4212
  });
4213
4213
  }
4214
- exports.renderWithTask = renderWithTask3;
4214
+ exports.renderWithTask = renderWithTask4;
4215
4215
  var terminateHandler;
4216
4216
  function onTerminate(callback) {
4217
4217
  terminateHandler = callback;
@@ -30573,823 +30573,6 @@ var init_mysqlIntrospect = __esm({
30573
30573
  }
30574
30574
  });
30575
30575
 
30576
- // node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/util.js
30577
- var require_util = __commonJS({
30578
- "node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/util.js"(exports) {
30579
- "use strict";
30580
- exports.getBooleanOption = (options, key) => {
30581
- let value = false;
30582
- if (key in options && typeof (value = options[key]) !== "boolean") {
30583
- throw new TypeError(`Expected the "${key}" option to be a boolean`);
30584
- }
30585
- return value;
30586
- };
30587
- exports.cppdb = Symbol();
30588
- exports.inspect = Symbol.for("nodejs.util.inspect.custom");
30589
- }
30590
- });
30591
-
30592
- // node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/sqlite-error.js
30593
- var require_sqlite_error = __commonJS({
30594
- "node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/sqlite-error.js"(exports, module2) {
30595
- "use strict";
30596
- var descriptor = { value: "SqliteError", writable: true, enumerable: false, configurable: true };
30597
- function SqliteError(message, code) {
30598
- if (new.target !== SqliteError) {
30599
- return new SqliteError(message, code);
30600
- }
30601
- if (typeof code !== "string") {
30602
- throw new TypeError("Expected second argument to be a string");
30603
- }
30604
- Error.call(this, message);
30605
- descriptor.value = "" + message;
30606
- Object.defineProperty(this, "message", descriptor);
30607
- Error.captureStackTrace(this, SqliteError);
30608
- this.code = code;
30609
- }
30610
- Object.setPrototypeOf(SqliteError, Error);
30611
- Object.setPrototypeOf(SqliteError.prototype, Error.prototype);
30612
- Object.defineProperty(SqliteError.prototype, "name", descriptor);
30613
- module2.exports = SqliteError;
30614
- }
30615
- });
30616
-
30617
- // node_modules/.pnpm/file-uri-to-path@1.0.0/node_modules/file-uri-to-path/index.js
30618
- var require_file_uri_to_path = __commonJS({
30619
- "node_modules/.pnpm/file-uri-to-path@1.0.0/node_modules/file-uri-to-path/index.js"(exports, module2) {
30620
- var sep2 = require("path").sep || "/";
30621
- module2.exports = fileUriToPath;
30622
- function fileUriToPath(uri) {
30623
- if ("string" != typeof uri || uri.length <= 7 || "file://" != uri.substring(0, 7)) {
30624
- throw new TypeError("must pass in a file:// URI to convert to a file path");
30625
- }
30626
- var rest = decodeURI(uri.substring(7));
30627
- var firstSlash = rest.indexOf("/");
30628
- var host = rest.substring(0, firstSlash);
30629
- var path3 = rest.substring(firstSlash + 1);
30630
- if ("localhost" == host)
30631
- host = "";
30632
- if (host) {
30633
- host = sep2 + sep2 + host;
30634
- }
30635
- path3 = path3.replace(/^(.+)\|/, "$1:");
30636
- if (sep2 == "\\") {
30637
- path3 = path3.replace(/\//g, "\\");
30638
- }
30639
- if (/^.+\:/.test(path3)) {
30640
- } else {
30641
- path3 = sep2 + path3;
30642
- }
30643
- return host + path3;
30644
- }
30645
- }
30646
- });
30647
-
30648
- // node_modules/.pnpm/bindings@1.5.0/node_modules/bindings/bindings.js
30649
- var require_bindings = __commonJS({
30650
- "node_modules/.pnpm/bindings@1.5.0/node_modules/bindings/bindings.js"(exports, module2) {
30651
- var fs6 = require("fs");
30652
- var path3 = require("path");
30653
- var fileURLToPath = require_file_uri_to_path();
30654
- var join6 = path3.join;
30655
- var dirname = path3.dirname;
30656
- var exists = fs6.accessSync && function(path4) {
30657
- try {
30658
- fs6.accessSync(path4);
30659
- } catch (e) {
30660
- return false;
30661
- }
30662
- return true;
30663
- } || fs6.existsSync || path3.existsSync;
30664
- var defaults2 = {
30665
- arrow: process.env.NODE_BINDINGS_ARROW || " \u2192 ",
30666
- compiled: process.env.NODE_BINDINGS_COMPILED_DIR || "compiled",
30667
- platform: process.platform,
30668
- arch: process.arch,
30669
- nodePreGyp: "node-v" + process.versions.modules + "-" + process.platform + "-" + process.arch,
30670
- version: process.versions.node,
30671
- bindings: "bindings.node",
30672
- try: [
30673
- // node-gyp's linked version in the "build" dir
30674
- ["module_root", "build", "bindings"],
30675
- // node-waf and gyp_addon (a.k.a node-gyp)
30676
- ["module_root", "build", "Debug", "bindings"],
30677
- ["module_root", "build", "Release", "bindings"],
30678
- // Debug files, for development (legacy behavior, remove for node v0.9)
30679
- ["module_root", "out", "Debug", "bindings"],
30680
- ["module_root", "Debug", "bindings"],
30681
- // Release files, but manually compiled (legacy behavior, remove for node v0.9)
30682
- ["module_root", "out", "Release", "bindings"],
30683
- ["module_root", "Release", "bindings"],
30684
- // Legacy from node-waf, node <= 0.4.x
30685
- ["module_root", "build", "default", "bindings"],
30686
- // Production "Release" buildtype binary (meh...)
30687
- ["module_root", "compiled", "version", "platform", "arch", "bindings"],
30688
- // node-qbs builds
30689
- ["module_root", "addon-build", "release", "install-root", "bindings"],
30690
- ["module_root", "addon-build", "debug", "install-root", "bindings"],
30691
- ["module_root", "addon-build", "default", "install-root", "bindings"],
30692
- // node-pre-gyp path ./lib/binding/{node_abi}-{platform}-{arch}
30693
- ["module_root", "lib", "binding", "nodePreGyp", "bindings"]
30694
- ]
30695
- };
30696
- function bindings(opts) {
30697
- if (typeof opts == "string") {
30698
- opts = { bindings: opts };
30699
- } else if (!opts) {
30700
- opts = {};
30701
- }
30702
- Object.keys(defaults2).map(function(i2) {
30703
- if (!(i2 in opts))
30704
- opts[i2] = defaults2[i2];
30705
- });
30706
- if (!opts.module_root) {
30707
- opts.module_root = exports.getRoot(exports.getFileName());
30708
- }
30709
- if (path3.extname(opts.bindings) != ".node") {
30710
- opts.bindings += ".node";
30711
- }
30712
- var requireFunc = typeof __webpack_require__ === "function" ? __non_webpack_require__ : require;
30713
- var tries = [], i = 0, l = opts.try.length, n, b, err2;
30714
- for (; i < l; i++) {
30715
- n = join6.apply(
30716
- null,
30717
- opts.try[i].map(function(p) {
30718
- return opts[p] || p;
30719
- })
30720
- );
30721
- tries.push(n);
30722
- try {
30723
- b = opts.path ? requireFunc.resolve(n) : requireFunc(n);
30724
- if (!opts.path) {
30725
- b.path = n;
30726
- }
30727
- return b;
30728
- } catch (e) {
30729
- if (e.code !== "MODULE_NOT_FOUND" && e.code !== "QUALIFIED_PATH_RESOLUTION_FAILED" && !/not find/i.test(e.message)) {
30730
- throw e;
30731
- }
30732
- }
30733
- }
30734
- err2 = new Error(
30735
- "Could not locate the bindings file. Tried:\n" + tries.map(function(a) {
30736
- return opts.arrow + a;
30737
- }).join("\n")
30738
- );
30739
- err2.tries = tries;
30740
- throw err2;
30741
- }
30742
- module2.exports = exports = bindings;
30743
- exports.getFileName = function getFileName(calling_file) {
30744
- var origPST = Error.prepareStackTrace, origSTL = Error.stackTraceLimit, dummy = {}, fileName;
30745
- Error.stackTraceLimit = 10;
30746
- Error.prepareStackTrace = function(e, st) {
30747
- for (var i = 0, l = st.length; i < l; i++) {
30748
- fileName = st[i].getFileName();
30749
- if (fileName !== __filename) {
30750
- if (calling_file) {
30751
- if (fileName !== calling_file) {
30752
- return;
30753
- }
30754
- } else {
30755
- return;
30756
- }
30757
- }
30758
- }
30759
- };
30760
- Error.captureStackTrace(dummy);
30761
- dummy.stack;
30762
- Error.prepareStackTrace = origPST;
30763
- Error.stackTraceLimit = origSTL;
30764
- var fileSchema = "file://";
30765
- if (fileName.indexOf(fileSchema) === 0) {
30766
- fileName = fileURLToPath(fileName);
30767
- }
30768
- return fileName;
30769
- };
30770
- exports.getRoot = function getRoot(file) {
30771
- var dir = dirname(file), prev;
30772
- while (true) {
30773
- if (dir === ".") {
30774
- dir = process.cwd();
30775
- }
30776
- if (exists(join6(dir, "package.json")) || exists(join6(dir, "node_modules"))) {
30777
- return dir;
30778
- }
30779
- if (prev === dir) {
30780
- throw new Error(
30781
- 'Could not find module root given file: "' + file + '". Do you have a `package.json` file? '
30782
- );
30783
- }
30784
- prev = dir;
30785
- dir = join6(dir, "..");
30786
- }
30787
- };
30788
- }
30789
- });
30790
-
30791
- // node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/wrappers.js
30792
- var require_wrappers = __commonJS({
30793
- "node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/wrappers.js"(exports) {
30794
- "use strict";
30795
- var { cppdb } = require_util();
30796
- exports.prepare = function prepare(sql) {
30797
- return this[cppdb].prepare(sql, this, false);
30798
- };
30799
- exports.exec = function exec(sql) {
30800
- this[cppdb].exec(sql);
30801
- return this;
30802
- };
30803
- exports.close = function close() {
30804
- this[cppdb].close();
30805
- return this;
30806
- };
30807
- exports.loadExtension = function loadExtension(...args) {
30808
- this[cppdb].loadExtension(...args);
30809
- return this;
30810
- };
30811
- exports.defaultSafeIntegers = function defaultSafeIntegers(...args) {
30812
- this[cppdb].defaultSafeIntegers(...args);
30813
- return this;
30814
- };
30815
- exports.unsafeMode = function unsafeMode(...args) {
30816
- this[cppdb].unsafeMode(...args);
30817
- return this;
30818
- };
30819
- exports.getters = {
30820
- name: {
30821
- get: function name() {
30822
- return this[cppdb].name;
30823
- },
30824
- enumerable: true
30825
- },
30826
- open: {
30827
- get: function open2() {
30828
- return this[cppdb].open;
30829
- },
30830
- enumerable: true
30831
- },
30832
- inTransaction: {
30833
- get: function inTransaction() {
30834
- return this[cppdb].inTransaction;
30835
- },
30836
- enumerable: true
30837
- },
30838
- readonly: {
30839
- get: function readonly() {
30840
- return this[cppdb].readonly;
30841
- },
30842
- enumerable: true
30843
- },
30844
- memory: {
30845
- get: function memory() {
30846
- return this[cppdb].memory;
30847
- },
30848
- enumerable: true
30849
- }
30850
- };
30851
- }
30852
- });
30853
-
30854
- // node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/transaction.js
30855
- var require_transaction = __commonJS({
30856
- "node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/transaction.js"(exports, module2) {
30857
- "use strict";
30858
- var { cppdb } = require_util();
30859
- var controllers = /* @__PURE__ */ new WeakMap();
30860
- module2.exports = function transaction(fn) {
30861
- if (typeof fn !== "function")
30862
- throw new TypeError("Expected first argument to be a function");
30863
- const db = this[cppdb];
30864
- const controller = getController(db, this);
30865
- const { apply } = Function.prototype;
30866
- const properties = {
30867
- default: { value: wrapTransaction(apply, fn, db, controller.default) },
30868
- deferred: { value: wrapTransaction(apply, fn, db, controller.deferred) },
30869
- immediate: { value: wrapTransaction(apply, fn, db, controller.immediate) },
30870
- exclusive: { value: wrapTransaction(apply, fn, db, controller.exclusive) },
30871
- database: { value: this, enumerable: true }
30872
- };
30873
- Object.defineProperties(properties.default.value, properties);
30874
- Object.defineProperties(properties.deferred.value, properties);
30875
- Object.defineProperties(properties.immediate.value, properties);
30876
- Object.defineProperties(properties.exclusive.value, properties);
30877
- return properties.default.value;
30878
- };
30879
- var getController = (db, self2) => {
30880
- let controller = controllers.get(db);
30881
- if (!controller) {
30882
- const shared = {
30883
- commit: db.prepare("COMMIT", self2, false),
30884
- rollback: db.prepare("ROLLBACK", self2, false),
30885
- savepoint: db.prepare("SAVEPOINT ` _bs3. `", self2, false),
30886
- release: db.prepare("RELEASE ` _bs3. `", self2, false),
30887
- rollbackTo: db.prepare("ROLLBACK TO ` _bs3. `", self2, false)
30888
- };
30889
- controllers.set(db, controller = {
30890
- default: Object.assign({ begin: db.prepare("BEGIN", self2, false) }, shared),
30891
- deferred: Object.assign({ begin: db.prepare("BEGIN DEFERRED", self2, false) }, shared),
30892
- immediate: Object.assign({ begin: db.prepare("BEGIN IMMEDIATE", self2, false) }, shared),
30893
- exclusive: Object.assign({ begin: db.prepare("BEGIN EXCLUSIVE", self2, false) }, shared)
30894
- });
30895
- }
30896
- return controller;
30897
- };
30898
- var wrapTransaction = (apply, fn, db, { begin, commit, rollback, savepoint, release, rollbackTo }) => function sqliteTransaction() {
30899
- let before, after, undo;
30900
- if (db.inTransaction) {
30901
- before = savepoint;
30902
- after = release;
30903
- undo = rollbackTo;
30904
- } else {
30905
- before = begin;
30906
- after = commit;
30907
- undo = rollback;
30908
- }
30909
- before.run();
30910
- try {
30911
- const result = apply.call(fn, this, arguments);
30912
- after.run();
30913
- return result;
30914
- } catch (ex) {
30915
- if (db.inTransaction) {
30916
- undo.run();
30917
- if (undo !== rollback)
30918
- after.run();
30919
- }
30920
- throw ex;
30921
- }
30922
- };
30923
- }
30924
- });
30925
-
30926
- // node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/pragma.js
30927
- var require_pragma = __commonJS({
30928
- "node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/pragma.js"(exports, module2) {
30929
- "use strict";
30930
- var { getBooleanOption, cppdb } = require_util();
30931
- module2.exports = function pragma(source, options) {
30932
- if (options == null)
30933
- options = {};
30934
- if (typeof source !== "string")
30935
- throw new TypeError("Expected first argument to be a string");
30936
- if (typeof options !== "object")
30937
- throw new TypeError("Expected second argument to be an options object");
30938
- const simple = getBooleanOption(options, "simple");
30939
- const stmt = this[cppdb].prepare(`PRAGMA ${source}`, this, true);
30940
- return simple ? stmt.pluck().get() : stmt.all();
30941
- };
30942
- }
30943
- });
30944
-
30945
- // node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/backup.js
30946
- var require_backup = __commonJS({
30947
- "node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/backup.js"(exports, module2) {
30948
- "use strict";
30949
- var fs6 = require("fs");
30950
- var path3 = require("path");
30951
- var { promisify } = require("util");
30952
- var { cppdb } = require_util();
30953
- var fsAccess = promisify(fs6.access);
30954
- module2.exports = async function backup(filename, options) {
30955
- if (options == null)
30956
- options = {};
30957
- if (typeof filename !== "string")
30958
- throw new TypeError("Expected first argument to be a string");
30959
- if (typeof options !== "object")
30960
- throw new TypeError("Expected second argument to be an options object");
30961
- filename = filename.trim();
30962
- const attachedName = "attached" in options ? options.attached : "main";
30963
- const handler = "progress" in options ? options.progress : null;
30964
- if (!filename)
30965
- throw new TypeError("Backup filename cannot be an empty string");
30966
- if (filename === ":memory:")
30967
- throw new TypeError('Invalid backup filename ":memory:"');
30968
- if (typeof attachedName !== "string")
30969
- throw new TypeError('Expected the "attached" option to be a string');
30970
- if (!attachedName)
30971
- throw new TypeError('The "attached" option cannot be an empty string');
30972
- if (handler != null && typeof handler !== "function")
30973
- throw new TypeError('Expected the "progress" option to be a function');
30974
- await fsAccess(path3.dirname(filename)).catch(() => {
30975
- throw new TypeError("Cannot save backup because the directory does not exist");
30976
- });
30977
- const isNewFile = await fsAccess(filename).then(() => false, () => true);
30978
- return runBackup(this[cppdb].backup(this, attachedName, filename, isNewFile), handler || null);
30979
- };
30980
- var runBackup = (backup, handler) => {
30981
- let rate = 0;
30982
- let useDefault = true;
30983
- return new Promise((resolve2, reject) => {
30984
- setImmediate(function step() {
30985
- try {
30986
- const progress = backup.transfer(rate);
30987
- if (!progress.remainingPages) {
30988
- backup.close();
30989
- resolve2(progress);
30990
- return;
30991
- }
30992
- if (useDefault) {
30993
- useDefault = false;
30994
- rate = 100;
30995
- }
30996
- if (handler) {
30997
- const ret = handler(progress);
30998
- if (ret !== void 0) {
30999
- if (typeof ret === "number" && ret === ret)
31000
- rate = Math.max(0, Math.min(2147483647, Math.round(ret)));
31001
- else
31002
- throw new TypeError("Expected progress callback to return a number or undefined");
31003
- }
31004
- }
31005
- setImmediate(step);
31006
- } catch (err2) {
31007
- backup.close();
31008
- reject(err2);
31009
- }
31010
- });
31011
- });
31012
- };
31013
- }
31014
- });
31015
-
31016
- // node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/serialize.js
31017
- var require_serialize = __commonJS({
31018
- "node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/serialize.js"(exports, module2) {
31019
- "use strict";
31020
- var { cppdb } = require_util();
31021
- module2.exports = function serialize(options) {
31022
- if (options == null)
31023
- options = {};
31024
- if (typeof options !== "object")
31025
- throw new TypeError("Expected first argument to be an options object");
31026
- const attachedName = "attached" in options ? options.attached : "main";
31027
- if (typeof attachedName !== "string")
31028
- throw new TypeError('Expected the "attached" option to be a string');
31029
- if (!attachedName)
31030
- throw new TypeError('The "attached" option cannot be an empty string');
31031
- return this[cppdb].serialize(attachedName);
31032
- };
31033
- }
31034
- });
31035
-
31036
- // node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/function.js
31037
- var require_function = __commonJS({
31038
- "node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/function.js"(exports, module2) {
31039
- "use strict";
31040
- var { getBooleanOption, cppdb } = require_util();
31041
- module2.exports = function defineFunction(name, options, fn) {
31042
- if (options == null)
31043
- options = {};
31044
- if (typeof options === "function") {
31045
- fn = options;
31046
- options = {};
31047
- }
31048
- if (typeof name !== "string")
31049
- throw new TypeError("Expected first argument to be a string");
31050
- if (typeof fn !== "function")
31051
- throw new TypeError("Expected last argument to be a function");
31052
- if (typeof options !== "object")
31053
- throw new TypeError("Expected second argument to be an options object");
31054
- if (!name)
31055
- throw new TypeError("User-defined function name cannot be an empty string");
31056
- const safeIntegers = "safeIntegers" in options ? +getBooleanOption(options, "safeIntegers") : 2;
31057
- const deterministic = getBooleanOption(options, "deterministic");
31058
- const directOnly = getBooleanOption(options, "directOnly");
31059
- const varargs = getBooleanOption(options, "varargs");
31060
- let argCount = -1;
31061
- if (!varargs) {
31062
- argCount = fn.length;
31063
- if (!Number.isInteger(argCount) || argCount < 0)
31064
- throw new TypeError("Expected function.length to be a positive integer");
31065
- if (argCount > 100)
31066
- throw new RangeError("User-defined functions cannot have more than 100 arguments");
31067
- }
31068
- this[cppdb].function(fn, name, argCount, safeIntegers, deterministic, directOnly);
31069
- return this;
31070
- };
31071
- }
31072
- });
31073
-
31074
- // node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/aggregate.js
31075
- var require_aggregate = __commonJS({
31076
- "node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/aggregate.js"(exports, module2) {
31077
- "use strict";
31078
- var { getBooleanOption, cppdb } = require_util();
31079
- module2.exports = function defineAggregate(name, options) {
31080
- if (typeof name !== "string")
31081
- throw new TypeError("Expected first argument to be a string");
31082
- if (typeof options !== "object" || options === null)
31083
- throw new TypeError("Expected second argument to be an options object");
31084
- if (!name)
31085
- throw new TypeError("User-defined function name cannot be an empty string");
31086
- const start = "start" in options ? options.start : null;
31087
- const step = getFunctionOption(options, "step", true);
31088
- const inverse = getFunctionOption(options, "inverse", false);
31089
- const result = getFunctionOption(options, "result", false);
31090
- const safeIntegers = "safeIntegers" in options ? +getBooleanOption(options, "safeIntegers") : 2;
31091
- const deterministic = getBooleanOption(options, "deterministic");
31092
- const directOnly = getBooleanOption(options, "directOnly");
31093
- const varargs = getBooleanOption(options, "varargs");
31094
- let argCount = -1;
31095
- if (!varargs) {
31096
- argCount = Math.max(getLength(step), inverse ? getLength(inverse) : 0);
31097
- if (argCount > 0)
31098
- argCount -= 1;
31099
- if (argCount > 100)
31100
- throw new RangeError("User-defined functions cannot have more than 100 arguments");
31101
- }
31102
- this[cppdb].aggregate(start, step, inverse, result, name, argCount, safeIntegers, deterministic, directOnly);
31103
- return this;
31104
- };
31105
- var getFunctionOption = (options, key, required) => {
31106
- const value = key in options ? options[key] : null;
31107
- if (typeof value === "function")
31108
- return value;
31109
- if (value != null)
31110
- throw new TypeError(`Expected the "${key}" option to be a function`);
31111
- if (required)
31112
- throw new TypeError(`Missing required option "${key}"`);
31113
- return null;
31114
- };
31115
- var getLength = ({ length }) => {
31116
- if (Number.isInteger(length) && length >= 0)
31117
- return length;
31118
- throw new TypeError("Expected function.length to be a positive integer");
31119
- };
31120
- }
31121
- });
31122
-
31123
- // node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/table.js
31124
- var require_table = __commonJS({
31125
- "node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/table.js"(exports, module2) {
31126
- "use strict";
31127
- var { cppdb } = require_util();
31128
- module2.exports = function defineTable(name, factory) {
31129
- if (typeof name !== "string")
31130
- throw new TypeError("Expected first argument to be a string");
31131
- if (!name)
31132
- throw new TypeError("Virtual table module name cannot be an empty string");
31133
- let eponymous = false;
31134
- if (typeof factory === "object" && factory !== null) {
31135
- eponymous = true;
31136
- factory = defer(parseTableDefinition(factory, "used", name));
31137
- } else {
31138
- if (typeof factory !== "function")
31139
- throw new TypeError("Expected second argument to be a function or a table definition object");
31140
- factory = wrapFactory(factory);
31141
- }
31142
- this[cppdb].table(factory, name, eponymous);
31143
- return this;
31144
- };
31145
- function wrapFactory(factory) {
31146
- return function virtualTableFactory(moduleName, databaseName, tableName, ...args) {
31147
- const thisObject = {
31148
- module: moduleName,
31149
- database: databaseName,
31150
- table: tableName
31151
- };
31152
- const def = apply.call(factory, thisObject, args);
31153
- if (typeof def !== "object" || def === null) {
31154
- throw new TypeError(`Virtual table module "${moduleName}" did not return a table definition object`);
31155
- }
31156
- return parseTableDefinition(def, "returned", moduleName);
31157
- };
31158
- }
31159
- function parseTableDefinition(def, verb, moduleName) {
31160
- if (!hasOwnProperty.call(def, "rows")) {
31161
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition without a "rows" property`);
31162
- }
31163
- if (!hasOwnProperty.call(def, "columns")) {
31164
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition without a "columns" property`);
31165
- }
31166
- const rows = def.rows;
31167
- if (typeof rows !== "function" || Object.getPrototypeOf(rows) !== GeneratorFunctionPrototype) {
31168
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "rows" property (should be a generator function)`);
31169
- }
31170
- let columns = def.columns;
31171
- if (!Array.isArray(columns) || !(columns = [...columns]).every((x) => typeof x === "string")) {
31172
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "columns" property (should be an array of strings)`);
31173
- }
31174
- if (columns.length !== new Set(columns).size) {
31175
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with duplicate column names`);
31176
- }
31177
- if (!columns.length) {
31178
- throw new RangeError(`Virtual table module "${moduleName}" ${verb} a table definition with zero columns`);
31179
- }
31180
- let parameters;
31181
- if (hasOwnProperty.call(def, "parameters")) {
31182
- parameters = def.parameters;
31183
- if (!Array.isArray(parameters) || !(parameters = [...parameters]).every((x) => typeof x === "string")) {
31184
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "parameters" property (should be an array of strings)`);
31185
- }
31186
- } else {
31187
- parameters = inferParameters(rows);
31188
- }
31189
- if (parameters.length !== new Set(parameters).size) {
31190
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with duplicate parameter names`);
31191
- }
31192
- if (parameters.length > 32) {
31193
- throw new RangeError(`Virtual table module "${moduleName}" ${verb} a table definition with more than the maximum number of 32 parameters`);
31194
- }
31195
- for (const parameter of parameters) {
31196
- if (columns.includes(parameter)) {
31197
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with column "${parameter}" which was ambiguously defined as both a column and parameter`);
31198
- }
31199
- }
31200
- let safeIntegers = 2;
31201
- if (hasOwnProperty.call(def, "safeIntegers")) {
31202
- const bool = def.safeIntegers;
31203
- if (typeof bool !== "boolean") {
31204
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "safeIntegers" property (should be a boolean)`);
31205
- }
31206
- safeIntegers = +bool;
31207
- }
31208
- let directOnly = false;
31209
- if (hasOwnProperty.call(def, "directOnly")) {
31210
- directOnly = def.directOnly;
31211
- if (typeof directOnly !== "boolean") {
31212
- throw new TypeError(`Virtual table module "${moduleName}" ${verb} a table definition with an invalid "directOnly" property (should be a boolean)`);
31213
- }
31214
- }
31215
- const columnDefinitions = [
31216
- ...parameters.map(identifier).map((str) => `${str} HIDDEN`),
31217
- ...columns.map(identifier)
31218
- ];
31219
- return [
31220
- `CREATE TABLE x(${columnDefinitions.join(", ")});`,
31221
- wrapGenerator(rows, new Map(columns.map((x, i) => [x, parameters.length + i])), moduleName),
31222
- parameters,
31223
- safeIntegers,
31224
- directOnly
31225
- ];
31226
- }
31227
- function wrapGenerator(generator, columnMap, moduleName) {
31228
- return function* virtualTable(...args) {
31229
- const output = args.map((x) => Buffer.isBuffer(x) ? Buffer.from(x) : x);
31230
- for (let i = 0; i < columnMap.size; ++i) {
31231
- output.push(null);
31232
- }
31233
- for (const row of generator(...args)) {
31234
- if (Array.isArray(row)) {
31235
- extractRowArray(row, output, columnMap.size, moduleName);
31236
- yield output;
31237
- } else if (typeof row === "object" && row !== null) {
31238
- extractRowObject(row, output, columnMap, moduleName);
31239
- yield output;
31240
- } else {
31241
- throw new TypeError(`Virtual table module "${moduleName}" yielded something that isn't a valid row object`);
31242
- }
31243
- }
31244
- };
31245
- }
31246
- function extractRowArray(row, output, columnCount, moduleName) {
31247
- if (row.length !== columnCount) {
31248
- throw new TypeError(`Virtual table module "${moduleName}" yielded a row with an incorrect number of columns`);
31249
- }
31250
- const offset = output.length - columnCount;
31251
- for (let i = 0; i < columnCount; ++i) {
31252
- output[i + offset] = row[i];
31253
- }
31254
- }
31255
- function extractRowObject(row, output, columnMap, moduleName) {
31256
- let count = 0;
31257
- for (const key of Object.keys(row)) {
31258
- const index4 = columnMap.get(key);
31259
- if (index4 === void 0) {
31260
- throw new TypeError(`Virtual table module "${moduleName}" yielded a row with an undeclared column "${key}"`);
31261
- }
31262
- output[index4] = row[key];
31263
- count += 1;
31264
- }
31265
- if (count !== columnMap.size) {
31266
- throw new TypeError(`Virtual table module "${moduleName}" yielded a row with missing columns`);
31267
- }
31268
- }
31269
- function inferParameters({ length }) {
31270
- if (!Number.isInteger(length) || length < 0) {
31271
- throw new TypeError("Expected function.length to be a positive integer");
31272
- }
31273
- const params = [];
31274
- for (let i = 0; i < length; ++i) {
31275
- params.push(`$${i + 1}`);
31276
- }
31277
- return params;
31278
- }
31279
- var { hasOwnProperty } = Object.prototype;
31280
- var { apply } = Function.prototype;
31281
- var GeneratorFunctionPrototype = Object.getPrototypeOf(function* () {
31282
- });
31283
- var identifier = (str) => `"${str.replace(/"/g, '""')}"`;
31284
- var defer = (x) => () => x;
31285
- }
31286
- });
31287
-
31288
- // node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/inspect.js
31289
- var require_inspect = __commonJS({
31290
- "node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/methods/inspect.js"(exports, module2) {
31291
- "use strict";
31292
- var DatabaseInspection = function Database3() {
31293
- };
31294
- module2.exports = function inspect(depth, opts) {
31295
- return Object.assign(new DatabaseInspection(), this);
31296
- };
31297
- }
31298
- });
31299
-
31300
- // node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/database.js
31301
- var require_database = __commonJS({
31302
- "node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/database.js"(exports, module2) {
31303
- "use strict";
31304
- var fs6 = require("fs");
31305
- var path3 = require("path");
31306
- var util2 = require_util();
31307
- var SqliteError = require_sqlite_error();
31308
- var DEFAULT_ADDON;
31309
- function Database3(filenameGiven, options) {
31310
- if (new.target == null) {
31311
- return new Database3(filenameGiven, options);
31312
- }
31313
- let buffer;
31314
- if (Buffer.isBuffer(filenameGiven)) {
31315
- buffer = filenameGiven;
31316
- filenameGiven = ":memory:";
31317
- }
31318
- if (filenameGiven == null)
31319
- filenameGiven = "";
31320
- if (options == null)
31321
- options = {};
31322
- if (typeof filenameGiven !== "string")
31323
- throw new TypeError("Expected first argument to be a string");
31324
- if (typeof options !== "object")
31325
- throw new TypeError("Expected second argument to be an options object");
31326
- if ("readOnly" in options)
31327
- throw new TypeError('Misspelled option "readOnly" should be "readonly"');
31328
- if ("memory" in options)
31329
- throw new TypeError('Option "memory" was removed in v7.0.0 (use ":memory:" filename instead)');
31330
- const filename = filenameGiven.trim();
31331
- const anonymous = filename === "" || filename === ":memory:";
31332
- const readonly = util2.getBooleanOption(options, "readonly");
31333
- const fileMustExist = util2.getBooleanOption(options, "fileMustExist");
31334
- const timeout = "timeout" in options ? options.timeout : 5e3;
31335
- const verbose = "verbose" in options ? options.verbose : null;
31336
- const nativeBindingPath = "nativeBinding" in options ? options.nativeBinding : null;
31337
- if (readonly && anonymous && !buffer)
31338
- throw new TypeError("In-memory/temporary databases cannot be readonly");
31339
- if (!Number.isInteger(timeout) || timeout < 0)
31340
- throw new TypeError('Expected the "timeout" option to be a positive integer');
31341
- if (timeout > 2147483647)
31342
- throw new RangeError('Option "timeout" cannot be greater than 2147483647');
31343
- if (verbose != null && typeof verbose !== "function")
31344
- throw new TypeError('Expected the "verbose" option to be a function');
31345
- if (nativeBindingPath != null && typeof nativeBindingPath !== "string")
31346
- throw new TypeError('Expected the "nativeBinding" option to be a string');
31347
- let addon;
31348
- if (nativeBindingPath == null) {
31349
- addon = DEFAULT_ADDON || (DEFAULT_ADDON = require_bindings()("better_sqlite3.node"));
31350
- } else {
31351
- addon = require(path3.resolve(nativeBindingPath).replace(/(\.node)?$/, ".node"));
31352
- }
31353
- if (!addon.isInitialized) {
31354
- addon.setErrorConstructor(SqliteError);
31355
- addon.isInitialized = true;
31356
- }
31357
- if (!anonymous && !fs6.existsSync(path3.dirname(filename))) {
31358
- throw new TypeError("Cannot open database because the directory does not exist");
31359
- }
31360
- Object.defineProperties(this, {
31361
- [util2.cppdb]: { value: new addon.Database(filename, filenameGiven, anonymous, readonly, fileMustExist, timeout, verbose || null, buffer || null) },
31362
- ...wrappers.getters
31363
- });
31364
- }
31365
- var wrappers = require_wrappers();
31366
- Database3.prototype.prepare = wrappers.prepare;
31367
- Database3.prototype.transaction = require_transaction();
31368
- Database3.prototype.pragma = require_pragma();
31369
- Database3.prototype.backup = require_backup();
31370
- Database3.prototype.serialize = require_serialize();
31371
- Database3.prototype.function = require_function();
31372
- Database3.prototype.aggregate = require_aggregate();
31373
- Database3.prototype.table = require_table();
31374
- Database3.prototype.loadExtension = wrappers.loadExtension;
31375
- Database3.prototype.exec = wrappers.exec;
31376
- Database3.prototype.close = wrappers.close;
31377
- Database3.prototype.defaultSafeIntegers = wrappers.defaultSafeIntegers;
31378
- Database3.prototype.unsafeMode = wrappers.unsafeMode;
31379
- Database3.prototype[util2.inspect] = require_inspect();
31380
- module2.exports = Database3;
31381
- }
31382
- });
31383
-
31384
- // node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/index.js
31385
- var require_lib2 = __commonJS({
31386
- "node_modules/.pnpm/better-sqlite3@8.4.0/node_modules/better-sqlite3/lib/index.js"(exports, module2) {
31387
- "use strict";
31388
- module2.exports = require_database();
31389
- module2.exports.SqliteError = require_sqlite_error();
31390
- }
31391
- });
31392
-
31393
30576
  // src/sqlite-introspect.ts
31394
30577
  var sqliteImportsList, indexName3, objToStatement22, relations2, schemaToTypeScript2, isCyclic2, isSelf2, mapColumnDefault2, column5, createTableColumns2, createTableIndexes2, createTablePKs2, createTableFKs2;
31395
30578
  var init_sqlite_introspect = __esm({
@@ -31901,7 +31084,7 @@ function valueToSql(value) {
31901
31084
  var import_better_sqlite3, import_node_buffer, Sqlite3Client, Sqlite3Transaction;
31902
31085
  var init_sqlite3 = __esm({
31903
31086
  "node_modules/.pnpm/@libsql+client@0.1.6/node_modules/@libsql/client/lib-esm/sqlite3.js"() {
31904
- import_better_sqlite3 = __toESM(require_lib2(), 1);
31087
+ import_better_sqlite3 = __toESM(require("better-sqlite3"), 1);
31905
31088
  import_node_buffer = require("node:buffer");
31906
31089
  init_api();
31907
31090
  init_config();
@@ -36962,7 +36145,7 @@ var init_hrana = __esm({
36962
36145
  });
36963
36146
 
36964
36147
  // node_modules/.pnpm/webidl-conversions@3.0.1/node_modules/webidl-conversions/lib/index.js
36965
- var require_lib3 = __commonJS({
36148
+ var require_lib2 = __commonJS({
36966
36149
  "node_modules/.pnpm/webidl-conversions@3.0.1/node_modules/webidl-conversions/lib/index.js"(exports, module2) {
36967
36150
  "use strict";
36968
36151
  var conversions = {};
@@ -38541,7 +37724,7 @@ var require_URL_impl = __commonJS({
38541
37724
  var require_URL = __commonJS({
38542
37725
  "node_modules/.pnpm/whatwg-url@5.0.0/node_modules/whatwg-url/lib/URL.js"(exports, module2) {
38543
37726
  "use strict";
38544
- var conversions = require_lib3();
37727
+ var conversions = require_lib2();
38545
37728
  var utils = require_utils2();
38546
37729
  var Impl = require_URL_impl();
38547
37730
  var impl = utils.implSymbol;
@@ -38737,7 +37920,7 @@ var require_public_api = __commonJS({
38737
37920
  });
38738
37921
 
38739
37922
  // node_modules/.pnpm/node-fetch@2.6.11/node_modules/node-fetch/lib/index.js
38740
- var require_lib4 = __commonJS({
37923
+ var require_lib3 = __commonJS({
38741
37924
  "node_modules/.pnpm/node-fetch@2.6.11/node_modules/node-fetch/lib/index.js"(exports, module2) {
38742
37925
  "use strict";
38743
37926
  Object.defineProperty(exports, "__esModule", { value: true });
@@ -39989,7 +39172,7 @@ var require_lib4 = __commonJS({
39989
39172
  var import_node_fetch, Request, Response, Headers;
39990
39173
  var init_node2 = __esm({
39991
39174
  "node_modules/.pnpm/@libsql+isomorphic-fetch@0.1.1/node_modules/@libsql/isomorphic-fetch/node.mjs"() {
39992
- import_node_fetch = __toESM(require_lib4(), 1);
39175
+ import_node_fetch = __toESM(require_lib3(), 1);
39993
39176
  ({ Request, Response, Headers } = import_node_fetch.default);
39994
39177
  }
39995
39178
  });
@@ -40169,15 +39352,16 @@ __export(sqliteIntrospect_exports, {
40169
39352
  sqliteIntrospect: () => sqliteIntrospect,
40170
39353
  sqlitePushIntrospect: () => sqlitePushIntrospect
40171
39354
  });
40172
- var import_better_sqlite32, SqliteClient, BetterSqlite, TursoSqlite, connectToSQLite, sqliteIntrospect, sqlitePushIntrospect;
39355
+ var import_hanji6, SqliteClient, BetterSqlite, TursoSqlite, connectToSQLite, sqliteIntrospect, sqlitePushIntrospect;
40173
39356
  var init_sqliteIntrospect = __esm({
40174
39357
  "src/cli/commands/sqliteIntrospect.ts"() {
39358
+ init_views();
40175
39359
  init_global();
40176
- import_better_sqlite32 = __toESM(require_lib2());
40177
39360
  init_sqliteSerializer();
40178
39361
  init_sqlite_introspect();
40179
39362
  init_mjs();
40180
39363
  init_lib_esm2();
39364
+ import_hanji6 = __toESM(require_hanji());
40181
39365
  SqliteClient = class {
40182
39366
  constructor(db) {
40183
39367
  this.db = db;
@@ -40202,8 +39386,9 @@ var init_sqliteIntrospect = __esm({
40202
39386
  };
40203
39387
  connectToSQLite = async (config) => {
40204
39388
  if (config.driver === "better-sqlite") {
39389
+ const { default: Database2 } = await import("better-sqlite3");
40205
39390
  return {
40206
- client: new BetterSqlite(new import_better_sqlite32.default(config.dbCredentials.url))
39391
+ client: new BetterSqlite(new Database2(config.dbCredentials.url))
40207
39392
  };
40208
39393
  }
40209
39394
  if (config.driver === "libsql") {
@@ -40228,7 +39413,17 @@ var init_sqliteIntrospect = __esm({
40228
39413
  };
40229
39414
  sqliteIntrospect = async (config) => {
40230
39415
  const { client } = await connectToSQLite(config);
40231
- const res = await fromDatabase3(client, (tableName) => true);
39416
+ const progress = new IntrospectProgress();
39417
+ const res = await (0, import_hanji6.renderWithTask)(
39418
+ progress,
39419
+ fromDatabase3(
39420
+ client,
39421
+ () => true,
39422
+ (stage, count, status) => {
39423
+ progress.update(stage, count, status);
39424
+ }
39425
+ )
39426
+ );
40232
39427
  const schema4 = { id: originUUID, prevId: "", ...res };
40233
39428
  const ts = schemaToTypeScript2(schema4);
40234
39429
  return { schema: schema4, ts };
@@ -41838,7 +41033,7 @@ var require_helper = __commonJS({
41838
41033
  });
41839
41034
 
41840
41035
  // node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/index.js
41841
- var require_lib5 = __commonJS({
41036
+ var require_lib4 = __commonJS({
41842
41037
  "node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/index.js"(exports, module2) {
41843
41038
  "use strict";
41844
41039
  var path3 = require("path");
@@ -43424,7 +42619,7 @@ var require_client2 = __commonJS({
43424
42619
  var util2 = require("util");
43425
42620
  var utils = require_utils3();
43426
42621
  var sasl = require_sasl();
43427
- var pgPass = require_lib5();
42622
+ var pgPass = require_lib4();
43428
42623
  var TypeOverrides = require_type_overrides();
43429
42624
  var ConnectionParameters = require_connection_parameters();
43430
42625
  var Query = require_query3();
@@ -43991,7 +43186,7 @@ var require_pg_pool = __commonJS({
43991
43186
  this.options.maxLifetimeSeconds = this.options.maxLifetimeSeconds || 0;
43992
43187
  this.log = this.options.log || function() {
43993
43188
  };
43994
- this.Client = this.options.Client || Client2 || require_lib6().Client;
43189
+ this.Client = this.options.Client || Client2 || require_lib5().Client;
43995
43190
  this.Promise = this.options.Promise || global.Promise;
43996
43191
  if (typeof this.options.idleTimeoutMillis === "undefined") {
43997
43192
  this.options.idleTimeoutMillis = 1e4;
@@ -44743,7 +43938,7 @@ var require_native = __commonJS({
44743
43938
  });
44744
43939
 
44745
43940
  // node_modules/.pnpm/pg@8.8.0/node_modules/pg/lib/index.js
44746
- var require_lib6 = __commonJS({
43941
+ var require_lib5 = __commonJS({
44747
43942
  "node_modules/.pnpm/pg@8.8.0/node_modules/pg/lib/index.js"(exports, module2) {
44748
43943
  "use strict";
44749
43944
  var Client2 = require_client2();
@@ -45294,13 +44489,13 @@ __export(pgIntrospect_exports, {
45294
44489
  PgConfig2: () => PgConfig2,
45295
44490
  pgIntrospect: () => pgIntrospect
45296
44491
  });
45297
- var import_hanji6, import_pg, PgConfig1, PgConfig2, Conf, pgIntrospect;
44492
+ var import_hanji7, import_pg, PgConfig1, PgConfig2, Conf, pgIntrospect;
45298
44493
  var init_pgIntrospect = __esm({
45299
44494
  "src/cli/commands/pgIntrospect.ts"() {
45300
- import_hanji6 = __toESM(require_hanji());
44495
+ import_hanji7 = __toESM(require_hanji());
45301
44496
  init_lib();
45302
44497
  init_views();
45303
- import_pg = __toESM(require_lib6());
44498
+ import_pg = __toESM(require_lib5());
45304
44499
  init_pgSerializer();
45305
44500
  init_introspect();
45306
44501
  init_global();
@@ -45321,7 +44516,7 @@ var init_pgIntrospect = __esm({
45321
44516
  pgIntrospect = async (config) => {
45322
44517
  const pool = new import_pg.Pool(config);
45323
44518
  const progress = new IntrospectProgress();
45324
- const res = await (0, import_hanji6.renderWithTask)(
44519
+ const res = await (0, import_hanji7.renderWithTask)(
45325
44520
  progress,
45326
44521
  fromDatabase2(pool, (stage, count, status) => {
45327
44522
  progress.update(stage, count, status);
@@ -45383,7 +44578,7 @@ var checkHandler = (out, dialect6) => {
45383
44578
  };
45384
44579
 
45385
44580
  // src/cli/index.ts
45386
- var import_hanji7 = __toESM(require_hanji());
44581
+ var import_hanji8 = __toESM(require_hanji());
45387
44582
  var import_path7 = __toESM(require("path"));
45388
44583
 
45389
44584
  // src/cli/utils.ts
@@ -45401,7 +44596,7 @@ var assertPackages = async (...pkgs) => {
45401
44596
  process.exit(1);
45402
44597
  }
45403
44598
  };
45404
- var requiredApiVersion = 5;
44599
+ var requiredApiVersion = 4;
45405
44600
  var assertOrmCoreVersion = async () => {
45406
44601
  try {
45407
44602
  const { compatibilityVersion } = await import("drizzle-orm/version");
@@ -46437,14 +45632,14 @@ var generateMysqlCommand = new import_commander.Command("generate:mysql").option
46437
45632
  const { prepareAndMigrateMySql: prepareAndMigrateMySql2 } = await Promise.resolve().then(() => (init_migrate(), migrate_exports));
46438
45633
  await prepareAndMigrateMySql2(result);
46439
45634
  });
46440
- var Select = class extends import_hanji7.Prompt {
45635
+ var Select = class extends import_hanji8.Prompt {
46441
45636
  // private readonly spinner: () => string;
46442
45637
  // private timeout: NodeJS.Timer | undefined;
46443
45638
  constructor(items) {
46444
45639
  super();
46445
45640
  this.on("attach", (terminal) => terminal.toggleCursor("hide"));
46446
45641
  this.on("detach", (terminal) => terminal.toggleCursor("show"));
46447
- this.data = new import_hanji7.SelectState(
45642
+ this.data = new import_hanji8.SelectState(
46448
45643
  items.map((it) => ({ label: it, value: `${it}-value` }))
46449
45644
  );
46450
45645
  this.data.bind(this);
@@ -46477,7 +45672,7 @@ var dbPushMysqlCommand = new import_commander.Command("push:mysql").option(
46477
45672
  const drizzleConfig = await drizzleConfigFromFile(options.config);
46478
45673
  const fileNames = prepareFilenames(drizzleConfig.schema);
46479
45674
  if (fileNames.length === 0) {
46480
- (0, import_hanji7.render)(
45675
+ (0, import_hanji8.render)(
46481
45676
  `[${source_default.blue("i")}] No schema file in ${drizzleConfig.schema} was found`
46482
45677
  );
46483
45678
  process.exit(0);
@@ -46494,7 +45689,7 @@ var dbPushMysqlCommand = new import_commander.Command("push:mysql").option(
46494
45689
  try {
46495
45690
  if (typeof statements === "undefined") {
46496
45691
  } else if (statements.sqlStatements.length === 0) {
46497
- (0, import_hanji7.render)(`[${source_default.blue("i")}] No changes detected`);
45692
+ (0, import_hanji8.render)(`[${source_default.blue("i")}] No changes detected`);
46498
45693
  } else {
46499
45694
  const filteredStatements = filterStatements(statements.statements);
46500
45695
  const {
@@ -46516,14 +45711,14 @@ var dbPushMysqlCommand = new import_commander.Command("push:mysql").option(
46516
45711
  )
46517
45712
  );
46518
45713
  console.log(source_default.white("Do you still want to push changes?"));
46519
- const { status, data } = await (0, import_hanji7.render)(
45714
+ const { status, data } = await (0, import_hanji8.render)(
46520
45715
  new Select([
46521
45716
  "No, abort",
46522
45717
  `Yes, I want to${tablesToRemove.length > 0 ? ` remove ${tablesToRemove.length} ${tablesToRemove.length > 1 ? "tables" : "table"},` : " "}${columnsToRemove.length > 0 ? ` remove ${columnsToRemove.length} ${columnsToRemove.length > 1 ? "columns" : "column"},` : " "}${tablesToTruncate.length > 0 ? ` truncate ${tablesToTruncate.length} ${tablesToTruncate.length > 1 ? "tables" : "table"}` : ""}`.replace(/(^,)|(,$)/g, "").replace(/ +(?= )/g, "")
46523
45718
  ])
46524
45719
  );
46525
45720
  if ((data == null ? void 0 : data.index) === 0) {
46526
- (0, import_hanji7.render)(`[${source_default.red("x")}] All changes were aborted`);
45721
+ (0, import_hanji8.render)(`[${source_default.red("x")}] All changes were aborted`);
46527
45722
  process.exit(0);
46528
45723
  }
46529
45724
  }
@@ -46534,9 +45729,9 @@ var dbPushMysqlCommand = new import_commander.Command("push:mysql").option(
46534
45729
  await connection.client.query(statement);
46535
45730
  }
46536
45731
  if (filteredStatements.length > 0) {
46537
- (0, import_hanji7.render)(`[${source_default.green("\u2713")}] Changes applied`);
45732
+ (0, import_hanji8.render)(`[${source_default.green("\u2713")}] Changes applied`);
46538
45733
  } else {
46539
- (0, import_hanji7.render)(`[${source_default.blue("i")}] No changes detected`);
45734
+ (0, import_hanji8.render)(`[${source_default.blue("i")}] No changes detected`);
46540
45735
  }
46541
45736
  }
46542
45737
  } catch (e) {
@@ -46556,7 +45751,7 @@ var dbPushSqliteCommand = new import_commander.Command("push:sqlite").option(
46556
45751
  const res = await validatePush(options);
46557
45752
  const fileNames = prepareFilenames(res.schema);
46558
45753
  if (fileNames.length === 0) {
46559
- (0, import_hanji7.render)(`[${source_default.blue("i")}] No schema file in ${res.schema} was found`);
45754
+ (0, import_hanji8.render)(`[${source_default.blue("i")}] No schema file in ${res.schema} was found`);
46560
45755
  process.exit(0);
46561
45756
  }
46562
45757
  const connection = await connectToSQLite2(res);
@@ -46571,7 +45766,7 @@ var dbPushSqliteCommand = new import_commander.Command("push:sqlite").option(
46571
45766
  try {
46572
45767
  if (typeof statements === "undefined") {
46573
45768
  } else if (statements.sqlStatements.length === 0) {
46574
- (0, import_hanji7.render)(`
45769
+ (0, import_hanji8.render)(`
46575
45770
  [${source_default.blue("i")}] No changes detected`);
46576
45771
  } else {
46577
45772
  const {
@@ -46599,11 +45794,11 @@ var dbPushSqliteCommand = new import_commander.Command("push:sqlite").option(
46599
45794
  }
46600
45795
  if (res.strict) {
46601
45796
  if (!shouldAskForApprove) {
46602
- const { status, data } = await (0, import_hanji7.render)(
45797
+ const { status, data } = await (0, import_hanji8.render)(
46603
45798
  new Select(["No, abort", `Yes, I want to execute all statements`])
46604
45799
  );
46605
45800
  if ((data == null ? void 0 : data.index) === 0) {
46606
- (0, import_hanji7.render)(`[${source_default.red("x")}] All changes were aborted`);
45801
+ (0, import_hanji8.render)(`[${source_default.red("x")}] All changes were aborted`);
46607
45802
  process.exit(0);
46608
45803
  }
46609
45804
  }
@@ -46618,21 +45813,21 @@ var dbPushSqliteCommand = new import_commander.Command("push:sqlite").option(
46618
45813
  )
46619
45814
  );
46620
45815
  console.log(source_default.white("Do you still want to push changes?"));
46621
- const { status, data } = await (0, import_hanji7.render)(
45816
+ const { status, data } = await (0, import_hanji8.render)(
46622
45817
  new Select([
46623
45818
  "No, abort",
46624
45819
  `Yes, I want to${tablesToRemove.length > 0 ? ` remove ${tablesToRemove.length} ${tablesToRemove.length > 1 ? "tables" : "table"},` : " "}${columnsToRemove.length > 0 ? ` remove ${columnsToRemove.length} ${columnsToRemove.length > 1 ? "columns" : "column"},` : " "}${tablesToTruncate.length > 0 ? ` truncate ${tablesToTruncate.length} ${tablesToTruncate.length > 1 ? "tables" : "table"}` : ""}`.trimEnd().replace(/(^,)|(,$)/g, "").replace(/ +(?= )/g, "")
46625
45820
  ])
46626
45821
  );
46627
45822
  if ((data == null ? void 0 : data.index) === 0) {
46628
- (0, import_hanji7.render)(`[${source_default.red("x")}] All changes were aborted`);
45823
+ (0, import_hanji8.render)(`[${source_default.red("x")}] All changes were aborted`);
46629
45824
  process.exit(0);
46630
45825
  }
46631
45826
  }
46632
45827
  for (const dStmnt of statementsToExecute) {
46633
45828
  await connection.client.run(dStmnt);
46634
45829
  }
46635
- (0, import_hanji7.render)(`[${source_default.green("\u2713")}] Changes applied`);
45830
+ (0, import_hanji8.render)(`[${source_default.green("\u2713")}] Changes applied`);
46636
45831
  }
46637
45832
  } catch (e) {
46638
45833
  console.log(e);
@@ -46744,13 +45939,13 @@ var introspectPgCommand = new import_commander.Command("introspect:pg").option("
46744
45939
  "introspect"
46745
45940
  );
46746
45941
  } else {
46747
- (0, import_hanji7.render)(
45942
+ (0, import_hanji8.render)(
46748
45943
  `[${source_default.blue(
46749
45944
  "i"
46750
45945
  )}] No SQL generated, you already have migrations in project`
46751
45946
  );
46752
45947
  }
46753
- (0, import_hanji7.render)(
45948
+ (0, import_hanji8.render)(
46754
45949
  `[${source_default.green(
46755
45950
  "\u2713"
46756
45951
  )}] You schema file is ready \u279C ${source_default.bold.underline.blue(
@@ -46799,13 +45994,13 @@ var introspectMySqlCommand = new import_commander.Command("introspect:mysql").op
46799
45994
  "introspect"
46800
45995
  );
46801
45996
  } else {
46802
- (0, import_hanji7.render)(
45997
+ (0, import_hanji8.render)(
46803
45998
  `[${source_default.blue(
46804
45999
  "i"
46805
46000
  )}] No SQL generated, you already have migrations in project`
46806
46001
  );
46807
46002
  }
46808
- (0, import_hanji7.render)(
46003
+ (0, import_hanji8.render)(
46809
46004
  `[${source_default.green(
46810
46005
  "\u2713"
46811
46006
  )}] You schema file is ready \u279C ${source_default.bold.underline.blue(
@@ -46847,13 +46042,13 @@ var introspectSQLiteCommand = new import_commander.Command("introspect:sqlite").
46847
46042
  "introspect"
46848
46043
  );
46849
46044
  } else {
46850
- (0, import_hanji7.render)(
46045
+ (0, import_hanji8.render)(
46851
46046
  `[${source_default.blue(
46852
46047
  "i"
46853
46048
  )}] No SQL generated, you already have migrations in project`
46854
46049
  );
46855
46050
  }
46856
- (0, import_hanji7.render)(
46051
+ (0, import_hanji8.render)(
46857
46052
  `[${source_default.green(
46858
46053
  "\u2713"
46859
46054
  )}] You schema file is ready \u279C ${source_default.bold.underline.blue(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.19.0-3126e54",
3
+ "version": "0.19.0-c1c76b7",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",