drizzle-kit 0.20.7 → 0.20.8

Sign up to get free protection for your applications and to get access to all the features.
package/bin.cjs CHANGED
@@ -11261,7 +11261,7 @@ var require_node2 = __commonJS({
11261
11261
  });
11262
11262
 
11263
11263
  // src/cli/commands/utils.ts
11264
- var import_path, import_fs, import_hanji2, assertES5, safeRegister, prepareGenerateConfig, assertOutFolder, configCommonSchema, introspectCasing, configIntrospectSchema, configIntrospectCliSchema, configGenerateSchema, configPushSchema, mysqlConnectionSchema, mySqlCliConfigSchema, mySqlIntrospectConfigSchema, drizzleConfigFromFile, readDrizzleConfig;
11264
+ var import_path, import_fs, import_hanji2, assertES5, safeRegister, prepareGenerateConfig, assertOutFolder, driver, configCommonSchema, introspectCasing, configIntrospectSchema, configIntrospectCliSchema, configGenerateSchema, configPushSchema, mysqlConnectionSchema, mySqlCliConfigSchema, mySqlIntrospectConfigSchema, drizzleConfigFromFile, readDrizzleConfig;
11265
11265
  var init_utils = __esm({
11266
11266
  "src/cli/commands/utils.ts"() {
11267
11267
  init_serializer();
@@ -11324,7 +11324,8 @@ var init_utils = __esm({
11324
11324
  custom,
11325
11325
  breakpoints: drizzleConfig.breakpoints ?? false,
11326
11326
  schema: drizzleConfig.schema,
11327
- out: drizzleConfig.out
11327
+ out: drizzleConfig.out,
11328
+ bundle: drizzleConfig.driver === "expo"
11328
11329
  };
11329
11330
  }
11330
11331
  if (!schema4) {
@@ -11340,7 +11341,7 @@ var init_utils = __esm({
11340
11341
  console.error(`'out' param must be set`);
11341
11342
  process.exit(1);
11342
11343
  }
11343
- return { schema: schema4, out, breakpoints, custom };
11344
+ return { schema: schema4, out, breakpoints, custom, bundle: false };
11344
11345
  };
11345
11346
  assertOutFolder = async (it) => {
11346
11347
  if ("out" in it)
@@ -11356,10 +11357,20 @@ var init_utils = __esm({
11356
11357
  }
11357
11358
  return cliConfig.out;
11358
11359
  };
11360
+ driver = unionType([
11361
+ literalType("better-sqlite"),
11362
+ literalType("turso"),
11363
+ literalType("libsql"),
11364
+ literalType("d1"),
11365
+ literalType("expo"),
11366
+ literalType("pg"),
11367
+ literalType("mysql2")
11368
+ ]);
11359
11369
  configCommonSchema = objectType({
11360
11370
  schema: unionType([stringType(), stringType().array()]),
11361
11371
  out: stringType().optional(),
11362
11372
  breakpoints: booleanType().default(true),
11373
+ driver: driver.optional(),
11363
11374
  tablesFilter: unionType([stringType(), stringType().array()]).optional(),
11364
11375
  schemaFilter: unionType([stringType(), stringType().array()]).default(["public"])
11365
11376
  });
@@ -11566,9 +11577,9 @@ var init_outputs = __esm({
11566
11577
  driver: () => withStyle.error(
11567
11578
  `Either "turso", "libsql", "better-sqlite" are available options for "--driver"`
11568
11579
  ),
11569
- url: (driver) => withStyle.error(`"url" is a required option for driver "${driver}". You can read more about drizzle.config: https://orm.drizzle.team/kit-docs/config-reference`),
11570
- authToken: (driver) => withStyle.error(
11571
- `"authToken" is a required option for driver "${driver}". You can read more about drizzle.config: https://orm.drizzle.team/kit-docs/config-reference`
11580
+ url: (driver2) => withStyle.error(`"url" is a required option for driver "${driver2}". You can read more about drizzle.config: https://orm.drizzle.team/kit-docs/config-reference`),
11581
+ authToken: (driver2) => withStyle.error(
11582
+ `"authToken" is a required option for driver "${driver2}". You can read more about drizzle.config: https://orm.drizzle.team/kit-docs/config-reference`
11572
11583
  )
11573
11584
  },
11574
11585
  introspect: {},
@@ -11995,9 +12006,9 @@ We have encountered a collision between the index name on columns ${source_defau
11995
12006
  }
11996
12007
  try {
11997
12008
  const fks = await db.execute(
11998
- `SELECT INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_NAME,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.COLUMN_NAME,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_SCHEMA,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_NAME, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_COLUMN_NAME,information_schema.referential_constraints.UPDATE_RULE, information_schema.referential_constraints.DELETE_RULE
12009
+ `SELECT INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_NAME,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.COLUMN_NAME,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_SCHEMA,INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_NAME, INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_COLUMN_NAME,INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS.UPDATE_RULE, INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS.DELETE_RULE
11999
12010
  FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE
12000
- LEFT JOIN information_schema.referential_constraints on information_schema.referential_constraints.constraint_name = information_schema.KEY_COLUMN_USAGE.CONSTRAINT_NAME
12011
+ LEFT JOIN INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS on INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS.CONSTRAINT_NAME = INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME
12001
12012
  WHERE INFORMATION_SCHEMA.KEY_COLUMN_USAGE.TABLE_SCHEMA = ? AND INFORMATION_SCHEMA.KEY_COLUMN_USAGE.CONSTRAINT_NAME != 'PRIMARY' and INFORMATION_SCHEMA.KEY_COLUMN_USAGE.REFERENCED_TABLE_NAME is not null;
12002
12013
  `,
12003
12014
  [inputSchema]
@@ -14904,6 +14915,7 @@ var init_words = __esm({
14904
14915
  var migrate_exports = {};
14905
14916
  __export(migrate_exports, {
14906
14917
  BREAKPOINT: () => BREAKPOINT,
14918
+ embeddedMigrations: () => embeddedMigrations,
14907
14919
  prepareAndMigrateMySql: () => prepareAndMigrateMySql,
14908
14920
  prepareAndMigratePg: () => prepareAndMigratePg,
14909
14921
  prepareAndMigrateSqlite: () => prepareAndMigrateSqlite,
@@ -14914,7 +14926,7 @@ __export(migrate_exports, {
14914
14926
  prepareSnapshotFolderName: () => prepareSnapshotFolderName,
14915
14927
  writeResult: () => writeResult
14916
14928
  });
14917
- var import_fs4, import_path3, import_hanji3, prepareAndMigratePg, prepareMySQLPush, prepareSQLitePush, preparePgPush, prepareAndMigrateMySql, prepareAndMigrateSqlite, prepareSQL, promptColumnsConflicts, promptTablesConflict, promptSchemasConflict, BREAKPOINT, writeResult, prepareSnapshotFolderName, two;
14929
+ var import_fs4, import_path3, import_hanji3, prepareAndMigratePg, prepareMySQLPush, prepareSQLitePush, preparePgPush, prepareAndMigrateMySql, prepareAndMigrateSqlite, prepareSQL, promptColumnsConflicts, promptTablesConflict, promptSchemasConflict, BREAKPOINT, writeResult, embeddedMigrations, prepareSnapshotFolderName, two;
14918
14930
  var init_migrate = __esm({
14919
14931
  "src/cli/commands/migrate.ts"() {
14920
14932
  import_fs4 = __toESM(require("fs"));
@@ -14943,19 +14955,14 @@ var init_migrate = __esm({
14943
14955
  const validatedPrev = pgSchema.parse(prev);
14944
14956
  const validatedCur = pgSchema.parse(cur);
14945
14957
  if (config.custom) {
14946
- writeResult(
14947
- custom,
14948
- [],
14958
+ writeResult({
14959
+ cur: custom,
14960
+ sqlStatements: [],
14949
14961
  journal,
14950
- {
14951
- columns: {},
14952
- schemas: {},
14953
- tables: {}
14954
- },
14955
14962
  outFolder,
14956
- config.breakpoints,
14957
- "custom"
14958
- );
14963
+ breakpoints: config.breakpoints,
14964
+ type: "custom"
14965
+ });
14959
14966
  return;
14960
14967
  }
14961
14968
  const squashedPrev = squashPgScheme(validatedPrev);
@@ -14967,14 +14974,13 @@ var init_migrate = __esm({
14967
14974
  validatedPrev,
14968
14975
  validatedCur
14969
14976
  );
14970
- writeResult(
14977
+ writeResult({
14971
14978
  cur,
14972
14979
  sqlStatements,
14973
14980
  journal,
14974
- _meta,
14975
14981
  outFolder,
14976
- config.breakpoints
14977
- );
14982
+ breakpoints: config.breakpoints
14983
+ });
14978
14984
  } catch (e) {
14979
14985
  console.error(e);
14980
14986
  }
@@ -15068,19 +15074,14 @@ var init_migrate = __esm({
15068
15074
  const validatedPrev = mysqlSchema.parse(prev);
15069
15075
  const validatedCur = mysqlSchema.parse(cur);
15070
15076
  if (config.custom) {
15071
- writeResult(
15072
- custom,
15073
- [],
15077
+ writeResult({
15078
+ cur: custom,
15079
+ sqlStatements: [],
15074
15080
  journal,
15075
- {
15076
- columns: {},
15077
- schemas: {},
15078
- tables: {}
15079
- },
15080
15081
  outFolder,
15081
- config.breakpoints,
15082
- "custom"
15083
- );
15082
+ breakpoints: config.breakpoints,
15083
+ type: "custom"
15084
+ });
15084
15085
  return;
15085
15086
  }
15086
15087
  const squashedPrev = squashMysqlScheme(validatedPrev);
@@ -15092,14 +15093,14 @@ var init_migrate = __esm({
15092
15093
  validatedPrev,
15093
15094
  validatedCur
15094
15095
  );
15095
- writeResult(
15096
+ writeResult({
15096
15097
  cur,
15097
15098
  sqlStatements,
15098
15099
  journal,
15099
15100
  _meta,
15100
15101
  outFolder,
15101
- config.breakpoints
15102
- );
15102
+ breakpoints: config.breakpoints
15103
+ });
15103
15104
  } catch (e) {
15104
15105
  console.error(e);
15105
15106
  }
@@ -15117,19 +15118,15 @@ var init_migrate = __esm({
15117
15118
  const validatedPrev = sqliteSchema.parse(prev);
15118
15119
  const validatedCur = sqliteSchema.parse(cur);
15119
15120
  if (config.custom) {
15120
- writeResult(
15121
- custom,
15122
- [],
15121
+ writeResult({
15122
+ cur: custom,
15123
+ sqlStatements: [],
15123
15124
  journal,
15124
- {
15125
- columns: {},
15126
- schemas: {},
15127
- tables: {}
15128
- },
15129
15125
  outFolder,
15130
- config.breakpoints,
15131
- "custom"
15132
- );
15126
+ breakpoints: config.breakpoints,
15127
+ bundle: config.bundle,
15128
+ type: "custom"
15129
+ });
15133
15130
  return;
15134
15131
  }
15135
15132
  const squashedPrev = squashSqliteScheme(validatedPrev);
@@ -15139,14 +15136,15 @@ var init_migrate = __esm({
15139
15136
  squashedCur,
15140
15137
  "sqlite"
15141
15138
  );
15142
- writeResult(
15139
+ writeResult({
15143
15140
  cur,
15144
15141
  sqlStatements,
15145
15142
  journal,
15146
15143
  _meta,
15147
15144
  outFolder,
15148
- config.breakpoints
15149
- );
15145
+ breakpoints: config.breakpoints,
15146
+ bundle: config.bundle
15147
+ });
15150
15148
  } catch (e) {
15151
15149
  console.error(e);
15152
15150
  }
@@ -15334,7 +15332,20 @@ var init_migrate = __esm({
15334
15332
  return result;
15335
15333
  };
15336
15334
  BREAKPOINT = "--> statement-breakpoint\n";
15337
- writeResult = (cur, sqlStatements, journal, _meta, outFolder, breakpoints, type = "none") => {
15335
+ writeResult = ({
15336
+ cur,
15337
+ sqlStatements,
15338
+ journal,
15339
+ _meta = {
15340
+ columns: {},
15341
+ schemas: {},
15342
+ tables: {}
15343
+ },
15344
+ outFolder,
15345
+ breakpoints,
15346
+ bundle = false,
15347
+ type = "none"
15348
+ }) => {
15338
15349
  if (type === "none") {
15339
15350
  console.log(schema(cur));
15340
15351
  if (sqlStatements.length === 0) {
@@ -15375,6 +15386,10 @@ ${sql2}
15375
15386
  });
15376
15387
  import_fs4.default.writeFileSync(metaJournal, JSON.stringify(journal, null, 2));
15377
15388
  import_fs4.default.writeFileSync(`${outFolder}/${tag}.sql`, sql2);
15389
+ if (bundle) {
15390
+ const js = embeddedMigrations(journal);
15391
+ import_fs4.default.writeFileSync(`${outFolder}/migrations.js`, js);
15392
+ }
15378
15393
  (0, import_hanji3.render)(
15379
15394
  `[${source_default.green(
15380
15395
  "\u2713"
@@ -15383,6 +15398,23 @@ ${sql2}
15383
15398
  )} \u{1F680}`
15384
15399
  );
15385
15400
  };
15401
+ embeddedMigrations = (journal) => {
15402
+ let content = "// This file is required for Expo/React Native SQLite migrations - https://orm.drizzle.team/quick-sqlite/expo\n\n";
15403
+ content += "import journal from './meta/_journal.json';\n";
15404
+ journal.entries.forEach((entry) => {
15405
+ content += `import m${entry.idx.toString().padStart(4, "0")} from './${entry.tag}.sql';
15406
+ `;
15407
+ });
15408
+ content += `
15409
+ export default {
15410
+ journal,
15411
+ migrations: {
15412
+ ${journal.entries.map((it) => `m${it.idx.toString().padStart(4, "0")}`).join(",\n")}
15413
+ }
15414
+ }
15415
+ `;
15416
+ return content;
15417
+ };
15386
15418
  prepareSnapshotFolderName = () => {
15387
15419
  const now = /* @__PURE__ */ new Date();
15388
15420
  return `${now.getFullYear()}${two(now.getUTCMonth() + 1)}${two(
@@ -22326,15 +22358,15 @@ var require_pg_connection_string = __commonJS({
22326
22358
  if (config.sslcert || config.sslkey || config.sslrootcert || config.sslmode) {
22327
22359
  config.ssl = {};
22328
22360
  }
22329
- const fs8 = config.sslcert || config.sslkey || config.sslrootcert ? require("fs") : null;
22361
+ const fs9 = config.sslcert || config.sslkey || config.sslrootcert ? require("fs") : null;
22330
22362
  if (config.sslcert) {
22331
- config.ssl.cert = fs8.readFileSync(config.sslcert).toString();
22363
+ config.ssl.cert = fs9.readFileSync(config.sslcert).toString();
22332
22364
  }
22333
22365
  if (config.sslkey) {
22334
- config.ssl.key = fs8.readFileSync(config.sslkey).toString();
22366
+ config.ssl.key = fs9.readFileSync(config.sslkey).toString();
22335
22367
  }
22336
22368
  if (config.sslrootcert) {
22337
- config.ssl.ca = fs8.readFileSync(config.sslrootcert).toString();
22369
+ config.ssl.ca = fs9.readFileSync(config.sslrootcert).toString();
22338
22370
  }
22339
22371
  switch (config.sslmode) {
22340
22372
  case "disable": {
@@ -24118,15 +24150,15 @@ var require_lib = __commonJS({
24118
24150
  "node_modules/.pnpm/pgpass@1.0.5/node_modules/pgpass/lib/index.js"(exports, module2) {
24119
24151
  "use strict";
24120
24152
  var path4 = require("path");
24121
- var fs8 = require("fs");
24153
+ var fs9 = require("fs");
24122
24154
  var helper = require_helper();
24123
24155
  module2.exports = function(connInfo, cb) {
24124
24156
  var file = helper.getFileName();
24125
- fs8.stat(file, function(err2, stat) {
24157
+ fs9.stat(file, function(err2, stat) {
24126
24158
  if (err2 || !helper.usePgPass(stat, file)) {
24127
24159
  return cb(void 0);
24128
24160
  }
24129
- var st = fs8.createReadStream(file);
24161
+ var st = fs9.createReadStream(file);
24130
24162
  helper.getPassword(connInfo, st, cb);
24131
24163
  });
24132
24164
  };
@@ -44871,7 +44903,7 @@ var require_windows = __commonJS({
44871
44903
  "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js"(exports, module2) {
44872
44904
  module2.exports = isexe;
44873
44905
  isexe.sync = sync2;
44874
- var fs8 = require("fs");
44906
+ var fs9 = require("fs");
44875
44907
  function checkPathExt(path4, options) {
44876
44908
  var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
44877
44909
  if (!pathext) {
@@ -44896,12 +44928,12 @@ var require_windows = __commonJS({
44896
44928
  return checkPathExt(path4, options);
44897
44929
  }
44898
44930
  function isexe(path4, options, cb) {
44899
- fs8.stat(path4, function(er, stat) {
44931
+ fs9.stat(path4, function(er, stat) {
44900
44932
  cb(er, er ? false : checkStat(stat, path4, options));
44901
44933
  });
44902
44934
  }
44903
44935
  function sync2(path4, options) {
44904
- return checkStat(fs8.statSync(path4), path4, options);
44936
+ return checkStat(fs9.statSync(path4), path4, options);
44905
44937
  }
44906
44938
  }
44907
44939
  });
@@ -44911,14 +44943,14 @@ var require_mode = __commonJS({
44911
44943
  "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/mode.js"(exports, module2) {
44912
44944
  module2.exports = isexe;
44913
44945
  isexe.sync = sync2;
44914
- var fs8 = require("fs");
44946
+ var fs9 = require("fs");
44915
44947
  function isexe(path4, options, cb) {
44916
- fs8.stat(path4, function(er, stat) {
44948
+ fs9.stat(path4, function(er, stat) {
44917
44949
  cb(er, er ? false : checkStat(stat, options));
44918
44950
  });
44919
44951
  }
44920
44952
  function sync2(path4, options) {
44921
- return checkStat(fs8.statSync(path4), options);
44953
+ return checkStat(fs9.statSync(path4), options);
44922
44954
  }
44923
44955
  function checkStat(stat, options) {
44924
44956
  return stat.isFile() && checkMode(stat, options);
@@ -44942,7 +44974,7 @@ var require_mode = __commonJS({
44942
44974
  // node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js
44943
44975
  var require_isexe = __commonJS({
44944
44976
  "node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/index.js"(exports, module2) {
44945
- var fs8 = require("fs");
44977
+ var fs9 = require("fs");
44946
44978
  var core;
44947
44979
  if (process.platform === "win32" || global.TESTING_WINDOWS) {
44948
44980
  core = require_windows();
@@ -49885,8 +49917,8 @@ var require_utils6 = __commonJS({
49885
49917
  exports.array = array;
49886
49918
  var errno = require_errno();
49887
49919
  exports.errno = errno;
49888
- var fs8 = require_fs();
49889
- exports.fs = fs8;
49920
+ var fs9 = require_fs();
49921
+ exports.fs = fs9;
49890
49922
  var path4 = require_path();
49891
49923
  exports.path = path4;
49892
49924
  var pattern = require_pattern();
@@ -50070,12 +50102,12 @@ var require_fs2 = __commonJS({
50070
50102
  "use strict";
50071
50103
  Object.defineProperty(exports, "__esModule", { value: true });
50072
50104
  exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
50073
- var fs8 = require("fs");
50105
+ var fs9 = require("fs");
50074
50106
  exports.FILE_SYSTEM_ADAPTER = {
50075
- lstat: fs8.lstat,
50076
- stat: fs8.stat,
50077
- lstatSync: fs8.lstatSync,
50078
- statSync: fs8.statSync
50107
+ lstat: fs9.lstat,
50108
+ stat: fs9.stat,
50109
+ lstatSync: fs9.lstatSync,
50110
+ statSync: fs9.statSync
50079
50111
  };
50080
50112
  function createFileSystemAdapter(fsMethods) {
50081
50113
  if (fsMethods === void 0) {
@@ -50092,12 +50124,12 @@ var require_settings = __commonJS({
50092
50124
  "node_modules/.pnpm/@nodelib+fs.stat@2.0.5/node_modules/@nodelib/fs.stat/out/settings.js"(exports) {
50093
50125
  "use strict";
50094
50126
  Object.defineProperty(exports, "__esModule", { value: true });
50095
- var fs8 = require_fs2();
50127
+ var fs9 = require_fs2();
50096
50128
  var Settings = class {
50097
50129
  constructor(_options = {}) {
50098
50130
  this._options = _options;
50099
50131
  this.followSymbolicLink = this._getValue(this._options.followSymbolicLink, true);
50100
- this.fs = fs8.createFileSystemAdapter(this._options.fs);
50132
+ this.fs = fs9.createFileSystemAdapter(this._options.fs);
50101
50133
  this.markSymbolicLink = this._getValue(this._options.markSymbolicLink, false);
50102
50134
  this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
50103
50135
  }
@@ -50255,8 +50287,8 @@ var require_utils7 = __commonJS({
50255
50287
  "use strict";
50256
50288
  Object.defineProperty(exports, "__esModule", { value: true });
50257
50289
  exports.fs = void 0;
50258
- var fs8 = require_fs3();
50259
- exports.fs = fs8;
50290
+ var fs9 = require_fs3();
50291
+ exports.fs = fs9;
50260
50292
  }
50261
50293
  });
50262
50294
 
@@ -50451,14 +50483,14 @@ var require_fs4 = __commonJS({
50451
50483
  "use strict";
50452
50484
  Object.defineProperty(exports, "__esModule", { value: true });
50453
50485
  exports.createFileSystemAdapter = exports.FILE_SYSTEM_ADAPTER = void 0;
50454
- var fs8 = require("fs");
50486
+ var fs9 = require("fs");
50455
50487
  exports.FILE_SYSTEM_ADAPTER = {
50456
- lstat: fs8.lstat,
50457
- stat: fs8.stat,
50458
- lstatSync: fs8.lstatSync,
50459
- statSync: fs8.statSync,
50460
- readdir: fs8.readdir,
50461
- readdirSync: fs8.readdirSync
50488
+ lstat: fs9.lstat,
50489
+ stat: fs9.stat,
50490
+ lstatSync: fs9.lstatSync,
50491
+ statSync: fs9.statSync,
50492
+ readdir: fs9.readdir,
50493
+ readdirSync: fs9.readdirSync
50462
50494
  };
50463
50495
  function createFileSystemAdapter(fsMethods) {
50464
50496
  if (fsMethods === void 0) {
@@ -50477,12 +50509,12 @@ var require_settings2 = __commonJS({
50477
50509
  Object.defineProperty(exports, "__esModule", { value: true });
50478
50510
  var path4 = require("path");
50479
50511
  var fsStat = require_out();
50480
- var fs8 = require_fs4();
50512
+ var fs9 = require_fs4();
50481
50513
  var Settings = class {
50482
50514
  constructor(_options = {}) {
50483
50515
  this._options = _options;
50484
50516
  this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, false);
50485
- this.fs = fs8.createFileSystemAdapter(this._options.fs);
50517
+ this.fs = fs9.createFileSystemAdapter(this._options.fs);
50486
50518
  this.pathSegmentSeparator = this._getValue(this._options.pathSegmentSeparator, path4.sep);
50487
50519
  this.stats = this._getValue(this._options.stats, false);
50488
50520
  this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
@@ -51798,16 +51830,16 @@ var require_settings4 = __commonJS({
51798
51830
  "use strict";
51799
51831
  Object.defineProperty(exports, "__esModule", { value: true });
51800
51832
  exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
51801
- var fs8 = require("fs");
51833
+ var fs9 = require("fs");
51802
51834
  var os2 = require("os");
51803
51835
  var CPU_COUNT = Math.max(os2.cpus().length, 1);
51804
51836
  exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
51805
- lstat: fs8.lstat,
51806
- lstatSync: fs8.lstatSync,
51807
- stat: fs8.stat,
51808
- statSync: fs8.statSync,
51809
- readdir: fs8.readdir,
51810
- readdirSync: fs8.readdirSync
51837
+ lstat: fs9.lstat,
51838
+ lstatSync: fs9.lstatSync,
51839
+ stat: fs9.stat,
51840
+ statSync: fs9.statSync,
51841
+ readdir: fs9.readdir,
51842
+ readdirSync: fs9.readdirSync
51811
51843
  };
51812
51844
  var Settings = class {
51813
51845
  constructor(_options = {}) {
@@ -51958,13 +51990,13 @@ var require_path_type = __commonJS({
51958
51990
  "node_modules/.pnpm/path-type@4.0.0/node_modules/path-type/index.js"(exports) {
51959
51991
  "use strict";
51960
51992
  var { promisify: promisify2 } = require("util");
51961
- var fs8 = require("fs");
51993
+ var fs9 = require("fs");
51962
51994
  async function isType(fsStatType, statsMethodName, filePath) {
51963
51995
  if (typeof filePath !== "string") {
51964
51996
  throw new TypeError(`Expected a string, got ${typeof filePath}`);
51965
51997
  }
51966
51998
  try {
51967
- const stats = await promisify2(fs8[fsStatType])(filePath);
51999
+ const stats = await promisify2(fs9[fsStatType])(filePath);
51968
52000
  return stats[statsMethodName]();
51969
52001
  } catch (error2) {
51970
52002
  if (error2.code === "ENOENT") {
@@ -51978,7 +52010,7 @@ var require_path_type = __commonJS({
51978
52010
  throw new TypeError(`Expected a string, got ${typeof filePath}`);
51979
52011
  }
51980
52012
  try {
51981
- return fs8[fsStatType](filePath)[statsMethodName]();
52013
+ return fs9[fsStatType](filePath)[statsMethodName]();
51982
52014
  } catch (error2) {
51983
52015
  if (error2.code === "ENOENT") {
51984
52016
  return false;
@@ -59657,14 +59689,14 @@ var require_parser2 = __commonJS({
59657
59689
  case "scalar":
59658
59690
  case "single-quoted-scalar":
59659
59691
  case "double-quoted-scalar": {
59660
- const fs8 = this.flowScalar(this.type);
59692
+ const fs9 = this.flowScalar(this.type);
59661
59693
  if (atNextItem || it.value) {
59662
- map.items.push({ start, key: fs8, sep: [] });
59694
+ map.items.push({ start, key: fs9, sep: [] });
59663
59695
  this.onKeyLine = true;
59664
59696
  } else if (it.sep) {
59665
- this.stack.push(fs8);
59697
+ this.stack.push(fs9);
59666
59698
  } else {
59667
- Object.assign(it, { key: fs8, sep: [] });
59699
+ Object.assign(it, { key: fs9, sep: [] });
59668
59700
  this.onKeyLine = true;
59669
59701
  }
59670
59702
  return;
@@ -59783,13 +59815,13 @@ var require_parser2 = __commonJS({
59783
59815
  case "scalar":
59784
59816
  case "single-quoted-scalar":
59785
59817
  case "double-quoted-scalar": {
59786
- const fs8 = this.flowScalar(this.type);
59818
+ const fs9 = this.flowScalar(this.type);
59787
59819
  if (!it || it.value)
59788
- fc.items.push({ start: [], key: fs8, sep: [] });
59820
+ fc.items.push({ start: [], key: fs9, sep: [] });
59789
59821
  else if (it.sep)
59790
- this.stack.push(fs8);
59822
+ this.stack.push(fs9);
59791
59823
  else
59792
- Object.assign(it, { key: fs8, sep: [] });
59824
+ Object.assign(it, { key: fs9, sep: [] });
59793
59825
  return;
59794
59826
  }
59795
59827
  case "flow-map-end":
@@ -60340,8 +60372,8 @@ var init_studioUtils = __esm({
60340
60372
  };
60341
60373
  };
60342
60374
  drizzleForSQLite = async (config, sqliteSchema2, relations4, ts, verbose) => {
60343
- const { driver, dbCredentials: creds } = config;
60344
- if (driver === "d1") {
60375
+ const { driver: driver2, dbCredentials: creds } = config;
60376
+ if (driver2 === "d1") {
60345
60377
  const { drizzle: drizzle2 } = await Promise.resolve().then(() => (init_driver(), driver_exports));
60346
60378
  const { execute: execute2 } = await Promise.resolve().then(() => (init_wrangler_client(), wrangler_client_exports));
60347
60379
  const db = drizzle2(execute2, creds.wranglerConfigPath, creds.dbName, {
@@ -60359,7 +60391,7 @@ var init_studioUtils = __esm({
60359
60391
  ts
60360
60392
  };
60361
60393
  }
60362
- if (driver === "better-sqlite") {
60394
+ if (driver2 === "better-sqlite") {
60363
60395
  assertPackages("better-sqlite3");
60364
60396
  const { drizzle: drizzle2 } = await import("drizzle-orm/better-sqlite3");
60365
60397
  const Database = await import("better-sqlite3");
@@ -60378,7 +60410,7 @@ var init_studioUtils = __esm({
60378
60410
  ts
60379
60411
  };
60380
60412
  }
60381
- if (driver === "libsql" || driver === "turso") {
60413
+ if (driver2 === "libsql" || driver2 === "turso") {
60382
60414
  assertPackages("@libsql/client");
60383
60415
  const { drizzle: drizzle2 } = await import("drizzle-orm/libsql");
60384
60416
  const { createClient } = await import("@libsql/client");
@@ -60402,7 +60434,7 @@ var init_studioUtils = __esm({
60402
60434
  ts
60403
60435
  };
60404
60436
  }
60405
- assertUnreachable(driver);
60437
+ assertUnreachable(driver2);
60406
60438
  };
60407
60439
  drizzleDb = async (drizzleConfig, models, logger) => {
60408
60440
  if (drizzleConfig.driver === "pg") {
@@ -61116,8 +61148,8 @@ var init_mysql = __esm({
61116
61148
  mysqlConnectionConfig
61117
61149
  );
61118
61150
  printCliConnectionIssues3 = (options) => {
61119
- const { driver, uri, host, database } = options || {};
61120
- if (driver !== "mysql2") {
61151
+ const { driver: driver2, uri, host, database } = options || {};
61152
+ if (driver2 !== "mysql2") {
61121
61153
  console.log(outputs.mysql.connection.driver());
61122
61154
  }
61123
61155
  if (!uri && (!host || !database)) {
@@ -61156,7 +61188,7 @@ var init_mysql = __esm({
61156
61188
  const {
61157
61189
  out,
61158
61190
  schema: schema4,
61159
- driver,
61191
+ driver: driver2,
61160
61192
  schemaFilter,
61161
61193
  tablesFilter,
61162
61194
  breakpoints,
@@ -61166,7 +61198,7 @@ var init_mysql = __esm({
61166
61198
  return {
61167
61199
  out,
61168
61200
  schema: schema4,
61169
- driver,
61201
+ driver: driver2,
61170
61202
  schemaFilter,
61171
61203
  tablesFilter,
61172
61204
  breakpoints,
@@ -61202,13 +61234,13 @@ var init_mysql = __esm({
61202
61234
  strict,
61203
61235
  verbose,
61204
61236
  schema: schema4,
61205
- driver,
61237
+ driver: driver2,
61206
61238
  schemaFilter,
61207
61239
  tablesFilter,
61208
61240
  ...rest
61209
61241
  } = cliRes.data;
61210
61242
  return {
61211
- driver,
61243
+ driver: driver2,
61212
61244
  schema: schema4,
61213
61245
  strict,
61214
61246
  verbose,
@@ -61289,7 +61321,7 @@ var require_package = __commonJS({
61289
61321
  // node_modules/.pnpm/dotenv@16.0.3/node_modules/dotenv/lib/main.js
61290
61322
  var require_main = __commonJS({
61291
61323
  "node_modules/.pnpm/dotenv@16.0.3/node_modules/dotenv/lib/main.js"(exports, module2) {
61292
- var fs8 = require("fs");
61324
+ var fs9 = require("fs");
61293
61325
  var path4 = require("path");
61294
61326
  var os2 = require("os");
61295
61327
  var packageJson = require_package();
@@ -61334,7 +61366,7 @@ var require_main = __commonJS({
61334
61366
  }
61335
61367
  }
61336
61368
  try {
61337
- const parsed = DotenvModule.parse(fs8.readFileSync(dotenvPath, { encoding }));
61369
+ const parsed = DotenvModule.parse(fs9.readFileSync(dotenvPath, { encoding }));
61338
61370
  Object.keys(parsed).forEach(function(key) {
61339
61371
  if (!Object.prototype.hasOwnProperty.call(process.env, key)) {
61340
61372
  process.env[key] = parsed[key];
@@ -62128,7 +62160,7 @@ __export(cli_exports, {
62128
62160
  });
62129
62161
  module.exports = __toCommonJS(cli_exports);
62130
62162
  var import_commander = require("commander");
62131
- var import_fs11 = require("fs");
62163
+ var import_fs12 = require("fs");
62132
62164
  init_lib();
62133
62165
 
62134
62166
  // src/cli/commands/check.ts
@@ -62177,7 +62209,7 @@ init_source();
62177
62209
  // package.json
62178
62210
  var package_default = {
62179
62211
  name: "drizzle-kit",
62180
- version: "0.20.7",
62212
+ version: "0.20.8",
62181
62213
  repository: "https://github.com/drizzle-team/drizzle-kit-mirror",
62182
62214
  author: "Drizzle Team",
62183
62215
  license: "MIT",
@@ -62369,13 +62401,18 @@ var import_fs10 = require("fs");
62369
62401
  var import_hanji8 = __toESM(require_hanji());
62370
62402
  var import_path6 = require("path");
62371
62403
  init_views();
62372
- var dropMigration = async (out) => {
62404
+ init_migrate();
62405
+ var import_fs11 = __toESM(require("fs"));
62406
+ var dropMigration = async ({
62407
+ out,
62408
+ bundle
62409
+ }) => {
62373
62410
  const metaFilePath = (0, import_path6.join)(out, "meta", "_journal.json");
62374
- const journal = JSON.parse(
62375
- (0, import_fs10.readFileSync)(metaFilePath, "utf-8")
62376
- );
62411
+ const journal = JSON.parse((0, import_fs10.readFileSync)(metaFilePath, "utf-8"));
62377
62412
  if (journal.entries.length === 0) {
62378
- console.log(`[${source_default.blue("i")}] no migration entries found in ${metaFilePath}`);
62413
+ console.log(
62414
+ `[${source_default.blue("i")}] no migration entries found in ${metaFilePath}`
62415
+ );
62379
62416
  return;
62380
62417
  }
62381
62418
  const result = await (0, import_hanji8.render)(new DropMigrationView(journal.entries));
@@ -62387,11 +62424,25 @@ var dropMigration = async (out) => {
62387
62424
  entries: journal.entries.filter(Boolean)
62388
62425
  };
62389
62426
  const sqlFilePath = (0, import_path6.join)(out, `${result.data.tag}.sql`);
62390
- const snapshotFilePath = (0, import_path6.join)(out, "meta", `${result.data.idx.toFixed(0).padStart(4, "0")}_snapshot.json`);
62427
+ const snapshotFilePath = (0, import_path6.join)(
62428
+ out,
62429
+ "meta",
62430
+ `${result.data.idx.toFixed(0).padStart(4, "0")}_snapshot.json`
62431
+ );
62391
62432
  (0, import_fs10.rmSync)(sqlFilePath);
62392
62433
  (0, import_fs10.rmSync)(snapshotFilePath);
62393
62434
  (0, import_fs10.writeFileSync)(metaFilePath, JSON.stringify(resultJournal));
62394
- console.log(`[${source_default.green("\u2713")}] ${source_default.bold(result.data.tag)} migration successfully dropped`);
62435
+ if (bundle) {
62436
+ import_fs11.default.writeFileSync(
62437
+ (0, import_path6.join)(out, `migrations.js`),
62438
+ embeddedMigrations(resultJournal)
62439
+ );
62440
+ }
62441
+ console.log(
62442
+ `[${source_default.green("\u2713")}] ${source_default.bold(
62443
+ result.data.tag
62444
+ )} migration successfully dropped`
62445
+ );
62395
62446
  };
62396
62447
 
62397
62448
  // src/cli/index.ts
@@ -63013,7 +63064,7 @@ var generateMysqlCommand = new import_commander.Command("generate:mysql").option
63013
63064
  var dbPushMysqlCommand = new import_commander.Command("push:mysql").option(
63014
63065
  "--config <config>",
63015
63066
  "Path to a config.json file, drizzle.config.ts by default"
63016
- ).option("--schema <schema...>", "Path to a schema file or folder").option("--tablesFilter", `Table name filters`).option("--connectionString <connectionString>", "MySQL connection string").option("--driver <driver>", "MySQL database path").option("--connectionString <connectionString>", "MySQL connection string").option("--host <host>", "MySQL host").option("--port <port>", "MySQL port").option("--user <user>", "MySQL user").option("--password <password>", "MySQL password").option("--database <database>", "MySQL database name").option("--verbose", "Print all statements for each push").option("--strict", "Always ask for confirmation").action(async (options) => {
63067
+ ).option("--schema <schema...>", "Path to a schema file or folder").option("--tablesFilter", `Table name filters`).option("--connectionString <connectionString>", "MySQL connection string").option("--driver <driver>", "Driver used for querying the database").option("--connectionString <connectionString>", "MySQL connection string").option("--host <host>", "MySQL host").option("--port <port>", "MySQL port").option("--user <user>", "MySQL user").option("--password <password>", "MySQL password").option("--database <database>", "MySQL database name").option("--verbose", "Print all statements for each push").option("--strict", "Always ask for confirmation").action(async (options) => {
63017
63068
  await printVersions();
63018
63069
  await assertPackages("drizzle-orm");
63019
63070
  await assertOrmCoreVersion();
@@ -63130,7 +63181,7 @@ var dbPushPgCommand = new import_commander.Command("push:pg").option(
63130
63181
  ).option("--schema <schema...>", "Path to a schema file or folder").option("--tablesFilter", `Table name filters`).option("--schemaFilters", `Schema name filters`).option(
63131
63182
  "--connectionString <connectionString>",
63132
63183
  "PostgreSQL connection string"
63133
- ).option("--driver <driver>", "PostgreSQL database path").option(
63184
+ ).option("--driver <driver>", "Driver used for querying the database").option(
63134
63185
  "--connectionString <connectionString>",
63135
63186
  "PostgreSQL connection string"
63136
63187
  ).option("--host <host>", "PostgreSQL host").option("--port <port>", "PostgreSQL port").option("--user <user>", "PostgreSQL user").option("--password <password>", "PostgreSQL password").option("--ssl <ssl>", "Postgres ssl").option("--database <database>", "PostgreSQL database name").option("--verbose", "Print all statements for each push").option("--strict", "Always ask for confirmation").action(async (options) => {
@@ -63240,7 +63291,7 @@ var dbPushPgCommand = new import_commander.Command("push:pg").option(
63240
63291
  var dbPushSqliteCommand = new import_commander.Command("push:sqlite").option(
63241
63292
  "--config <config>",
63242
63293
  "Path to a config.ts file, drizzle.config.ts by default"
63243
- ).option("--schema <schema>", "Path to a schema file or folder").option("--tablesFilter", `Table name filters`).option("--connectionString <connectionString>", "SQLite connection string").option("--driver <driver>", "SQLite database path").option("--url <url>", "SQLite database path").option("--auth-token <authToken>", "SQLite database path").option("--verbose", "Print all statements for each push").option("--strict", "Always ask for confirmation").action(async (options) => {
63294
+ ).option("--schema <schema>", "Path to a schema file or folder").option("--tablesFilter", `Table name filters`).option("--connectionString <connectionString>", "SQLite connection string").option("--driver <driver>", "Driver used for querying the database").option("--url <url>", "SQLite database path").option("--auth-token <authToken>", "SQLite database path").option("--verbose", "Print all statements for each push").option("--strict", "Always ask for confirmation").action(async (options) => {
63244
63295
  printVersions();
63245
63296
  assertPackages("drizzle-orm");
63246
63297
  assertOrmCoreVersion();
@@ -63355,7 +63406,8 @@ var generateSqliteCommand = new import_commander.Command("generate:sqlite").opti
63355
63406
  });
63356
63407
  var checkSchema = objectType({
63357
63408
  out: stringType().optional(),
63358
- config: stringType().optional()
63409
+ config: stringType().optional(),
63410
+ driver: stringType().optional()
63359
63411
  }).strict();
63360
63412
  var checkPgCommand = new import_commander.Command("check:pg").option("--out <out>", `Output folder`).option("--config <config>", `Config path [default=drizzle.config.ts]`).action(async (options) => {
63361
63413
  await printVersions();
@@ -63461,7 +63513,7 @@ var upSqliteCommand = new import_commander.Command("up:sqlite").option("--out <o
63461
63513
  var introspectPgCommand = new import_commander.Command("introspect:pg").option("--out <out>", `Migrations folder`).option("--breakpoints", `Prepare SQL statements with breakpoints`).option(
63462
63514
  "--introspect-casing <introspectCasing>",
63463
63515
  "Column object keys naming strategy"
63464
- ).option("--tablesFilter", `Table name filters`).option("--driver <driver>", "Postgres connection string").option("--connectionString <connectionString>", "Postgres connection string").option("--host <host>", "Postgres host").option("--port <port>", "Postgres port").option("--user <user>", "Postgres user").option("--password <password>", "Postgres password").option("--database <database>", "Postgres database name").option("--ssl <ssl>", "Postgres ssl").option("--config <config>", `Config path [default=drizzle.config.ts]`).action(async (options) => {
63516
+ ).option("--tablesFilter", `Table name filters`).option("--driver <driver>", "Driver used for querying the database").option("--connectionString <connectionString>", "Postgres connection string").option("--host <host>", "Postgres host").option("--port <port>", "Postgres port").option("--user <user>", "Postgres user").option("--password <password>", "Postgres password").option("--database <database>", "Postgres database name").option("--ssl <ssl>", "Postgres ssl").option("--config <config>", `Config path [default=drizzle.config.ts]`).action(async (options) => {
63465
63517
  await printVersions();
63466
63518
  await assertPackages("drizzle-orm");
63467
63519
  await assertOrmCoreVersion();
@@ -63480,7 +63532,7 @@ var introspectPgCommand = new import_commander.Command("introspect:pg").option("
63480
63532
  schemasFilter
63481
63533
  );
63482
63534
  const schemaFile = import_path7.default.join(validatedConfig.out, "schema.ts");
63483
- (0, import_fs11.writeFileSync)(schemaFile, ts.file);
63535
+ (0, import_fs12.writeFileSync)(schemaFile, ts.file);
63484
63536
  console.log();
63485
63537
  if (snapshots.length === 0) {
63486
63538
  const { sqlStatements, _meta } = await prepareSQL(
@@ -63533,7 +63585,7 @@ var introspectMySqlCommand = new import_commander.Command("introspect:mysql").op
63533
63585
  const tablesFilter = filterConfig ? typeof filterConfig === "string" ? [filterConfig] : filterConfig : [];
63534
63586
  const { schema: schema4, ts } = await mysqlIntrospect2(res, tablesFilter);
63535
63587
  const schemaFile = import_path7.default.join(out, "schema.ts");
63536
- (0, import_fs11.writeFileSync)(schemaFile, ts.file);
63588
+ (0, import_fs12.writeFileSync)(schemaFile, ts.file);
63537
63589
  console.log();
63538
63590
  if (snapshots.length === 0) {
63539
63591
  const { sqlStatements, _meta } = await prepareSQL(
@@ -63574,7 +63626,7 @@ var introspectSQLiteCommand = new import_commander.Command("introspect:sqlite").
63574
63626
  ).option(
63575
63627
  "--introspect-casing <introspectCasing>",
63576
63628
  "Column object keys naming strategy"
63577
- ).option("--tablesFilter", `Table name filters`).option("--schema <schema>", `Migrations folder`).option("--out <out>", `Migrations folder`).option("--breakpoints", `Prepare SQL statements with breakpoints`).option("--driver <driver>", "SQLite database path").option("--url <url>", "SQLite database url").option("--auth-token <authToken>", "SQLite database path").action(async (options) => {
63629
+ ).option("--tablesFilter", `Table name filters`).option("--schema <schema>", `Migrations folder`).option("--out <out>", `Migrations folder`).option("--breakpoints", `Prepare SQL statements with breakpoints`).option("--driver <driver>", "Driver used for querying the database").option("--url <url>", "SQLite database url").option("--auth-token <authToken>", "SQLite database path").action(async (options) => {
63578
63630
  printVersions();
63579
63631
  assertPackages("drizzle-orm");
63580
63632
  assertOrmCoreVersion();
@@ -63586,7 +63638,7 @@ var introspectSQLiteCommand = new import_commander.Command("introspect:sqlite").
63586
63638
  const tablesFilter = filterConfig ? typeof filterConfig === "string" ? [filterConfig] : filterConfig : [];
63587
63639
  const { schema: schema4, ts } = await sqliteIntrospect2(res, tablesFilter);
63588
63640
  const schemaFile = import_path7.default.join(out, "schema.ts");
63589
- (0, import_fs11.writeFileSync)(schemaFile, ts.file);
63641
+ (0, import_fs12.writeFileSync)(schemaFile, ts.file);
63590
63642
  console.log();
63591
63643
  if (snapshots.length === 0) {
63592
63644
  const { sqlStatements, _meta } = await prepareSQL(
@@ -63621,7 +63673,7 @@ var introspectSQLiteCommand = new import_commander.Command("introspect:sqlite").
63621
63673
  );
63622
63674
  process.exit(0);
63623
63675
  });
63624
- var dropCommand = new import_commander.Command("drop").option("--out <out>", `Output folder`).option("--config <config>", `Config path [default=drizzle.config.ts]`).action(async (options) => {
63676
+ var dropCommand = new import_commander.Command("drop").option("--out <out>", `Output folder`).option("--driver <driver>", `Driver used for querying the database`).option("--config <config>", `Config path [default=drizzle.config.ts]`).action(async (options) => {
63625
63677
  await printVersions();
63626
63678
  await assertOrmCoreVersion();
63627
63679
  const collisionRes = checkCollisions(
@@ -63634,8 +63686,15 @@ var dropCommand = new import_commander.Command("drop").option("--out <out>", `Ou
63634
63686
  }
63635
63687
  const params = checkSchema.parse(options);
63636
63688
  const out = await assertOutFolder(params);
63689
+ let bundle = false;
63690
+ if (typeof options.driver !== "undefined") {
63691
+ bundle = options.driver === "expo";
63692
+ } else {
63693
+ const drizzleConfig = await drizzleConfigFromFile(options.config);
63694
+ bundle = drizzleConfig.driver === "expo";
63695
+ }
63637
63696
  assertV1OutFolder(out, "{dialect}");
63638
- await dropMigration(out);
63697
+ await dropMigration({ out, bundle });
63639
63698
  });
63640
63699
  var studioCommand = new import_commander.Command("studio").option("--port <port>", "Custom port for drizzle studio [default=4983]").option("--host <host>", "Custom host for drizzle studio [default=0.0.0.0]").option("--verbose", "Print all stataments that are executed by Studio").option("--config <config>", `Config path [default=drizzle.config.ts]`).action(async (options) => {
63641
63700
  await printVersions();
@@ -63651,9 +63710,9 @@ var studioCommand = new import_commander.Command("studio").option("--port <port>
63651
63710
  prepareSQLiteSchema: prepareSQLiteSchema2,
63652
63711
  drizzleForSQLite: drizzleForSQLite2
63653
63712
  } = await Promise.resolve().then(() => (init_studioUtils(), studioUtils_exports));
63654
- const { driver, schema: schemaPath } = drizzleConfig;
63713
+ const { driver: driver2, schema: schemaPath } = drizzleConfig;
63655
63714
  let setup;
63656
- if (driver === "pg") {
63715
+ if (driver2 === "pg") {
63657
63716
  const { schemaToTypeScript: schemaToTypeScript4, relationsToTypeScript: relationsToTypeScript2 } = await Promise.resolve().then(() => (init_introspect_pg(), introspect_pg_exports));
63658
63717
  const { serializePg: serializePg2 } = await Promise.resolve().then(() => (init_serializer(), serializer_exports));
63659
63718
  const { schema: schema4, relations: relations4 } = await preparePgSchema2(schemaPath);
@@ -63671,7 +63730,7 @@ var studioCommand = new import_commander.Command("studio").option("--port <port>
63671
63730
  },
63672
63731
  Boolean(options.verbose)
63673
63732
  );
63674
- } else if (driver === "mysql2") {
63733
+ } else if (driver2 === "mysql2") {
63675
63734
  const { schemaToTypeScript: schemaToTypeScript4 } = await Promise.resolve().then(() => (init_introspect_mysql(), introspect_mysql_exports));
63676
63735
  const { schema: schema4, relations: relations4 } = await prepareMySqlSchema2(schemaPath);
63677
63736
  const { serializeMySql: serializeMySql2 } = await Promise.resolve().then(() => (init_serializer(), serializer_exports));
@@ -63688,7 +63747,7 @@ var studioCommand = new import_commander.Command("studio").option("--port <port>
63688
63747
  },
63689
63748
  Boolean(options.verbose)
63690
63749
  );
63691
- } else if (driver === "better-sqlite" || driver === "d1" || driver === "libsql" || driver === "turso") {
63750
+ } else if (driver2 === "better-sqlite" || driver2 === "d1" || driver2 === "libsql" || driver2 === "turso") {
63692
63751
  const { schemaToTypeScript: schemaToTypeScript4 } = await Promise.resolve().then(() => (init_introspect_sqlite(), introspect_sqlite_exports));
63693
63752
  const { schema: schema4, relations: relations4 } = await prepareSQLiteSchema2(schemaPath);
63694
63753
  const { serializeSQLite: serializeSQLite2 } = await Promise.resolve().then(() => (init_serializer(), serializer_exports));
@@ -63706,7 +63765,7 @@ var studioCommand = new import_commander.Command("studio").option("--port <port>
63706
63765
  Boolean(options.verbose)
63707
63766
  );
63708
63767
  } else {
63709
- assertUnreachable(driver);
63768
+ assertUnreachable(driver2);
63710
63769
  }
63711
63770
  const qeueryEngine = (0, import_studio.queryEngineForSetup)(setup);
63712
63771
  const server = await (0, import_server.prepareServer)((_2) => {
@@ -63720,7 +63779,7 @@ var studioCommand = new import_commander.Command("studio").option("--port <port>
63720
63779
  "Drizzle Studio is currently in Beta. If you find anything that is not working as expected or should be improved, feel free to create an issue on GitHub: https://github.com/drizzle-team/drizzle-kit-mirror/issues/new or write to us on Discord: https://discord.gg/WcRKz2FFxN"
63721
63780
  )
63722
63781
  );
63723
- if (driver === "d1") {
63782
+ if (driver2 === "d1") {
63724
63783
  console.log(
63725
63784
  withStyle.fullWarning(
63726
63785
  "It seems like you are trying to access your D1 Database. Please make sure to run 'wrangler login' before using Drizzle Studio to ensure it has your token for making requests to the D1 Database. If you encounter an error related to CLOUDFLARE_TOKEN, please run 'wrangler login' and restart the studio"