drizzle-kit 0.21.4 → 0.22.0-12a1bf8

Sign up to get free protection for your applications and to get access to all the features.
package/bin.cjs CHANGED
@@ -1456,7 +1456,7 @@ var init_global = __esm({
1456
1456
  "src/global.ts"() {
1457
1457
  "use strict";
1458
1458
  originUUID = "00000000-0000-0000-0000-000000000000";
1459
- snapshotVersion = "6";
1459
+ snapshotVersion = "7";
1460
1460
  mapValues = (obj, map) => {
1461
1461
  const result = Object.keys(obj).reduce(function(result2, key) {
1462
1462
  result2[key] = map(obj[key]);
@@ -5658,7 +5658,7 @@ var init_mysqlSchema = __esm({
5658
5658
  });
5659
5659
 
5660
5660
  // src/serializer/pgSchema.ts
5661
- var indexV2, columnV2, tableV2, enumSchemaV1, enumSchema, pgSchemaV2, references, columnV1, tableV1, pgSchemaV1, index2, fk2, column2, tableV32, compositePK2, uniqueConstraint2, tableV42, table2, schemaHash2, kitInternals2, pgSchemaInternalV3, pgSchemaInternalV4, pgSchemaInternalV5, pgSchemaExternal, pgSchemaInternal, tableSquashed2, tableSquashedV42, pgSchemaSquashedV4, pgSchemaSquashed, pgSchemaV3, pgSchemaV4, pgSchemaV5, pgSchema, backwardCompatiblePgSchema, PgSquasher, squashPgScheme, dryPg;
5661
+ var indexV2, columnV2, tableV2, enumSchemaV1, enumSchema, pgSchemaV2, references, columnV1, tableV1, pgSchemaV1, indexColumn, index2, indexV4, indexV5, indexV6, fk2, column2, tableV32, compositePK2, uniqueConstraint2, tableV42, tableV6, tableV5, table2, schemaHash2, kitInternals2, pgSchemaInternalV3, pgSchemaInternalV4, pgSchemaInternalV5, pgSchemaInternalV6, pgSchemaExternal, pgSchemaInternal, tableSquashed2, tableSquashedV42, pgSchemaSquashedV4, pgSchemaSquashedV6, pgSchemaSquashed, pgSchemaV3, pgSchemaV4, pgSchemaV5, pgSchemaV6, pgSchema, backwardCompatiblePgSchema, PgSquasher, squashPgScheme, dryPg;
5662
5662
  var init_pgSchema = __esm({
5663
5663
  "src/serializer/pgSchema.ts"() {
5664
5664
  "use strict";
@@ -5726,10 +5726,48 @@ var init_pgSchema = __esm({
5726
5726
  tables: recordType(stringType(), tableV1),
5727
5727
  enums: recordType(stringType(), enumSchemaV1)
5728
5728
  }).strict();
5729
+ indexColumn = objectType({
5730
+ expression: stringType(),
5731
+ isExpression: booleanType(),
5732
+ asc: booleanType(),
5733
+ nulls: stringType().optional(),
5734
+ opclass: stringType().optional()
5735
+ });
5729
5736
  index2 = objectType({
5737
+ name: stringType(),
5738
+ columns: indexColumn.array(),
5739
+ isUnique: booleanType(),
5740
+ with: recordType(stringType(), anyType()).optional(),
5741
+ method: stringType().default("btree"),
5742
+ where: stringType().optional(),
5743
+ concurrently: booleanType().default(false)
5744
+ }).strict();
5745
+ indexV4 = objectType({
5730
5746
  name: stringType(),
5731
5747
  columns: stringType().array(),
5732
- isUnique: booleanType()
5748
+ isUnique: booleanType(),
5749
+ with: recordType(stringType(), stringType()).optional(),
5750
+ method: stringType().default("btree"),
5751
+ where: stringType().optional(),
5752
+ concurrently: booleanType().default(false)
5753
+ }).strict();
5754
+ indexV5 = objectType({
5755
+ name: stringType(),
5756
+ columns: stringType().array(),
5757
+ isUnique: booleanType(),
5758
+ with: recordType(stringType(), stringType()).optional(),
5759
+ method: stringType().default("btree"),
5760
+ where: stringType().optional(),
5761
+ concurrently: booleanType().default(false)
5762
+ }).strict();
5763
+ indexV6 = objectType({
5764
+ name: stringType(),
5765
+ columns: stringType().array(),
5766
+ isUnique: booleanType(),
5767
+ with: recordType(stringType(), stringType()).optional(),
5768
+ method: stringType().default("btree"),
5769
+ where: stringType().optional(),
5770
+ concurrently: booleanType().default(false)
5733
5771
  }).strict();
5734
5772
  fk2 = objectType({
5735
5773
  name: stringType(),
@@ -5771,9 +5809,27 @@ var init_pgSchema = __esm({
5771
5809
  name: stringType(),
5772
5810
  schema: stringType(),
5773
5811
  columns: recordType(stringType(), column2),
5774
- indexes: recordType(stringType(), index2),
5812
+ indexes: recordType(stringType(), indexV4),
5775
5813
  foreignKeys: recordType(stringType(), fk2)
5776
5814
  }).strict();
5815
+ tableV6 = objectType({
5816
+ name: stringType(),
5817
+ schema: stringType(),
5818
+ columns: recordType(stringType(), column2),
5819
+ indexes: recordType(stringType(), indexV6),
5820
+ foreignKeys: recordType(stringType(), fk2),
5821
+ compositePrimaryKeys: recordType(stringType(), compositePK2),
5822
+ uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
5823
+ }).strict();
5824
+ tableV5 = objectType({
5825
+ name: stringType(),
5826
+ schema: stringType(),
5827
+ columns: recordType(stringType(), column2),
5828
+ indexes: recordType(stringType(), indexV5),
5829
+ foreignKeys: recordType(stringType(), fk2),
5830
+ compositePrimaryKeys: recordType(stringType(), compositePK2),
5831
+ uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
5832
+ }).strict();
5777
5833
  table2 = objectType({
5778
5834
  name: stringType(),
5779
5835
  schema: stringType(),
@@ -5818,7 +5874,7 @@ var init_pgSchema = __esm({
5818
5874
  pgSchemaInternalV5 = objectType({
5819
5875
  version: literalType("5"),
5820
5876
  dialect: literalType("pg"),
5821
- tables: recordType(stringType(), table2),
5877
+ tables: recordType(stringType(), tableV5),
5822
5878
  enums: recordType(stringType(), enumSchemaV1),
5823
5879
  schemas: recordType(stringType(), stringType()),
5824
5880
  _meta: objectType({
@@ -5828,6 +5884,19 @@ var init_pgSchema = __esm({
5828
5884
  }),
5829
5885
  internal: kitInternals2
5830
5886
  }).strict();
5887
+ pgSchemaInternalV6 = objectType({
5888
+ version: literalType("6"),
5889
+ dialect: literalType("postgresql"),
5890
+ tables: recordType(stringType(), tableV6),
5891
+ enums: recordType(stringType(), enumSchema),
5892
+ schemas: recordType(stringType(), stringType()),
5893
+ _meta: objectType({
5894
+ schemas: recordType(stringType(), stringType()),
5895
+ tables: recordType(stringType(), stringType()),
5896
+ columns: recordType(stringType(), stringType())
5897
+ }),
5898
+ internal: kitInternals2
5899
+ }).strict();
5831
5900
  pgSchemaExternal = objectType({
5832
5901
  version: literalType("5"),
5833
5902
  dialect: literalType("pg"),
@@ -5841,7 +5910,7 @@ var init_pgSchema = __esm({
5841
5910
  })
5842
5911
  }).strict();
5843
5912
  pgSchemaInternal = objectType({
5844
- version: literalType("6"),
5913
+ version: literalType("7"),
5845
5914
  dialect: literalType("postgresql"),
5846
5915
  tables: recordType(stringType(), table2),
5847
5916
  enums: recordType(stringType(), enumSchema),
@@ -5876,29 +5945,94 @@ var init_pgSchema = __esm({
5876
5945
  enums: recordType(stringType(), enumSchemaV1),
5877
5946
  schemas: recordType(stringType(), stringType())
5878
5947
  }).strict();
5879
- pgSchemaSquashed = objectType({
5948
+ pgSchemaSquashedV6 = objectType({
5880
5949
  version: literalType("6"),
5881
5950
  dialect: literalType("postgresql"),
5882
5951
  tables: recordType(stringType(), tableSquashed2),
5883
5952
  enums: recordType(stringType(), enumSchema),
5884
5953
  schemas: recordType(stringType(), stringType())
5885
5954
  }).strict();
5955
+ pgSchemaSquashed = objectType({
5956
+ version: literalType("7"),
5957
+ dialect: literalType("postgresql"),
5958
+ tables: recordType(stringType(), tableSquashed2),
5959
+ enums: recordType(stringType(), enumSchema),
5960
+ schemas: recordType(stringType(), stringType())
5961
+ }).strict();
5886
5962
  pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
5887
5963
  pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
5888
5964
  pgSchemaV5 = pgSchemaInternalV5.merge(schemaHash2);
5965
+ pgSchemaV6 = pgSchemaInternalV6.merge(schemaHash2);
5889
5966
  pgSchema = pgSchemaInternal.merge(schemaHash2);
5890
- backwardCompatiblePgSchema = unionType([pgSchemaV5, pgSchema]);
5967
+ backwardCompatiblePgSchema = unionType([
5968
+ pgSchemaV5,
5969
+ pgSchemaV6,
5970
+ pgSchema
5971
+ ]);
5891
5972
  PgSquasher = {
5892
5973
  squashIdx: (idx) => {
5893
5974
  index2.parse(idx);
5894
- return `${idx.name};${idx.columns.join(",")};${idx.isUnique}`;
5975
+ return `${idx.name};${idx.columns.map(
5976
+ (c) => `${c.expression},${c.isExpression},${c.asc},${c.nulls},${c.opclass}`
5977
+ ).join(",,")};${idx.isUnique};${idx.concurrently};${idx.method};${idx.where};${JSON.stringify(idx.with)}`;
5895
5978
  },
5896
5979
  unsquashIdx: (input) => {
5897
- const [name, columnsString, isUnique] = input.split(";");
5980
+ const [
5981
+ name,
5982
+ columnsString,
5983
+ isUnique,
5984
+ concurrently,
5985
+ method,
5986
+ where,
5987
+ idxWith
5988
+ ] = input.split(";");
5989
+ const columnString = columnsString.split(",,");
5990
+ const columns = [];
5991
+ for (const column7 of columnString) {
5992
+ const [expression, isExpression, asc, nulls, opclass] = column7.split(",");
5993
+ columns.push({
5994
+ nulls,
5995
+ isExpression: isExpression === "true",
5996
+ asc: asc === "true",
5997
+ expression,
5998
+ opclass: opclass === "undefined" ? void 0 : opclass
5999
+ });
6000
+ }
5898
6001
  const result = index2.parse({
5899
6002
  name,
5900
- columns: columnsString.split(","),
5901
- isUnique: isUnique === "true"
6003
+ columns,
6004
+ isUnique: isUnique === "true",
6005
+ concurrently: concurrently === "true",
6006
+ method,
6007
+ where: where === "undefined" ? void 0 : where,
6008
+ with: !idxWith || idxWith === "undefined" ? void 0 : JSON.parse(idxWith)
6009
+ });
6010
+ return result;
6011
+ },
6012
+ squashIdxPush: (idx) => {
6013
+ index2.parse(idx);
6014
+ return `${idx.name};${idx.columns.map((c) => `${c.isExpression ? "" : c.expression},${c.asc},${c.nulls}`).join(",,")};${idx.isUnique};${idx.method};${JSON.stringify(idx.with)}`;
6015
+ },
6016
+ unsquashIdxPush: (input) => {
6017
+ const [name, columnsString, isUnique, method, idxWith] = input.split(";");
6018
+ const columnString = columnsString.split(",,");
6019
+ const columns = [];
6020
+ for (const column7 of columnString) {
6021
+ const [expression, asc, nulls, opclass] = column7.split(",");
6022
+ columns.push({
6023
+ nulls,
6024
+ isExpression: expression === "",
6025
+ asc: asc === "true",
6026
+ expression
6027
+ });
6028
+ }
6029
+ const result = index2.parse({
6030
+ name,
6031
+ columns,
6032
+ isUnique: isUnique === "true",
6033
+ concurrently: false,
6034
+ method,
6035
+ with: idxWith === "undefined" ? void 0 : JSON.parse(idxWith)
5902
6036
  });
5903
6037
  return result;
5904
6038
  },
@@ -5947,11 +6081,11 @@ var init_pgSchema = __esm({
5947
6081
  return result;
5948
6082
  }
5949
6083
  };
5950
- squashPgScheme = (json) => {
6084
+ squashPgScheme = (json, action) => {
5951
6085
  const mappedTables = Object.fromEntries(
5952
6086
  Object.entries(json.tables).map((it) => {
5953
6087
  const squashedIndexes = mapValues(it[1].indexes, (index4) => {
5954
- return PgSquasher.squashIdx(index4);
6088
+ return action === "push" ? PgSquasher.squashIdxPush(index4) : PgSquasher.squashIdx(index4);
5955
6089
  });
5956
6090
  const squashedFKs = mapValues(it[1].foreignKeys, (fk4) => {
5957
6091
  return PgSquasher.squashFK(fk4);
@@ -5980,7 +6114,7 @@ var init_pgSchema = __esm({
5980
6114
  })
5981
6115
  );
5982
6116
  return {
5983
- version: "6",
6117
+ version: "7",
5984
6118
  dialect: json.dialect,
5985
6119
  tables: mappedTables,
5986
6120
  enums: json.enums,
@@ -6223,7 +6357,7 @@ var init_sqliteSchema = __esm({
6223
6357
  });
6224
6358
 
6225
6359
  // src/utils.ts
6226
- var import_fs, import_path, copy, objectValues, assertV1OutFolder, dryJournal, prepareOutFolder, validatorForDialect, validateWithReport, prepareMigrationFolder, prepareMigrationMeta, schemaRenameKey, tableRenameKey, columnRenameKey;
6360
+ var import_fs, import_path, import_url, copy, objectValues, assertV1OutFolder, dryJournal, prepareOutFolder, validatorForDialect, validateWithReport, prepareMigrationFolder, prepareMigrationMeta, schemaRenameKey, tableRenameKey, columnRenameKey, normaliseSQLiteUrl;
6227
6361
  var init_utils = __esm({
6228
6362
  "src/utils.ts"() {
6229
6363
  "use strict";
@@ -6234,6 +6368,7 @@ var init_utils = __esm({
6234
6368
  init_sqliteSchema();
6235
6369
  init_source();
6236
6370
  import_path = require("path");
6371
+ import_url = require("url");
6237
6372
  init_global();
6238
6373
  copy = (it) => {
6239
6374
  return JSON.parse(JSON.stringify(it));
@@ -6278,7 +6413,7 @@ var init_utils = __esm({
6278
6413
  validatorForDialect = (dialect7) => {
6279
6414
  switch (dialect7) {
6280
6415
  case "postgresql":
6281
- return { validator: backwardCompatiblePgSchema, version: 6 };
6416
+ return { validator: backwardCompatiblePgSchema, version: 7 };
6282
6417
  case "sqlite":
6283
6418
  return { validator: backwardCompatibleSqliteSchema, version: 6 };
6284
6419
  case "mysql":
@@ -6396,6 +6531,29 @@ var init_utils = __esm({
6396
6531
  const out = schema5 ? `"${schema5}"."${table4}"."${column7}"` : `"${table4}"."${column7}"`;
6397
6532
  return out;
6398
6533
  };
6534
+ normaliseSQLiteUrl = (it, type) => {
6535
+ if (type === "libsql") {
6536
+ if (it.startsWith("file:")) {
6537
+ return it;
6538
+ }
6539
+ try {
6540
+ const url = (0, import_url.parse)(it);
6541
+ if (url.protocol === null) {
6542
+ return `file:${it}`;
6543
+ }
6544
+ return it;
6545
+ } catch (e2) {
6546
+ return `file:${it}`;
6547
+ }
6548
+ }
6549
+ if (type === "better-sqlite") {
6550
+ if (it.startsWith("file:")) {
6551
+ return it.substring(5);
6552
+ }
6553
+ return it;
6554
+ }
6555
+ assertUnreachable(type);
6556
+ };
6399
6557
  }
6400
6558
  });
6401
6559
 
@@ -6809,7 +6967,7 @@ var require_semver = __commonJS({
6809
6967
  var require_parse = __commonJS({
6810
6968
  "node_modules/.pnpm/semver@7.6.2/node_modules/semver/functions/parse.js"(exports2, module2) {
6811
6969
  var SemVer = require_semver();
6812
- var parse6 = (version2, options, throwErrors = false) => {
6970
+ var parse7 = (version2, options, throwErrors = false) => {
6813
6971
  if (version2 instanceof SemVer) {
6814
6972
  return version2;
6815
6973
  }
@@ -6822,16 +6980,16 @@ var require_parse = __commonJS({
6822
6980
  throw er3;
6823
6981
  }
6824
6982
  };
6825
- module2.exports = parse6;
6983
+ module2.exports = parse7;
6826
6984
  }
6827
6985
  });
6828
6986
 
6829
6987
  // node_modules/.pnpm/semver@7.6.2/node_modules/semver/functions/valid.js
6830
6988
  var require_valid = __commonJS({
6831
6989
  "node_modules/.pnpm/semver@7.6.2/node_modules/semver/functions/valid.js"(exports2, module2) {
6832
- var parse6 = require_parse();
6990
+ var parse7 = require_parse();
6833
6991
  var valid = (version2, options) => {
6834
- const v6 = parse6(version2, options);
6992
+ const v6 = parse7(version2, options);
6835
6993
  return v6 ? v6.version : null;
6836
6994
  };
6837
6995
  module2.exports = valid;
@@ -6841,9 +6999,9 @@ var require_valid = __commonJS({
6841
6999
  // node_modules/.pnpm/semver@7.6.2/node_modules/semver/functions/clean.js
6842
7000
  var require_clean = __commonJS({
6843
7001
  "node_modules/.pnpm/semver@7.6.2/node_modules/semver/functions/clean.js"(exports2, module2) {
6844
- var parse6 = require_parse();
7002
+ var parse7 = require_parse();
6845
7003
  var clean = (version2, options) => {
6846
- const s2 = parse6(version2.trim().replace(/^[=v]+/, ""), options);
7004
+ const s2 = parse7(version2.trim().replace(/^[=v]+/, ""), options);
6847
7005
  return s2 ? s2.version : null;
6848
7006
  };
6849
7007
  module2.exports = clean;
@@ -6876,10 +7034,10 @@ var require_inc = __commonJS({
6876
7034
  // node_modules/.pnpm/semver@7.6.2/node_modules/semver/functions/diff.js
6877
7035
  var require_diff = __commonJS({
6878
7036
  "node_modules/.pnpm/semver@7.6.2/node_modules/semver/functions/diff.js"(exports2, module2) {
6879
- var parse6 = require_parse();
7037
+ var parse7 = require_parse();
6880
7038
  var diff2 = (version1, version2) => {
6881
- const v12 = parse6(version1, null, true);
6882
- const v22 = parse6(version2, null, true);
7039
+ const v12 = parse7(version1, null, true);
7040
+ const v22 = parse7(version2, null, true);
6883
7041
  const comparison = v12.compare(v22);
6884
7042
  if (comparison === 0) {
6885
7043
  return null;
@@ -6947,9 +7105,9 @@ var require_patch = __commonJS({
6947
7105
  // node_modules/.pnpm/semver@7.6.2/node_modules/semver/functions/prerelease.js
6948
7106
  var require_prerelease = __commonJS({
6949
7107
  "node_modules/.pnpm/semver@7.6.2/node_modules/semver/functions/prerelease.js"(exports2, module2) {
6950
- var parse6 = require_parse();
7108
+ var parse7 = require_parse();
6951
7109
  var prerelease = (version2, options) => {
6952
- const parsed = parse6(version2, options);
7110
+ const parsed = parse7(version2, options);
6953
7111
  return parsed && parsed.prerelease.length ? parsed.prerelease : null;
6954
7112
  };
6955
7113
  module2.exports = prerelease;
@@ -7121,7 +7279,7 @@ var require_cmp = __commonJS({
7121
7279
  var require_coerce = __commonJS({
7122
7280
  "node_modules/.pnpm/semver@7.6.2/node_modules/semver/functions/coerce.js"(exports2, module2) {
7123
7281
  var SemVer = require_semver();
7124
- var parse6 = require_parse();
7282
+ var parse7 = require_parse();
7125
7283
  var { safeRe: re2, t: t2 } = require_re();
7126
7284
  var coerce3 = (version2, options) => {
7127
7285
  if (version2 instanceof SemVer) {
@@ -7156,7 +7314,7 @@ var require_coerce = __commonJS({
7156
7314
  const patch = match2[4] || "0";
7157
7315
  const prerelease = options.includePrerelease && match2[5] ? `-${match2[5]}` : "";
7158
7316
  const build = options.includePrerelease && match2[6] ? `+${match2[6]}` : "";
7159
- return parse6(`${major}.${minor}.${patch}${prerelease}${build}`, options);
7317
+ return parse7(`${major}.${minor}.${patch}${prerelease}${build}`, options);
7160
7318
  };
7161
7319
  module2.exports = coerce3;
7162
7320
  }
@@ -8137,7 +8295,7 @@ var require_semver2 = __commonJS({
8137
8295
  var constants = require_constants();
8138
8296
  var SemVer = require_semver();
8139
8297
  var identifiers = require_identifiers();
8140
- var parse6 = require_parse();
8298
+ var parse7 = require_parse();
8141
8299
  var valid = require_valid();
8142
8300
  var clean = require_clean();
8143
8301
  var inc = require_inc();
@@ -8175,7 +8333,7 @@ var require_semver2 = __commonJS({
8175
8333
  var simplifyRange = require_simplify();
8176
8334
  var subset = require_subset();
8177
8335
  module2.exports = {
8178
- parse: parse6,
8336
+ parse: parse7,
8179
8337
  valid,
8180
8338
  clean,
8181
8339
  inc,
@@ -8265,7 +8423,7 @@ var init_utils2 = __esm({
8265
8423
  process.exit(1);
8266
8424
  }
8267
8425
  };
8268
- requiredApiVersion = 6;
8426
+ requiredApiVersion = 7;
8269
8427
  assertOrmCoreVersion = async () => {
8270
8428
  try {
8271
8429
  const { compatibilityVersion } = await import("drizzle-orm/version");
@@ -8427,7 +8585,7 @@ var init_outputs = __esm({
8427
8585
  error: (str) => `${source_default.red(`${source_default.white.bgRed(" Invalid input ")} ${str}`)}`,
8428
8586
  warning: (str) => `${source_default.white.bgGray(" Warning ")} ${str}`,
8429
8587
  errorWarning: (str) => `${source_default.red(`${source_default.white.bgRed(" Warning ")} ${str}`)}`,
8430
- fullWarning: (str) => `${source_default.black.bgYellow("[Warning]")} ${source_default.bold(str)}`,
8588
+ fullWarning: (str) => `${source_default.black.bgYellow(" Warning ")} ${source_default.bold(str)}`,
8431
8589
  suggestion: (str) => `${source_default.white.bgGray(" Suggestion ")} ${str}`,
8432
8590
  info: (str) => `${source_default.grey(str)}`
8433
8591
  };
@@ -8547,7 +8705,14 @@ var init_pg = __esm({
8547
8705
  user: stringType().default("postgres"),
8548
8706
  password: stringType().optional(),
8549
8707
  database: stringType(),
8550
- ssl: coerce.boolean().optional()
8708
+ ssl: unionType([
8709
+ literalType("require"),
8710
+ literalType("allow"),
8711
+ literalType("prefer"),
8712
+ literalType("verify-full"),
8713
+ booleanType(),
8714
+ objectType({}).passthrough()
8715
+ ])
8551
8716
  }),
8552
8717
  objectType({
8553
8718
  url: stringType()
@@ -8750,6 +8915,7 @@ var init_cli = __esm({
8750
8915
  schema: unionType([stringType(), stringType().array()]).optional(),
8751
8916
  tablesFilter: unionType([stringType(), stringType().array()]).optional(),
8752
8917
  schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
8918
+ extensionsFilters: literalType("postgis").array().optional(),
8753
8919
  verbose: booleanType().optional(),
8754
8920
  strict: booleanType().optional()
8755
8921
  }).passthrough();
@@ -8759,6 +8925,7 @@ var init_cli = __esm({
8759
8925
  out: stringType().optional().default("drizzle"),
8760
8926
  tablesFilter: unionType([stringType(), stringType().array()]).optional(),
8761
8927
  schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
8928
+ extensionsFilters: literalType("postgis").array().optional(),
8762
8929
  introspectCasing: casing,
8763
8930
  breakpoints: booleanType().optional().default(true)
8764
8931
  }).passthrough();
@@ -8829,7 +8996,7 @@ var require_ms = __commonJS({
8829
8996
  options = options || {};
8830
8997
  var type = typeof val2;
8831
8998
  if (type === "string" && val2.length > 0) {
8832
- return parse6(val2);
8999
+ return parse7(val2);
8833
9000
  } else if (type === "number" && isFinite(val2)) {
8834
9001
  return options.long ? fmtLong(val2) : fmtShort(val2);
8835
9002
  }
@@ -8837,7 +9004,7 @@ var require_ms = __commonJS({
8837
9004
  "val is not a non-empty string or a valid number. val=" + JSON.stringify(val2)
8838
9005
  );
8839
9006
  };
8840
- function parse6(str) {
9007
+ function parse7(str) {
8841
9008
  str = String(str);
8842
9009
  if (str.length > 100) {
8843
9010
  return;
@@ -12556,7 +12723,7 @@ var require_node2 = __commonJS({
12556
12723
  var token;
12557
12724
  var key;
12558
12725
  var root;
12559
- module22.exports = function parse6(text, reviver) {
12726
+ module22.exports = function parse7(text, reviver) {
12560
12727
  source = String(text);
12561
12728
  parseState = "start";
12562
12729
  stack = [];
@@ -13604,10 +13771,10 @@ var require_node2 = __commonJS({
13604
13771
  };
13605
13772
  });
13606
13773
  var require_lib32 = __commonJS2((exports3, module22) => {
13607
- var parse6 = require_parse4();
13774
+ var parse7 = require_parse4();
13608
13775
  var stringify4 = require_stringify3();
13609
13776
  var JSON5 = {
13610
- parse: parse6,
13777
+ parse: parse7,
13611
13778
  stringify: stringify4
13612
13779
  };
13613
13780
  module22.exports = JSON5;
@@ -14568,6 +14735,13 @@ var init_utils4 = __esm({
14568
14735
  const tablesFilter = tablesFilterConfig ? typeof tablesFilterConfig === "string" ? [tablesFilterConfig] : tablesFilterConfig : [];
14569
14736
  const schemasFilterConfig = config.schemaFilter;
14570
14737
  const schemasFilter = schemasFilterConfig ? typeof schemasFilterConfig === "string" ? [schemasFilterConfig] : schemasFilterConfig : [];
14738
+ if (config.extensionsFilters) {
14739
+ if (config.extensionsFilters.includes("postgis") && dialect7 === "postgresql") {
14740
+ tablesFilter.push(
14741
+ ...["!geography_columns", "!geometry_columns", "!spatial_ref_sys"]
14742
+ );
14743
+ }
14744
+ }
14571
14745
  if (dialect7 === "postgresql") {
14572
14746
  const parsed = postgresCredentials.safeParse(config);
14573
14747
  if (!parsed.success) {
@@ -14634,6 +14808,13 @@ var init_utils4 = __esm({
14634
14808
  }
14635
14809
  const tablesFilterConfig = config.tablesFilter;
14636
14810
  const tablesFilter = tablesFilterConfig ? typeof tablesFilterConfig === "string" ? [tablesFilterConfig] : tablesFilterConfig : [];
14811
+ if (config.extensionsFilters) {
14812
+ if (config.extensionsFilters.includes("postgis") && dialect7 === "postgresql") {
14813
+ tablesFilter.push(
14814
+ ...["!geography_columns", "!geometry_columns", "!spatial_ref_sys"]
14815
+ );
14816
+ }
14817
+ }
14637
14818
  const schemasFilterConfig = config.schemaFilter;
14638
14819
  const schemasFilter = schemasFilterConfig ? typeof schemasFilterConfig === "string" ? [schemasFilterConfig] : schemasFilterConfig : [];
14639
14820
  if (dialect7 === "postgresql") {
@@ -15135,7 +15316,7 @@ The unique constraint ${source_default.underline.blue(
15135
15316
  const name = value.config.name;
15136
15317
  let indexColumns = columns2.map((it) => {
15137
15318
  if ((0, import_drizzle_orm2.is)(it, import_drizzle_orm3.SQL)) {
15138
- return dialect4.sqlToQuery(it).sql;
15319
+ return dialect4.sqlToQuery(it, "indexes").sql;
15139
15320
  } else {
15140
15321
  return it.name;
15141
15322
  }
@@ -15525,6 +15706,24 @@ var init_pgImports = __esm({
15525
15706
  }
15526
15707
  });
15527
15708
 
15709
+ // src/extensions/vector.ts
15710
+ var vectorOps;
15711
+ var init_vector = __esm({
15712
+ "src/extensions/vector.ts"() {
15713
+ "use strict";
15714
+ vectorOps = [
15715
+ "vector_l2_ops",
15716
+ "vector_ip_ops",
15717
+ "vector_cosine_ops",
15718
+ "vector_l1_ops",
15719
+ "bit_hamming_ops",
15720
+ "bit_jaccard_ops",
15721
+ "halfvec_l2_ops",
15722
+ "sparsevec_l2_ops"
15723
+ ];
15724
+ }
15725
+ });
15726
+
15528
15727
  // src/serializer/pgSerializer.ts
15529
15728
  var pgSerializer_exports = {};
15530
15729
  __export(pgSerializer_exports, {
@@ -15542,6 +15741,7 @@ var init_pgSerializer = __esm({
15542
15741
  init_serializer();
15543
15742
  init_source();
15544
15743
  init_outputs();
15744
+ init_vector();
15545
15745
  dialect5 = new import_pg_core2.PgDialect();
15546
15746
  indexName2 = (tableName, columns) => {
15547
15747
  return `${tableName}_${columns.join("_")}_index`;
@@ -15549,6 +15749,16 @@ var init_pgSerializer = __esm({
15549
15749
  generatePgSnapshot = (tables, enums, schemas, schemaFilter) => {
15550
15750
  const result = {};
15551
15751
  const indexesInSchema = {};
15752
+ const enumsToReturn = enums.reduce((map, obj) => {
15753
+ const enumSchema3 = obj.schema || "public";
15754
+ const key = `${enumSchema3}.${obj.enumName}`;
15755
+ map[key] = {
15756
+ name: obj.enumName,
15757
+ schema: enumSchema3,
15758
+ values: obj.enumValues
15759
+ };
15760
+ return map;
15761
+ }, {});
15552
15762
  for (const table4 of tables) {
15553
15763
  const {
15554
15764
  name: tableName,
@@ -15579,6 +15789,7 @@ var init_pgSerializer = __esm({
15579
15789
  typeSchema,
15580
15790
  primaryKey,
15581
15791
  notNull
15792
+ // isenum: typeof enumsToReturn[column.getSQLType()] !== "undefined",
15582
15793
  };
15583
15794
  if (column7.isUnique) {
15584
15795
  const existingUnique = uniqueConstraintObject[column7.uniqueName];
@@ -15692,18 +15903,71 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
15692
15903
  });
15693
15904
  indexes.forEach((value) => {
15694
15905
  const columns2 = value.config.columns;
15695
- let name = value.config.name;
15696
- name = name ? name : indexName2(
15697
- tableName,
15698
- columns2.map((it) => it.name)
15699
- );
15700
- let indexColumns = columns2.map((it) => {
15906
+ let indexColumnNames = [];
15907
+ columns2.forEach((it) => {
15701
15908
  if ((0, import_drizzle_orm5.is)(it, import_drizzle_orm5.SQL)) {
15702
- return dialect5.sqlToQuery(it).sql;
15703
- } else {
15704
- return it.name;
15909
+ if (typeof value.config.name === "undefined") {
15910
+ console.log(
15911
+ `
15912
+ ${withStyle.errorWarning(
15913
+ `Please specify an index name in ${(0, import_drizzle_orm5.getTableName)(
15914
+ value.config.table
15915
+ )} table that has "${dialect5.sqlToQuery(it).sql}" expression. We can generate index names for indexes on columns only; for expressions in indexes, you need to specify the name yourself.`
15916
+ )}`
15917
+ );
15918
+ process.exit(1);
15919
+ }
15705
15920
  }
15921
+ it = it;
15922
+ if (!(0, import_drizzle_orm5.is)(it, import_drizzle_orm5.SQL) && it.type === "PgVector" && typeof it.indexConfig.opClass === "undefined") {
15923
+ console.log(
15924
+ `
15925
+ ${withStyle.errorWarning(
15926
+ `You are specifying an index on the ${source_default.blueBright(
15927
+ it.name
15928
+ )} column inside the ${source_default.blueBright(
15929
+ tableName
15930
+ )} table with the ${source_default.blueBright(
15931
+ "vector"
15932
+ )} type without specifying an operator class. Vector extension doesn't have a default operator class, so you need to specify one of the available options. Here is a list of available op classes for the vector extension: [${vectorOps.map((it2) => `${source_default.underline(`${it2}`)}`).join(
15933
+ ", "
15934
+ )}].
15935
+
15936
+ You can specify it using current syntax: ${source_default.underline(
15937
+ `index("${value.config.name}").using("${value.config.method}", table.${it.name}.op("${vectorOps[0]}"))`
15938
+ )}
15939
+
15940
+ You can check the "pg_vector" docs for more info: https://github.com/pgvector/pgvector?tab=readme-ov-file#indexing
15941
+ `
15942
+ )}`
15943
+ );
15944
+ process.exit(1);
15945
+ }
15946
+ indexColumnNames.push(it.name);
15706
15947
  });
15948
+ const name = value.config.name ? value.config.name : indexName2(tableName, indexColumnNames);
15949
+ let indexColumns = columns2.map(
15950
+ (it) => {
15951
+ var _a, _b, _c, _d, _e2;
15952
+ if ((0, import_drizzle_orm5.is)(it, import_drizzle_orm5.SQL)) {
15953
+ return {
15954
+ expression: dialect5.sqlToQuery(it, "indexes").sql,
15955
+ asc: true,
15956
+ isExpression: true,
15957
+ nulls: "last"
15958
+ };
15959
+ } else {
15960
+ it = it;
15961
+ return {
15962
+ expression: it.name,
15963
+ isExpression: false,
15964
+ asc: ((_a = it.indexConfig) == null ? void 0 : _a.order) === "asc",
15965
+ nulls: ((_b = it.indexConfig) == null ? void 0 : _b.nulls) ? (_c = it.indexConfig) == null ? void 0 : _c.nulls : ((_d = it.indexConfig) == null ? void 0 : _d.order) === "desc" ? "first" : "last",
15966
+ opclass: (_e2 = it.indexConfig) == null ? void 0 : _e2.opClass
15967
+ };
15968
+ }
15969
+ }
15970
+ );
15707
15971
  if (typeof indexesInSchema[schema5 ?? "public"] !== "undefined") {
15708
15972
  if (indexesInSchema[schema5 ?? "public"].includes(name)) {
15709
15973
  console.log(
@@ -15725,7 +15989,11 @@ ${withStyle.errorWarning(
15725
15989
  indexesObject[name] = {
15726
15990
  name,
15727
15991
  columns: indexColumns,
15728
- isUnique: value.config.unique ?? false
15992
+ isUnique: value.config.unique ?? false,
15993
+ where: value.config.where ? dialect5.sqlToQuery(value.config.where).sql : void 0,
15994
+ concurrently: value.config.concurrently ?? false,
15995
+ method: value.config.method ?? "btree",
15996
+ with: value.config.with ?? {}
15729
15997
  };
15730
15998
  });
15731
15999
  const tableKey2 = `${schema5 ?? "public"}.${tableName}`;
@@ -15739,16 +16007,6 @@ ${withStyle.errorWarning(
15739
16007
  uniqueConstraints: uniqueConstraintObject
15740
16008
  };
15741
16009
  }
15742
- const enumsToReturn = enums.reduce((map, obj) => {
15743
- const enumSchema3 = obj.schema || "public";
15744
- const key = `${enumSchema3}.${obj.enumName}`;
15745
- map[key] = {
15746
- name: obj.enumName,
15747
- schema: enumSchema3,
15748
- values: obj.enumValues
15749
- };
15750
- return map;
15751
- }, {});
15752
16010
  const schemasObject = Object.fromEntries(
15753
16011
  schemas.filter((it) => {
15754
16012
  if (schemaFilter) {
@@ -15759,7 +16017,7 @@ ${withStyle.errorWarning(
15759
16017
  }).map((it) => [it.schemaName, it.schemaName])
15760
16018
  );
15761
16019
  return {
15762
- version: "6",
16020
+ version: "7",
15763
16021
  dialect: "postgresql",
15764
16022
  tables: result,
15765
16023
  enums: enumsToReturn,
@@ -16031,7 +16289,10 @@ ${withStyle.errorWarning(
16031
16289
  columnTypeMapped = trimChar(columnTypeMapped, '"');
16032
16290
  columnToReturn[columnName] = {
16033
16291
  name: columnName,
16034
- type: columnAdditionalDT === "USER-DEFINED" ? enumType3 : columnTypeMapped,
16292
+ type: (
16293
+ // filter vectors, but in future we should filter any extension that was installed by user
16294
+ columnAdditionalDT === "USER-DEFINED" && !["vector", "geometry"].includes(enumType3) ? enumType3 : columnTypeMapped
16295
+ ),
16035
16296
  typeSchema: enumsToReturn[`${tableSchema}.${enumType3}`] !== void 0 ? enumsToReturn[`${tableSchema}.${enumType3}`].schema : void 0,
16036
16297
  primaryKey: primaryKey.length === 1 && cprimaryKey.length < 2,
16037
16298
  // default: isSerial ? undefined : defaultValue,
@@ -16042,15 +16303,42 @@ ${withStyle.errorWarning(
16042
16303
  }
16043
16304
  }
16044
16305
  const dbIndexes = await db2.query(
16045
- `SELECT t.relname as table_name, i.relname AS index_name, ix.indisunique AS is_unique, a.attname AS column_name
16046
- FROM pg_class t
16047
- JOIN pg_index ix ON t.oid = ix.indrelid
16048
- JOIN pg_class i ON i.oid = ix.indexrelid
16049
- JOIN pg_attribute a ON a.attrelid = t.oid AND a.attnum = ANY(ix.indkey)
16050
- JOIN pg_namespace ns ON ns.oid = t.relnamespace
16051
- WHERE ns.nspname = '${tableSchema}'
16052
- AND t.relname = '${tableName}'
16053
- and ix.indisprimary = false;`
16306
+ `SELECT DISTINCT ON (t.relname, ic.relname, k.i) t.relname as table_name, ic.relname AS indexname,
16307
+ k.i AS index_order,
16308
+ i.indisunique as is_unique,
16309
+ am.amname as method,
16310
+ ic.reloptions as with,
16311
+ coalesce(a.attname,
16312
+ (('{' || pg_get_expr(
16313
+ i.indexprs,
16314
+ i.indrelid
16315
+ )
16316
+ || '}')::text[]
16317
+ )[k.i]
16318
+ ) AS column_name,
16319
+ CASE
16320
+ WHEN pg_get_expr(i.indexprs, i.indrelid) IS NOT NULL THEN 1
16321
+ ELSE 0
16322
+ END AS is_expression,
16323
+ i.indoption[k.i-1] & 1 = 1 AS descending,
16324
+ i.indoption[k.i-1] & 2 = 2 AS nulls_first,
16325
+ pg_get_expr(
16326
+ i.indpred,
16327
+ i.indrelid
16328
+ ) as where,
16329
+ opc.opcname
16330
+ FROM pg_class t
16331
+ LEFT JOIN pg_index i ON t.oid = i.indrelid
16332
+ LEFT JOIN pg_class ic ON ic.oid = i.indexrelid
16333
+ CROSS JOIN LATERAL (SELECT unnest(i.indkey), generate_subscripts(i.indkey, 1) + 1) AS k(attnum, i)
16334
+ LEFT JOIN pg_attribute AS a
16335
+ ON i.indrelid = a.attrelid AND k.attnum = a.attnum
16336
+ JOIN pg_namespace c on c.oid = t.relnamespace
16337
+ LEFT JOIN pg_am AS am ON ic.relam = am.oid
16338
+ JOIN pg_opclass opc ON opc.oid = ANY(i.indclass)
16339
+ WHERE
16340
+ c.nspname = '${tableSchema}' AND
16341
+ t.relname = '${tableName}';`
16054
16342
  );
16055
16343
  const dbIndexFromConstraint = await db2.query(
16056
16344
  `SELECT
@@ -16067,18 +16355,51 @@ ${withStyle.errorWarning(
16067
16355
  );
16068
16356
  const idxsInConsteraint = dbIndexFromConstraint.filter((it) => it.generated_by_constraint === 1).map((it) => it.index_name);
16069
16357
  for (const dbIndex of dbIndexes) {
16070
- const indexName4 = dbIndex.index_name;
16358
+ const indexName4 = dbIndex.indexname;
16071
16359
  const indexColumnName = dbIndex.column_name;
16072
16360
  const indexIsUnique = dbIndex.is_unique;
16361
+ const indexMethod = dbIndex.method;
16362
+ const indexWith = dbIndex.with;
16363
+ const indexWhere = dbIndex.where;
16364
+ const opclass = dbIndex.opcname;
16365
+ const isExpression = dbIndex.is_expression === 1;
16366
+ const desc = dbIndex.descending;
16367
+ const nullsFirst = dbIndex.nulls_first;
16368
+ const mappedWith = {};
16369
+ if (indexWith !== null) {
16370
+ indexWith.forEach((it) => {
16371
+ const splitted = it.split("=");
16372
+ mappedWith[splitted[0]] = splitted[1];
16373
+ });
16374
+ }
16073
16375
  if (idxsInConsteraint.includes(indexName4))
16074
16376
  continue;
16075
16377
  if (typeof indexToReturn[indexName4] !== "undefined") {
16076
- indexToReturn[indexName4].columns.push(indexColumnName);
16378
+ indexToReturn[indexName4].columns.push({
16379
+ expression: indexColumnName,
16380
+ asc: !desc,
16381
+ nulls: nullsFirst ? "first" : "last",
16382
+ opclass,
16383
+ isExpression
16384
+ });
16077
16385
  } else {
16078
16386
  indexToReturn[indexName4] = {
16079
16387
  name: indexName4,
16080
- columns: [indexColumnName],
16081
- isUnique: indexIsUnique
16388
+ columns: [
16389
+ {
16390
+ expression: indexColumnName,
16391
+ asc: !desc,
16392
+ nulls: nullsFirst ? "first" : "last",
16393
+ opclass,
16394
+ isExpression
16395
+ }
16396
+ ],
16397
+ isUnique: indexIsUnique,
16398
+ // should not be a part of diff detecs
16399
+ concurrently: false,
16400
+ method: indexMethod,
16401
+ where: indexWhere === null ? void 0 : indexWhere,
16402
+ with: mappedWith
16082
16403
  };
16083
16404
  }
16084
16405
  }
@@ -16114,7 +16435,7 @@ ${withStyle.errorWarning(
16114
16435
  }
16115
16436
  const schemasObject = Object.fromEntries([...schemas].map((it) => [it, it]));
16116
16437
  return {
16117
- version: "6",
16438
+ version: "7",
16118
16439
  dialect: "postgresql",
16119
16440
  tables: result,
16120
16441
  enums: enumsToReturn,
@@ -16370,7 +16691,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
16370
16691
  const name = value.config.name;
16371
16692
  let indexColumns = columns2.map((it) => {
16372
16693
  if ((0, import_drizzle_orm7.is)(it, import_drizzle_orm7.SQL)) {
16373
- return dialect6.sqlToQuery(it).sql;
16694
+ return dialect6.sqlToQuery(it, "indexes").sql;
16374
16695
  } else {
16375
16696
  return it.name;
16376
16697
  }
@@ -16898,7 +17219,7 @@ var init_sqlgenerator = __esm({
16898
17219
  if (pgNativeTypes.has(it))
16899
17220
  return true;
16900
17221
  const toCheck = it.replace(/ /g, "");
16901
- return toCheck.startsWith("varchar(") || toCheck.startsWith("char(") || toCheck.startsWith("numeric(") || toCheck.startsWith("timestamp(") || toCheck.startsWith("intervalyear(") || toCheck.startsWith("intervalmonth(") || toCheck.startsWith("intervalday(") || toCheck.startsWith("intervalhour(") || toCheck.startsWith("intervalminute(") || toCheck.startsWith("intervalsecond(") || toCheck.startsWith("intervalyeartomonth(") || toCheck.startsWith("intervaldaytohour(") || toCheck.startsWith("intervaldaytominute(") || toCheck.startsWith("intervaldaytosecond(") || toCheck.startsWith("intervalhourtominute(") || toCheck.startsWith("intervalhourtosecond(") || toCheck.startsWith("intervalminutetosecond(") || /^(\w+)(\[\d*])+$/.test(it);
17222
+ return toCheck.startsWith("varchar(") || toCheck.startsWith("char(") || toCheck.startsWith("numeric(") || toCheck.startsWith("timestamp(") || toCheck.startsWith("intervalyear(") || toCheck.startsWith("intervalmonth(") || toCheck.startsWith("intervalday(") || toCheck.startsWith("intervalhour(") || toCheck.startsWith("intervalminute(") || toCheck.startsWith("intervalsecond(") || toCheck.startsWith("intervalyeartomonth(") || toCheck.startsWith("intervaldaytohour(") || toCheck.startsWith("intervaldaytominute(") || toCheck.startsWith("intervaldaytosecond(") || toCheck.startsWith("intervalhourtominute(") || toCheck.startsWith("intervalhourtosecond(") || toCheck.startsWith("intervalminutetosecond(") || toCheck.startsWith("vector(") || /^(\w+)(\[\d*])+$/.test(it);
16902
17223
  };
16903
17224
  Convertor = class {
16904
17225
  };
@@ -17860,14 +18181,34 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
17860
18181
  };
17861
18182
  CreatePgIndexConvertor = class extends Convertor {
17862
18183
  can(statement, dialect7) {
17863
- return statement.type === "create_index" && dialect7 === "postgresql";
18184
+ return statement.type === "create_index_pg" && dialect7 === "postgresql";
17864
18185
  }
17865
18186
  convert(statement) {
17866
- const { name, columns, isUnique } = PgSquasher.unsquashIdx(statement.data);
18187
+ const {
18188
+ name,
18189
+ columns,
18190
+ isUnique,
18191
+ concurrently,
18192
+ with: withMap,
18193
+ method,
18194
+ where
18195
+ } = statement.data;
17867
18196
  const indexPart = isUnique ? "UNIQUE INDEX" : "INDEX";
17868
- const value = columns.map((it) => `"${it}"`).join(",");
18197
+ const value = columns.map(
18198
+ (it) => `${it.expression}${it.opclass ? ` ${it.opclass}` : it.asc ? "" : " DESC"}${it.asc && it.nulls && it.nulls === "last" || it.opclass ? "" : ` NULLS ${it.nulls.toUpperCase()}`}`
18199
+ ).join(",");
17869
18200
  const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
17870
- return `CREATE ${indexPart} IF NOT EXISTS "${name}" ON ${tableNameWithSchema} (${value});`;
18201
+ function reverseLogic(mappedWith) {
18202
+ let reversedString = "";
18203
+ for (const key in mappedWith) {
18204
+ if (mappedWith.hasOwnProperty(key)) {
18205
+ reversedString += `${key}=${mappedWith[key]},`;
18206
+ }
18207
+ }
18208
+ reversedString = reversedString.slice(0, -1);
18209
+ return reversedString;
18210
+ }
18211
+ return `CREATE ${indexPart}${concurrently ? " CONCURRENTLY" : ""} IF NOT EXISTS "${name}" ON ${tableNameWithSchema} USING ${method} (${value})${Object.keys(withMap).length !== 0 ? ` WITH (${reverseLogic(withMap)})` : ""}${where ? ` WHERE ${where}` : ""};`;
17871
18212
  }
17872
18213
  };
17873
18214
  CreateMySqlIndexConvertor = class extends Convertor {
@@ -18521,7 +18862,7 @@ var init_jsonDiffer = __esm({
18521
18862
  });
18522
18863
 
18523
18864
  // src/jsonStatements.ts
18524
- var preparePgCreateTableJson, prepareMySqlCreateTableJson, prepareSQLiteCreateTable, prepareDropTableJson, prepareRenameTableJson, prepareCreateEnumJson, prepareAddValuesToEnumJson, prepareDropEnumJson, prepareMoveEnumJson, prepareRenameEnumJson, prepareCreateSchemasJson, prepareRenameSchemasJson, prepareDeleteSchemasJson, prepareRenameColumns, _prepareDropColumns, _prepareAddColumns, _prepareSqliteAddColumns, prepareAlterColumnsMysql, preparePgAlterColumns, prepareSqliteAlterColumns, prepareCreateIndexesJson, prepareCreateReferencesJson, prepareDropReferencesJson, prepareAlterReferencesJson, prepareDropIndexesJson, prepareAddCompositePrimaryKeySqlite, prepareDeleteCompositePrimaryKeySqlite, prepareAlterCompositePrimaryKeySqlite, prepareAddCompositePrimaryKeyPg, prepareDeleteCompositePrimaryKeyPg, prepareAlterCompositePrimaryKeyPg, prepareAddUniqueConstraintPg, prepareDeleteUniqueConstraintPg, prepareAddCompositePrimaryKeyMySql, prepareDeleteCompositePrimaryKeyMySql, prepareAlterCompositePrimaryKeyMySql;
18865
+ var preparePgCreateTableJson, prepareMySqlCreateTableJson, prepareSQLiteCreateTable, prepareDropTableJson, prepareRenameTableJson, prepareCreateEnumJson, prepareAddValuesToEnumJson, prepareDropEnumJson, prepareMoveEnumJson, prepareRenameEnumJson, prepareCreateSchemasJson, prepareRenameSchemasJson, prepareDeleteSchemasJson, prepareRenameColumns, _prepareDropColumns, _prepareAddColumns, _prepareSqliteAddColumns, prepareAlterColumnsMysql, preparePgAlterColumns, prepareSqliteAlterColumns, preparePgCreateIndexesJson, prepareCreateIndexesJson, prepareCreateReferencesJson, prepareDropReferencesJson, prepareAlterReferencesJson, prepareDropIndexesJson, prepareAddCompositePrimaryKeySqlite, prepareDeleteCompositePrimaryKeySqlite, prepareAlterCompositePrimaryKeySqlite, prepareAddCompositePrimaryKeyPg, prepareDeleteCompositePrimaryKeyPg, prepareAlterCompositePrimaryKeyPg, prepareAddUniqueConstraintPg, prepareDeleteUniqueConstraintPg, prepareAddCompositePrimaryKeyMySql, prepareDeleteCompositePrimaryKeyMySql, prepareAlterCompositePrimaryKeyMySql;
18525
18866
  var init_jsonStatements = __esm({
18526
18867
  "src/jsonStatements.ts"() {
18527
18868
  "use strict";
@@ -19286,6 +19627,28 @@ var init_jsonStatements = __esm({
19286
19627
  }
19287
19628
  return [...dropPkStatements, ...setPkStatements, ...statements];
19288
19629
  };
19630
+ preparePgCreateIndexesJson = (tableName, schema5, indexes, fullSchema, action) => {
19631
+ if (action === "push") {
19632
+ return Object.values(indexes).map((indexData) => {
19633
+ const unsquashedIndex = PgSquasher.unsquashIdxPush(indexData);
19634
+ const data = fullSchema.tables[`${schema5 === "" ? "public" : schema5}.${tableName}`].indexes[unsquashedIndex.name];
19635
+ return {
19636
+ type: "create_index_pg",
19637
+ tableName,
19638
+ data,
19639
+ schema: schema5
19640
+ };
19641
+ });
19642
+ }
19643
+ return Object.values(indexes).map((indexData) => {
19644
+ return {
19645
+ type: "create_index_pg",
19646
+ tableName,
19647
+ data: PgSquasher.unsquashIdx(indexData),
19648
+ schema: schema5
19649
+ };
19650
+ });
19651
+ };
19289
19652
  prepareCreateIndexesJson = (tableName, schema5, indexes) => {
19290
19653
  return Object.values(indexes).map((indexData) => {
19291
19654
  return {
@@ -19317,20 +19680,21 @@ var init_jsonStatements = __esm({
19317
19680
  });
19318
19681
  };
19319
19682
  prepareAlterReferencesJson = (tableName, schema5, foreignKeys) => {
19320
- const keys = Object.keys(foreignKeys);
19321
19683
  const stmts = [];
19322
- if (keys.length > 0) {
19323
- stmts.push(
19324
- ...prepareDropReferencesJson(tableName, schema5, {
19325
- [keys[0]]: foreignKeys[keys[0]].__old
19326
- })
19327
- );
19328
- stmts.push(
19329
- ...prepareCreateReferencesJson(tableName, schema5, {
19330
- [keys[0]]: foreignKeys[keys[0]].__new
19331
- })
19332
- );
19333
- }
19684
+ Object.values(foreignKeys).map((val2) => {
19685
+ stmts.push({
19686
+ type: "delete_reference",
19687
+ tableName,
19688
+ schema: schema5,
19689
+ data: val2.__old
19690
+ });
19691
+ stmts.push({
19692
+ type: "create_reference",
19693
+ tableName,
19694
+ schema: schema5,
19695
+ data: val2.__new
19696
+ });
19697
+ });
19334
19698
  return stmts;
19335
19699
  };
19336
19700
  prepareDropIndexesJson = (tableName, schema5, indexes) => {
@@ -19661,7 +20025,7 @@ var init_snapshotsDiffer = __esm({
19661
20025
  }
19662
20026
  return column7;
19663
20027
  };
19664
- applyPgSnapshotsDiff = async (json1, json2, schemasResolver2, enumsResolver2, tablesResolver2, columnsResolver2, prevFull, curFull) => {
20028
+ applyPgSnapshotsDiff = async (json1, json2, schemasResolver2, enumsResolver2, tablesResolver2, columnsResolver2, prevFull, curFull, action) => {
19665
20029
  const schemasDiff = diffSchemasOrTables(json1.schemas, json2.schemas);
19666
20030
  const {
19667
20031
  created: createdSchemas,
@@ -19823,7 +20187,13 @@ var init_snapshotsDiffer = __esm({
19823
20187
  const typedResult = diffResultScheme.parse(diffResult);
19824
20188
  const jsonStatements = [];
19825
20189
  const jsonCreateIndexesForCreatedTables = createdTables.map((it) => {
19826
- return prepareCreateIndexesJson(it.name, it.schema, it.indexes);
20190
+ return preparePgCreateIndexesJson(
20191
+ it.name,
20192
+ it.schema,
20193
+ it.indexes,
20194
+ curFull,
20195
+ action
20196
+ );
19827
20197
  }).flat();
19828
20198
  const jsonDropTables = deletedTables.map((it) => {
19829
20199
  return prepareDropTableJson(it);
@@ -19947,10 +20317,12 @@ var init_snapshotsDiffer = __esm({
19947
20317
  return preparePgAlterColumns(it.name, it.schema, it.altered, json2);
19948
20318
  }).flat();
19949
20319
  const jsonCreateIndexesFoAlteredTables = alteredTables.map((it) => {
19950
- return prepareCreateIndexesJson(
20320
+ return preparePgCreateIndexesJson(
19951
20321
  it.name,
19952
20322
  it.schema,
19953
- it.addedIndexes || {}
20323
+ it.addedIndexes || {},
20324
+ curFull,
20325
+ action
19954
20326
  );
19955
20327
  }).flat();
19956
20328
  const jsonDropIndexesForAllAlteredTables = alteredTables.map((it) => {
@@ -19976,7 +20348,13 @@ var init_snapshotsDiffer = __esm({
19976
20348
  {}
19977
20349
  );
19978
20350
  jsonCreateIndexesFoAlteredTables.push(
19979
- ...prepareCreateIndexesJson(it.name, it.schema, createdIndexes || {})
20351
+ ...preparePgCreateIndexesJson(
20352
+ it.name,
20353
+ it.schema,
20354
+ createdIndexes || {},
20355
+ curFull,
20356
+ action
20357
+ )
19980
20358
  );
19981
20359
  jsonDropIndexesForAllAlteredTables.push(
19982
20360
  ...prepareDropIndexesJson(it.name, it.schema, droppedIndexes || {})
@@ -22083,7 +22461,10 @@ var init_migrate = __esm({
22083
22461
  const schemaPath = config.schema;
22084
22462
  try {
22085
22463
  assertV1OutFolder(outFolder);
22086
- const { snapshots, journal } = prepareMigrationFolder(outFolder, "postgresql");
22464
+ const { snapshots, journal } = prepareMigrationFolder(
22465
+ outFolder,
22466
+ "postgresql"
22467
+ );
22087
22468
  const { prev, cur, custom: custom2 } = await preparePgMigrationSnapshot(
22088
22469
  snapshots,
22089
22470
  schemaPath
@@ -22134,8 +22515,8 @@ var init_migrate = __esm({
22134
22515
  );
22135
22516
  const validatedPrev = pgSchema.parse(prev);
22136
22517
  const validatedCur = pgSchema.parse(cur);
22137
- const squashedPrev = squashPgScheme(validatedPrev);
22138
- const squashedCur = squashPgScheme(validatedCur);
22518
+ const squashedPrev = squashPgScheme(validatedPrev, "push");
22519
+ const squashedCur = squashPgScheme(validatedCur, "push");
22139
22520
  const { sqlStatements, statements, _meta } = await applyPgSnapshotsDiff(
22140
22521
  squashedPrev,
22141
22522
  squashedCur,
@@ -22144,7 +22525,8 @@ var init_migrate = __esm({
22144
22525
  tablesResolver,
22145
22526
  columnsResolver,
22146
22527
  validatedPrev,
22147
- validatedCur
22528
+ validatedCur,
22529
+ "push"
22148
22530
  );
22149
22531
  return { sqlStatements, statements, squashedPrev, squashedCur };
22150
22532
  };
@@ -22615,7 +22997,7 @@ var require_main = __commonJS({
22615
22997
  var packageJson = require_package();
22616
22998
  var version2 = packageJson.version;
22617
22999
  var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
22618
- function parse6(src) {
23000
+ function parse7(src) {
22619
23001
  const obj = {};
22620
23002
  let lines = src.toString();
22621
23003
  lines = lines.replace(/\r\n?/mg, "\n");
@@ -22858,7 +23240,7 @@ var require_main = __commonJS({
22858
23240
  _parseVault,
22859
23241
  config,
22860
23242
  decrypt,
22861
- parse: parse6,
23243
+ parse: parse7,
22862
23244
  populate
22863
23245
  };
22864
23246
  module2.exports.configDotenv = DotenvModule.configDotenv;
@@ -24271,9 +24653,9 @@ var require_glob_parent = __commonJS({
24271
24653
  }
24272
24654
  });
24273
24655
 
24274
- // node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js
24656
+ // node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/utils.js
24275
24657
  var require_utils2 = __commonJS({
24276
- "node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/utils.js"(exports2) {
24658
+ "node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/utils.js"(exports2) {
24277
24659
  "use strict";
24278
24660
  exports2.isInteger = (num) => {
24279
24661
  if (typeof num === "number") {
@@ -24293,7 +24675,7 @@ var require_utils2 = __commonJS({
24293
24675
  return (Number(max) - Number(min)) / Number(step) >= limit;
24294
24676
  };
24295
24677
  exports2.escapeNode = (block, n = 0, type) => {
24296
- const node = block.nodes[n];
24678
+ let node = block.nodes[n];
24297
24679
  if (!node)
24298
24680
  return;
24299
24681
  if (type && node.type === type || node.type === "open" || node.type === "close") {
@@ -24344,14 +24726,8 @@ var require_utils2 = __commonJS({
24344
24726
  const result = [];
24345
24727
  const flat = (arr) => {
24346
24728
  for (let i2 = 0; i2 < arr.length; i2++) {
24347
- const ele = arr[i2];
24348
- if (Array.isArray(ele)) {
24349
- flat(ele);
24350
- continue;
24351
- }
24352
- if (ele !== void 0) {
24353
- result.push(ele);
24354
- }
24729
+ let ele = arr[i2];
24730
+ Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
24355
24731
  }
24356
24732
  return result;
24357
24733
  };
@@ -24361,15 +24737,15 @@ var require_utils2 = __commonJS({
24361
24737
  }
24362
24738
  });
24363
24739
 
24364
- // node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js
24740
+ // node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/stringify.js
24365
24741
  var require_stringify = __commonJS({
24366
- "node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/stringify.js"(exports2, module2) {
24742
+ "node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/stringify.js"(exports2, module2) {
24367
24743
  "use strict";
24368
24744
  var utils = require_utils2();
24369
24745
  module2.exports = (ast, options = {}) => {
24370
- const stringify4 = (node, parent = {}) => {
24371
- const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
24372
- const invalidNode = node.invalid === true && options.escapeInvalid === true;
24746
+ let stringify4 = (node, parent = {}) => {
24747
+ let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
24748
+ let invalidNode = node.invalid === true && options.escapeInvalid === true;
24373
24749
  let output = "";
24374
24750
  if (node.value) {
24375
24751
  if ((invalidBlock || invalidNode) && utils.isOpenOrClose(node)) {
@@ -24381,7 +24757,7 @@ var require_stringify = __commonJS({
24381
24757
  return node.value;
24382
24758
  }
24383
24759
  if (node.nodes) {
24384
- for (const child of node.nodes) {
24760
+ for (let child of node.nodes) {
24385
24761
  output += stringify4(child);
24386
24762
  }
24387
24763
  }
@@ -24826,24 +25202,23 @@ var require_fill_range = __commonJS({
24826
25202
  }
24827
25203
  });
24828
25204
 
24829
- // node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js
25205
+ // node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/compile.js
24830
25206
  var require_compile = __commonJS({
24831
- "node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/compile.js"(exports2, module2) {
25207
+ "node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/compile.js"(exports2, module2) {
24832
25208
  "use strict";
24833
25209
  var fill = require_fill_range();
24834
25210
  var utils = require_utils2();
24835
25211
  var compile = (ast, options = {}) => {
24836
- const walk = (node, parent = {}) => {
24837
- const invalidBlock = utils.isInvalidBrace(parent);
24838
- const invalidNode = node.invalid === true && options.escapeInvalid === true;
24839
- const invalid = invalidBlock === true || invalidNode === true;
24840
- const prefix = options.escapeInvalid === true ? "\\" : "";
25212
+ let walk = (node, parent = {}) => {
25213
+ let invalidBlock = utils.isInvalidBrace(parent);
25214
+ let invalidNode = node.invalid === true && options.escapeInvalid === true;
25215
+ let invalid = invalidBlock === true || invalidNode === true;
25216
+ let prefix = options.escapeInvalid === true ? "\\" : "";
24841
25217
  let output = "";
24842
25218
  if (node.isOpen === true) {
24843
25219
  return prefix + node.value;
24844
25220
  }
24845
25221
  if (node.isClose === true) {
24846
- console.log("node.isClose", prefix, node.value);
24847
25222
  return prefix + node.value;
24848
25223
  }
24849
25224
  if (node.type === "open") {
@@ -24859,14 +25234,14 @@ var require_compile = __commonJS({
24859
25234
  return node.value;
24860
25235
  }
24861
25236
  if (node.nodes && node.ranges > 0) {
24862
- const args = utils.reduce(node.nodes);
24863
- const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
25237
+ let args = utils.reduce(node.nodes);
25238
+ let range = fill(...args, { ...options, wrap: false, toRegex: true });
24864
25239
  if (range.length !== 0) {
24865
25240
  return args.length > 1 && range.length > 1 ? `(${range})` : range;
24866
25241
  }
24867
25242
  }
24868
25243
  if (node.nodes) {
24869
- for (const child of node.nodes) {
25244
+ for (let child of node.nodes) {
24870
25245
  output += walk(child, node);
24871
25246
  }
24872
25247
  }
@@ -24878,15 +25253,15 @@ var require_compile = __commonJS({
24878
25253
  }
24879
25254
  });
24880
25255
 
24881
- // node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js
25256
+ // node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/expand.js
24882
25257
  var require_expand = __commonJS({
24883
- "node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/expand.js"(exports2, module2) {
25258
+ "node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/expand.js"(exports2, module2) {
24884
25259
  "use strict";
24885
25260
  var fill = require_fill_range();
24886
25261
  var stringify4 = require_stringify();
24887
25262
  var utils = require_utils2();
24888
25263
  var append = (queue = "", stash = "", enclose = false) => {
24889
- const result = [];
25264
+ let result = [];
24890
25265
  queue = [].concat(queue);
24891
25266
  stash = [].concat(stash);
24892
25267
  if (!stash.length)
@@ -24894,9 +25269,9 @@ var require_expand = __commonJS({
24894
25269
  if (!queue.length) {
24895
25270
  return enclose ? utils.flatten(stash).map((ele) => `{${ele}}`) : stash;
24896
25271
  }
24897
- for (const item of queue) {
25272
+ for (let item of queue) {
24898
25273
  if (Array.isArray(item)) {
24899
- for (const value of item) {
25274
+ for (let value of item) {
24900
25275
  result.push(append(value, stash, enclose));
24901
25276
  }
24902
25277
  } else {
@@ -24910,8 +25285,8 @@ var require_expand = __commonJS({
24910
25285
  return utils.flatten(result);
24911
25286
  };
24912
25287
  var expand2 = (ast, options = {}) => {
24913
- const rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
24914
- const walk = (node, parent = {}) => {
25288
+ let rangeLimit = options.rangeLimit === void 0 ? 1e3 : options.rangeLimit;
25289
+ let walk = (node, parent = {}) => {
24915
25290
  node.queue = [];
24916
25291
  let p4 = parent;
24917
25292
  let q = parent.queue;
@@ -24928,7 +25303,7 @@ var require_expand = __commonJS({
24928
25303
  return;
24929
25304
  }
24930
25305
  if (node.nodes && node.ranges > 0) {
24931
- const args = utils.reduce(node.nodes);
25306
+ let args = utils.reduce(node.nodes);
24932
25307
  if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
24933
25308
  throw new RangeError("expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.");
24934
25309
  }
@@ -24940,7 +25315,7 @@ var require_expand = __commonJS({
24940
25315
  node.nodes = [];
24941
25316
  return;
24942
25317
  }
24943
- const enclose = utils.encloseBrace(node);
25318
+ let enclose = utils.encloseBrace(node);
24944
25319
  let queue = node.queue;
24945
25320
  let block = node;
24946
25321
  while (block.type !== "brace" && block.type !== "root" && block.parent) {
@@ -24948,7 +25323,7 @@ var require_expand = __commonJS({
24948
25323
  queue = block.queue;
24949
25324
  }
24950
25325
  for (let i2 = 0; i2 < node.nodes.length; i2++) {
24951
- const child = node.nodes[i2];
25326
+ let child = node.nodes[i2];
24952
25327
  if (child.type === "comma" && node.type === "brace") {
24953
25328
  if (i2 === 1)
24954
25329
  queue.push("");
@@ -24975,12 +25350,12 @@ var require_expand = __commonJS({
24975
25350
  }
24976
25351
  });
24977
25352
 
24978
- // node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js
25353
+ // node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/constants.js
24979
25354
  var require_constants2 = __commonJS({
24980
- "node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/constants.js"(exports2, module2) {
25355
+ "node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/constants.js"(exports2, module2) {
24981
25356
  "use strict";
24982
25357
  module2.exports = {
24983
- MAX_LENGTH: 1e4,
25358
+ MAX_LENGTH: 1024 * 64,
24984
25359
  // Digits
24985
25360
  CHAR_0: "0",
24986
25361
  /* 0 */
@@ -25076,9 +25451,9 @@ var require_constants2 = __commonJS({
25076
25451
  }
25077
25452
  });
25078
25453
 
25079
- // node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js
25454
+ // node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/parse.js
25080
25455
  var require_parse2 = __commonJS({
25081
- "node_modules/.pnpm/braces@3.0.3/node_modules/braces/lib/parse.js"(exports2, module2) {
25456
+ "node_modules/.pnpm/braces@3.0.2/node_modules/braces/lib/parse.js"(exports2, module2) {
25082
25457
  "use strict";
25083
25458
  var stringify4 = require_stringify();
25084
25459
  var {
@@ -25110,24 +25485,25 @@ var require_parse2 = __commonJS({
25110
25485
  CHAR_NO_BREAK_SPACE,
25111
25486
  CHAR_ZERO_WIDTH_NOBREAK_SPACE
25112
25487
  } = require_constants2();
25113
- var parse6 = (input, options = {}) => {
25488
+ var parse7 = (input, options = {}) => {
25114
25489
  if (typeof input !== "string") {
25115
25490
  throw new TypeError("Expected a string");
25116
25491
  }
25117
- const opts = options || {};
25118
- const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
25492
+ let opts = options || {};
25493
+ let max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
25119
25494
  if (input.length > max) {
25120
25495
  throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
25121
25496
  }
25122
- const ast = { type: "root", input, nodes: [] };
25123
- const stack = [ast];
25497
+ let ast = { type: "root", input, nodes: [] };
25498
+ let stack = [ast];
25124
25499
  let block = ast;
25125
25500
  let prev = ast;
25126
25501
  let brackets = 0;
25127
- const length = input.length;
25502
+ let length = input.length;
25128
25503
  let index4 = 0;
25129
25504
  let depth = 0;
25130
25505
  let value;
25506
+ let memo = {};
25131
25507
  const advance = () => input[index4++];
25132
25508
  const push = (node) => {
25133
25509
  if (node.type === "text" && prev.type === "dot") {
@@ -25160,6 +25536,7 @@ var require_parse2 = __commonJS({
25160
25536
  }
25161
25537
  if (value === CHAR_LEFT_SQUARE_BRACKET) {
25162
25538
  brackets++;
25539
+ let closed = true;
25163
25540
  let next;
25164
25541
  while (index4 < length && (next = advance())) {
25165
25542
  value += next;
@@ -25198,7 +25575,7 @@ var require_parse2 = __commonJS({
25198
25575
  continue;
25199
25576
  }
25200
25577
  if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
25201
- const open = value;
25578
+ let open = value;
25202
25579
  let next;
25203
25580
  if (options.keepQuotes !== true) {
25204
25581
  value = "";
@@ -25220,8 +25597,8 @@ var require_parse2 = __commonJS({
25220
25597
  }
25221
25598
  if (value === CHAR_LEFT_CURLY_BRACE) {
25222
25599
  depth++;
25223
- const dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
25224
- const brace = {
25600
+ let dollar = prev.value && prev.value.slice(-1) === "$" || block.dollar === true;
25601
+ let brace = {
25225
25602
  type: "brace",
25226
25603
  open: true,
25227
25604
  close: false,
@@ -25241,7 +25618,7 @@ var require_parse2 = __commonJS({
25241
25618
  push({ type: "text", value });
25242
25619
  continue;
25243
25620
  }
25244
- const type = "close";
25621
+ let type = "close";
25245
25622
  block = stack.pop();
25246
25623
  block.close = true;
25247
25624
  push({ type, value });
@@ -25252,7 +25629,7 @@ var require_parse2 = __commonJS({
25252
25629
  if (value === CHAR_COMMA && depth > 0) {
25253
25630
  if (block.ranges > 0) {
25254
25631
  block.ranges = 0;
25255
- const open = block.nodes.shift();
25632
+ let open = block.nodes.shift();
25256
25633
  block.nodes = [open, { type: "text", value: stringify4(block) }];
25257
25634
  }
25258
25635
  push({ type: "comma", value });
@@ -25260,7 +25637,7 @@ var require_parse2 = __commonJS({
25260
25637
  continue;
25261
25638
  }
25262
25639
  if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
25263
- const siblings = block.nodes;
25640
+ let siblings = block.nodes;
25264
25641
  if (depth === 0 || siblings.length === 0) {
25265
25642
  push({ type: "text", value });
25266
25643
  continue;
@@ -25281,7 +25658,7 @@ var require_parse2 = __commonJS({
25281
25658
  }
25282
25659
  if (prev.type === "range") {
25283
25660
  siblings.pop();
25284
- const before = siblings[siblings.length - 1];
25661
+ let before = siblings[siblings.length - 1];
25285
25662
  before.value += prev.value + value;
25286
25663
  prev = before;
25287
25664
  block.ranges--;
@@ -25306,31 +25683,31 @@ var require_parse2 = __commonJS({
25306
25683
  node.invalid = true;
25307
25684
  }
25308
25685
  });
25309
- const parent = stack[stack.length - 1];
25310
- const index5 = parent.nodes.indexOf(block);
25686
+ let parent = stack[stack.length - 1];
25687
+ let index5 = parent.nodes.indexOf(block);
25311
25688
  parent.nodes.splice(index5, 1, ...block.nodes);
25312
25689
  }
25313
25690
  } while (stack.length > 0);
25314
25691
  push({ type: "eos" });
25315
25692
  return ast;
25316
25693
  };
25317
- module2.exports = parse6;
25694
+ module2.exports = parse7;
25318
25695
  }
25319
25696
  });
25320
25697
 
25321
- // node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js
25698
+ // node_modules/.pnpm/braces@3.0.2/node_modules/braces/index.js
25322
25699
  var require_braces = __commonJS({
25323
- "node_modules/.pnpm/braces@3.0.3/node_modules/braces/index.js"(exports2, module2) {
25700
+ "node_modules/.pnpm/braces@3.0.2/node_modules/braces/index.js"(exports2, module2) {
25324
25701
  "use strict";
25325
25702
  var stringify4 = require_stringify();
25326
25703
  var compile = require_compile();
25327
25704
  var expand2 = require_expand();
25328
- var parse6 = require_parse2();
25705
+ var parse7 = require_parse2();
25329
25706
  var braces = (input, options = {}) => {
25330
25707
  let output = [];
25331
25708
  if (Array.isArray(input)) {
25332
- for (const pattern of input) {
25333
- const result = braces.create(pattern, options);
25709
+ for (let pattern of input) {
25710
+ let result = braces.create(pattern, options);
25334
25711
  if (Array.isArray(result)) {
25335
25712
  output.push(...result);
25336
25713
  } else {
@@ -25345,7 +25722,7 @@ var require_braces = __commonJS({
25345
25722
  }
25346
25723
  return output;
25347
25724
  };
25348
- braces.parse = (input, options = {}) => parse6(input, options);
25725
+ braces.parse = (input, options = {}) => parse7(input, options);
25349
25726
  braces.stringify = (input, options = {}) => {
25350
25727
  if (typeof input === "string") {
25351
25728
  return stringify4(braces.parse(input, options), options);
@@ -26003,7 +26380,7 @@ var require_parse3 = __commonJS({
26003
26380
  var syntaxError = (type, char) => {
26004
26381
  return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
26005
26382
  };
26006
- var parse6 = (input, options) => {
26383
+ var parse7 = (input, options) => {
26007
26384
  if (typeof input !== "string") {
26008
26385
  throw new TypeError("Expected a string");
26009
26386
  }
@@ -26153,7 +26530,7 @@ var require_parse3 = __commonJS({
26153
26530
  output = token.close = `)$))${extglobStar}`;
26154
26531
  }
26155
26532
  if (token.inner.includes("*") && (rest = remaining()) && /^\.[^\\/.]+$/.test(rest)) {
26156
- const expression = parse6(rest, { ...options, fastpaths: false }).output;
26533
+ const expression = parse7(rest, { ...options, fastpaths: false }).output;
26157
26534
  output = token.close = `)${expression})${extglobStar})`;
26158
26535
  }
26159
26536
  if (token.prev.type === "bos") {
@@ -26682,7 +27059,7 @@ var require_parse3 = __commonJS({
26682
27059
  }
26683
27060
  return state;
26684
27061
  };
26685
- parse6.fastpaths = (input, options) => {
27062
+ parse7.fastpaths = (input, options) => {
26686
27063
  const opts = { ...options };
26687
27064
  const max = typeof opts.maxLength === "number" ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
26688
27065
  const len = input.length;
@@ -26751,7 +27128,7 @@ var require_parse3 = __commonJS({
26751
27128
  }
26752
27129
  return source;
26753
27130
  };
26754
- module2.exports = parse6;
27131
+ module2.exports = parse7;
26755
27132
  }
26756
27133
  });
26757
27134
 
@@ -26761,7 +27138,7 @@ var require_picomatch = __commonJS({
26761
27138
  "use strict";
26762
27139
  var path5 = require("path");
26763
27140
  var scan = require_scan();
26764
- var parse6 = require_parse3();
27141
+ var parse7 = require_parse3();
26765
27142
  var utils = require_utils3();
26766
27143
  var constants = require_constants3();
26767
27144
  var isObject = (val2) => val2 && typeof val2 === "object" && !Array.isArray(val2);
@@ -26851,7 +27228,7 @@ var require_picomatch = __commonJS({
26851
27228
  picomatch.parse = (pattern, options) => {
26852
27229
  if (Array.isArray(pattern))
26853
27230
  return pattern.map((p4) => picomatch.parse(p4, options));
26854
- return parse6(pattern, { ...options, fastpaths: false });
27231
+ return parse7(pattern, { ...options, fastpaths: false });
26855
27232
  };
26856
27233
  picomatch.scan = (input, options) => scan(input, options);
26857
27234
  picomatch.compileRe = (state, options, returnOutput = false, returnState = false) => {
@@ -26877,10 +27254,10 @@ var require_picomatch = __commonJS({
26877
27254
  }
26878
27255
  let parsed = { negated: false, fastpaths: true };
26879
27256
  if (options.fastpaths !== false && (input[0] === "." || input[0] === "*")) {
26880
- parsed.output = parse6.fastpaths(input, options);
27257
+ parsed.output = parse7.fastpaths(input, options);
26881
27258
  }
26882
27259
  if (!parsed.output) {
26883
- parsed = parse6(input, options);
27260
+ parsed = parse7(input, options);
26884
27261
  }
26885
27262
  return picomatch.compileRe(parsed, options, returnOutput, returnState);
26886
27263
  };
@@ -26907,9 +27284,9 @@ var require_picomatch2 = __commonJS({
26907
27284
  }
26908
27285
  });
26909
27286
 
26910
- // node_modules/.pnpm/micromatch@4.0.7/node_modules/micromatch/index.js
27287
+ // node_modules/.pnpm/micromatch@4.0.5/node_modules/micromatch/index.js
26911
27288
  var require_micromatch = __commonJS({
26912
- "node_modules/.pnpm/micromatch@4.0.7/node_modules/micromatch/index.js"(exports2, module2) {
27289
+ "node_modules/.pnpm/micromatch@4.0.5/node_modules/micromatch/index.js"(exports2, module2) {
26913
27290
  "use strict";
26914
27291
  var util2 = require("util");
26915
27292
  var braces = require_braces();
@@ -41867,7 +42244,7 @@ var require_public_api = __commonJS({
41867
42244
  }
41868
42245
  return doc;
41869
42246
  }
41870
- function parse6(src, reviver, options) {
42247
+ function parse7(src, reviver, options) {
41871
42248
  let _reviver = void 0;
41872
42249
  if (typeof reviver === "function") {
41873
42250
  _reviver = reviver;
@@ -41906,7 +42283,7 @@ var require_public_api = __commonJS({
41906
42283
  }
41907
42284
  return new Document.Document(value, _replacer, options).toString(options);
41908
42285
  }
41909
- exports2.parse = parse6;
42286
+ exports2.parse = parse7;
41910
42287
  exports2.parseAllDocuments = parseAllDocuments;
41911
42288
  exports2.parseDocument = parseDocument;
41912
42289
  exports2.stringify = stringify4;
@@ -44332,7 +44709,7 @@ var require_extension = __commonJS({
44332
44709
  else
44333
44710
  dest[name].push(elem);
44334
44711
  }
44335
- function parse6(header) {
44712
+ function parse7(header) {
44336
44713
  const offers = /* @__PURE__ */ Object.create(null);
44337
44714
  let params = /* @__PURE__ */ Object.create(null);
44338
44715
  let mustUnescape = false;
@@ -44487,7 +44864,7 @@ var require_extension = __commonJS({
44487
44864
  }).join(", ");
44488
44865
  }).join(", ");
44489
44866
  }
44490
- module2.exports = { format: format2, parse: parse6 };
44867
+ module2.exports = { format: format2, parse: parse7 };
44491
44868
  }
44492
44869
  });
44493
44870
 
@@ -44519,7 +44896,7 @@ var require_websocket = __commonJS({
44519
44896
  var {
44520
44897
  EventTarget: { addEventListener: addEventListener2, removeEventListener }
44521
44898
  } = require_event_target();
44522
- var { format: format2, parse: parse6 } = require_extension();
44899
+ var { format: format2, parse: parse7 } = require_extension();
44523
44900
  var { toBuffer } = require_buffer_util();
44524
44901
  var closeTimeout = 30 * 1e3;
44525
44902
  var kAborted = Symbol("kAborted");
@@ -45206,7 +45583,7 @@ var require_websocket = __commonJS({
45206
45583
  }
45207
45584
  let extensions;
45208
45585
  try {
45209
- extensions = parse6(secWebSocketExtensions);
45586
+ extensions = parse7(secWebSocketExtensions);
45210
45587
  } catch (err2) {
45211
45588
  const message = "Invalid Sec-WebSocket-Extensions header";
45212
45589
  abortHandshake(websocket, socket, message);
@@ -45382,7 +45759,7 @@ var require_subprotocol = __commonJS({
45382
45759
  "node_modules/.pnpm/ws@8.17.0/node_modules/ws/lib/subprotocol.js"(exports2, module2) {
45383
45760
  "use strict";
45384
45761
  var { tokenChars } = require_validation();
45385
- function parse6(header) {
45762
+ function parse7(header) {
45386
45763
  const protocols = /* @__PURE__ */ new Set();
45387
45764
  let start = -1;
45388
45765
  let end = -1;
@@ -45421,7 +45798,7 @@ var require_subprotocol = __commonJS({
45421
45798
  protocols.add(protocol2);
45422
45799
  return protocols;
45423
45800
  }
45424
- module2.exports = { parse: parse6 };
45801
+ module2.exports = { parse: parse7 };
45425
45802
  }
45426
45803
  });
45427
45804
 
@@ -50251,7 +50628,7 @@ var init_v1 = __esm({
50251
50628
  });
50252
50629
 
50253
50630
  // node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/parse.js
50254
- function parse(uuid) {
50631
+ function parse2(uuid) {
50255
50632
  if (!validate_default(uuid)) {
50256
50633
  throw TypeError("Invalid UUID");
50257
50634
  }
@@ -50279,7 +50656,7 @@ var parse_default;
50279
50656
  var init_parse = __esm({
50280
50657
  "node_modules/.pnpm/uuid@9.0.1/node_modules/uuid/dist/esm-node/parse.js"() {
50281
50658
  init_validate();
50282
- parse_default = parse;
50659
+ parse_default = parse2;
50283
50660
  }
50284
50661
  });
50285
50662
 
@@ -58236,7 +58613,7 @@ var require_dist_cjs39 = __commonJS({
58236
58613
  providerConfigFromInit: () => providerConfigFromInit
58237
58614
  });
58238
58615
  module2.exports = __toCommonJS2(src_exports2);
58239
- var import_url7 = require("url");
58616
+ var import_url8 = require("url");
58240
58617
  var import_property_provider = require_dist_cjs12();
58241
58618
  var import_buffer2 = require("buffer");
58242
58619
  var import_http3 = require("http");
@@ -58343,7 +58720,7 @@ var require_dist_cjs39 = __commonJS({
58343
58720
  };
58344
58721
  }
58345
58722
  if (process.env[ENV_CMDS_FULL_URI]) {
58346
- const parsed = (0, import_url7.parse)(process.env[ENV_CMDS_FULL_URI]);
58723
+ const parsed = (0, import_url8.parse)(process.env[ENV_CMDS_FULL_URI]);
58347
58724
  if (!parsed.hostname || !(parsed.hostname in GREENGRASS_HOSTS)) {
58348
58725
  throw new import_property_provider.CredentialsProviderError(
58349
58726
  `${parsed.hostname} is not a valid container metadata service hostname`,
@@ -65812,7 +66189,7 @@ var require_postgres_interval = __commonJS({
65812
66189
  if (!(this instanceof PostgresInterval)) {
65813
66190
  return new PostgresInterval(raw2);
65814
66191
  }
65815
- extend(this, parse6(raw2));
66192
+ extend(this, parse7(raw2));
65816
66193
  }
65817
66194
  var properties = ["seconds", "minutes", "hours", "days", "months", "years"];
65818
66195
  PostgresInterval.prototype.toPostgres = function() {
@@ -65874,7 +66251,7 @@ var require_postgres_interval = __commonJS({
65874
66251
  var microseconds = fraction + "000000".slice(fraction.length);
65875
66252
  return parseInt(microseconds, 10) / 1e3;
65876
66253
  }
65877
- function parse6(interval) {
66254
+ function parse7(interval) {
65878
66255
  if (!interval)
65879
66256
  return {};
65880
66257
  var matches = INTERVAL.exec(interval);
@@ -66368,13 +66745,13 @@ var require_binaryParsers = __commonJS({
66368
66745
  console.log("ERROR: ElementType not implemented: " + elementType2);
66369
66746
  }
66370
66747
  };
66371
- var parse6 = function(dimension, elementType2) {
66748
+ var parse7 = function(dimension, elementType2) {
66372
66749
  var array = [];
66373
66750
  var i3;
66374
66751
  if (dimension.length > 1) {
66375
66752
  var count = dimension.shift();
66376
66753
  for (i3 = 0; i3 < count; i3++) {
66377
- array[i3] = parse6(dimension, elementType2);
66754
+ array[i3] = parse7(dimension, elementType2);
66378
66755
  }
66379
66756
  dimension.unshift(count);
66380
66757
  } else {
@@ -66384,7 +66761,7 @@ var require_binaryParsers = __commonJS({
66384
66761
  }
66385
66762
  return array;
66386
66763
  };
66387
- return parse6(dims, elementType);
66764
+ return parse7(dims, elementType);
66388
66765
  };
66389
66766
  var parseText = function(value) {
66390
66767
  return value.toString("utf8");
@@ -67032,7 +67409,7 @@ var require_type_overrides = __commonJS({
67032
67409
  var require_pg_connection_string = __commonJS({
67033
67410
  "node_modules/.pnpm/pg-connection-string@2.6.4/node_modules/pg-connection-string/index.js"(exports2, module2) {
67034
67411
  "use strict";
67035
- function parse6(str) {
67412
+ function parse7(str) {
67036
67413
  if (str.charAt(0) === "/") {
67037
67414
  const config2 = str.split(" ");
67038
67415
  return { host: config2[0], database: config2[1] };
@@ -67108,8 +67485,8 @@ var require_pg_connection_string = __commonJS({
67108
67485
  }
67109
67486
  return config;
67110
67487
  }
67111
- module2.exports = parse6;
67112
- parse6.parse = parse6;
67488
+ module2.exports = parse7;
67489
+ parse7.parse = parse7;
67113
67490
  }
67114
67491
  });
67115
67492
 
@@ -67119,7 +67496,7 @@ var require_connection_parameters = __commonJS({
67119
67496
  "use strict";
67120
67497
  var dns = require("dns");
67121
67498
  var defaults3 = require_defaults();
67122
- var parse6 = require_pg_connection_string().parse;
67499
+ var parse7 = require_pg_connection_string().parse;
67123
67500
  var val2 = function(key, config, envVar) {
67124
67501
  if (envVar === void 0) {
67125
67502
  envVar = process.env["PG" + key.toUpperCase()];
@@ -67154,9 +67531,9 @@ var require_connection_parameters = __commonJS({
67154
67531
  };
67155
67532
  var ConnectionParameters = class {
67156
67533
  constructor(config) {
67157
- config = typeof config === "string" ? parse6(config) : config || {};
67534
+ config = typeof config === "string" ? parse7(config) : config || {};
67158
67535
  if (config.connectionString) {
67159
- config = Object.assign({}, config, parse6(config.connectionString));
67536
+ config = Object.assign({}, config, parse7(config.connectionString));
67160
67537
  }
67161
67538
  this.user = val2("user", config);
67162
67539
  this.database = val2("database", config);
@@ -67827,7 +68204,7 @@ var require_serializer = __commonJS({
67827
68204
  );
67828
68205
  };
67829
68206
  var emptyArray = [];
67830
- var parse6 = (query2) => {
68207
+ var parse7 = (query2) => {
67831
68208
  const name = query2.name || "";
67832
68209
  if (name.length > 63) {
67833
68210
  console.error("Warning! Postgres only supports 63 characters for query names.");
@@ -67976,7 +68353,7 @@ var require_serializer = __commonJS({
67976
68353
  sendSASLInitialResponseMessage,
67977
68354
  sendSCRAMClientFinalMessage,
67978
68355
  query,
67979
- parse: parse6,
68356
+ parse: parse7,
67980
68357
  bind,
67981
68358
  execute,
67982
68359
  describe,
@@ -68354,12 +68731,12 @@ var require_dist2 = __commonJS({
68354
68731
  return serializer_1.serialize;
68355
68732
  } });
68356
68733
  var parser_1 = require_parser2();
68357
- function parse6(stream, callback) {
68734
+ function parse7(stream, callback) {
68358
68735
  const parser = new parser_1.Parser();
68359
68736
  stream.on("data", (buffer2) => parser.parse(buffer2, callback));
68360
68737
  return new Promise((resolve2) => stream.on("end", () => resolve2()));
68361
68738
  }
68362
- exports2.parse = parse6;
68739
+ exports2.parse = parse7;
68363
68740
  }
68364
68741
  });
68365
68742
 
@@ -68405,7 +68782,7 @@ var require_connection = __commonJS({
68405
68782
  "use strict";
68406
68783
  var net2 = require("net");
68407
68784
  var EventEmitter = require("events").EventEmitter;
68408
- var { parse: parse6, serialize: serialize3 } = require_dist2();
68785
+ var { parse: parse7, serialize: serialize3 } = require_dist2();
68409
68786
  var { getStream, getSecureStream } = require_stream6();
68410
68787
  var flushBuffer = serialize3.flush();
68411
68788
  var syncBuffer = serialize3.sync();
@@ -68492,7 +68869,7 @@ var require_connection = __commonJS({
68492
68869
  });
68493
68870
  }
68494
68871
  attachListeners(stream) {
68495
- parse6(stream, (msg) => {
68872
+ parse7(stream, (msg) => {
68496
68873
  var eventName = msg.name === "error" ? "errorMessage" : msg.name;
68497
68874
  if (this._emitMessage) {
68498
68875
  this.emit("message", msg);
@@ -71754,7 +72131,7 @@ function Subscribe(postgres2, options) {
71754
72131
  }
71755
72132
  function data(x4) {
71756
72133
  if (x4[0] === 119) {
71757
- parse2(x4.subarray(25), state2, sql3.options.parsers, handle, options.transform);
72134
+ parse3(x4.subarray(25), state2, sql3.options.parsers, handle, options.transform);
71758
72135
  } else if (x4[0] === 107 && x4[17]) {
71759
72136
  state2.lsn = x4.subarray(1, 9);
71760
72137
  pong();
@@ -71784,7 +72161,7 @@ function Subscribe(postgres2, options) {
71784
72161
  function Time(x3) {
71785
72162
  return new Date(Date.UTC(2e3, 0, 1) + Number(x3 / BigInt(1e3)));
71786
72163
  }
71787
- function parse2(x3, state, parsers2, handle, transform) {
72164
+ function parse3(x3, state, parsers2, handle, transform) {
71788
72165
  const char = (acc, [k2, v6]) => (acc[k2.charCodeAt(0)] = v6, acc);
71789
72166
  Object.entries({
71790
72167
  R: (x4) => {
@@ -80286,7 +80663,7 @@ var require_extension2 = __commonJS({
80286
80663
  else
80287
80664
  dest[name].push(elem);
80288
80665
  }
80289
- function parse6(header) {
80666
+ function parse7(header) {
80290
80667
  const offers = /* @__PURE__ */ Object.create(null);
80291
80668
  let params = /* @__PURE__ */ Object.create(null);
80292
80669
  let mustUnescape = false;
@@ -80441,7 +80818,7 @@ var require_extension2 = __commonJS({
80441
80818
  }).join(", ");
80442
80819
  }).join(", ");
80443
80820
  }
80444
- module2.exports = { format: format2, parse: parse6 };
80821
+ module2.exports = { format: format2, parse: parse7 };
80445
80822
  }
80446
80823
  });
80447
80824
 
@@ -80473,7 +80850,7 @@ var require_websocket2 = __commonJS({
80473
80850
  var {
80474
80851
  EventTarget: { addEventListener: addEventListener2, removeEventListener }
80475
80852
  } = require_event_target2();
80476
- var { format: format2, parse: parse6 } = require_extension2();
80853
+ var { format: format2, parse: parse7 } = require_extension2();
80477
80854
  var { toBuffer } = require_buffer_util2();
80478
80855
  var closeTimeout = 30 * 1e3;
80479
80856
  var kAborted = Symbol("kAborted");
@@ -81153,7 +81530,7 @@ var require_websocket2 = __commonJS({
81153
81530
  }
81154
81531
  let extensions;
81155
81532
  try {
81156
- extensions = parse6(secWebSocketExtensions);
81533
+ extensions = parse7(secWebSocketExtensions);
81157
81534
  } catch (err2) {
81158
81535
  const message = "Invalid Sec-WebSocket-Extensions header";
81159
81536
  abortHandshake(websocket, socket, message);
@@ -81327,7 +81704,7 @@ var require_subprotocol2 = __commonJS({
81327
81704
  "node_modules/.pnpm/ws@8.14.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/subprotocol.js"(exports2, module2) {
81328
81705
  "use strict";
81329
81706
  var { tokenChars } = require_validation2();
81330
- function parse6(header) {
81707
+ function parse7(header) {
81331
81708
  const protocols = /* @__PURE__ */ new Set();
81332
81709
  let start = -1;
81333
81710
  let end = -1;
@@ -81366,7 +81743,7 @@ var require_subprotocol2 = __commonJS({
81366
81743
  protocols.add(protocol2);
81367
81744
  return protocols;
81368
81745
  }
81369
- module2.exports = { parse: parse6 };
81746
+ module2.exports = { parse: parse7 };
81370
81747
  }
81371
81748
  });
81372
81749
 
@@ -99253,7 +99630,7 @@ var require_esprima = __commonJS({
99253
99630
  var jsx_parser_1 = __webpack_require__2(3);
99254
99631
  var parser_1 = __webpack_require__2(8);
99255
99632
  var tokenizer_1 = __webpack_require__2(15);
99256
- function parse6(code, options, delegate) {
99633
+ function parse7(code, options, delegate) {
99257
99634
  var commentHandler = null;
99258
99635
  var proxyDelegate = function(node, metadata) {
99259
99636
  if (delegate) {
@@ -99298,17 +99675,17 @@ var require_esprima = __commonJS({
99298
99675
  }
99299
99676
  return ast;
99300
99677
  }
99301
- exports3.parse = parse6;
99678
+ exports3.parse = parse7;
99302
99679
  function parseModule(code, options, delegate) {
99303
99680
  var parsingOptions = options || {};
99304
99681
  parsingOptions.sourceType = "module";
99305
- return parse6(code, parsingOptions, delegate);
99682
+ return parse7(code, parsingOptions, delegate);
99306
99683
  }
99307
99684
  exports3.parseModule = parseModule;
99308
99685
  function parseScript(code, options, delegate) {
99309
99686
  var parsingOptions = options || {};
99310
99687
  parsingOptions.sourceType = "script";
99311
- return parse6(code, parsingOptions, delegate);
99688
+ return parse7(code, parsingOptions, delegate);
99312
99689
  }
99313
99690
  exports3.parseScript = parseScript;
99314
99691
  function tokenize(code, options, delegate) {
@@ -108860,7 +109237,7 @@ var require_named_placeholders = __commonJS({
108860
109237
  var DQUOTE = 34;
108861
109238
  var SQUOTE = 39;
108862
109239
  var BSLASH = 92;
108863
- function parse6(query) {
109240
+ function parse7(query) {
108864
109241
  let ppos = RE_PARAM.exec(query);
108865
109242
  let curpos = 0;
108866
109243
  let start = 0;
@@ -108975,17 +109352,17 @@ var require_named_placeholders = __commonJS({
108975
109352
  if (cache && (tree = cache.get(query))) {
108976
109353
  return toArrayParams(tree, paramsObj);
108977
109354
  }
108978
- tree = join7(parse6(query));
109355
+ tree = join7(parse7(query));
108979
109356
  if (cache) {
108980
109357
  cache.set(query, tree);
108981
109358
  }
108982
109359
  return toArrayParams(tree, paramsObj);
108983
109360
  }
108984
- compile.parse = parse6;
109361
+ compile.parse = parse7;
108985
109362
  return compile;
108986
109363
  }
108987
109364
  function toNumbered(q, params) {
108988
- const tree = parse6(q);
109365
+ const tree = parse7(q);
108989
109366
  const paramsArr = [];
108990
109367
  if (tree.length == 1) {
108991
109368
  return [tree[0], paramsArr];
@@ -111139,7 +111516,7 @@ function parseObjectRow(fields, rawRow, cast2) {
111139
111516
  return acc;
111140
111517
  }, {});
111141
111518
  }
111142
- function parse3(result, cast2, returnAs) {
111519
+ function parse4(result, cast2, returnAs) {
111143
111520
  const fields = result.fields ?? [];
111144
111521
  const rows = result.rows ?? [];
111145
111522
  return rows.map((row) => returnAs === "array" ? parseArrayRow(fields, row, cast2) : parseObjectRow(fields, row, cast2));
@@ -111248,7 +111625,7 @@ var init_dist2 = __esm({
111248
111625
  field.type || (field.type = "NULL");
111249
111626
  }
111250
111627
  const castFn = options.cast || this.config.cast || cast;
111251
- const rows = result ? parse3(result, castFn, options.as || "object") : [];
111628
+ const rows = result ? parse4(result, castFn, options.as || "object") : [];
111252
111629
  const headers = fields.map((f3) => f3.name);
111253
111630
  const typeByName = (acc, { name, type }) => ({ ...acc, [name]: type });
111254
111631
  const types4 = fields.reduce(typeByName, {});
@@ -111291,6 +111668,7 @@ var init_connections = __esm({
111291
111668
  init_utils2();
111292
111669
  init_global();
111293
111670
  init_outputs();
111671
+ init_utils();
111294
111672
  preparePostgresDB = async (credentials2) => {
111295
111673
  if ("driver" in credentials2) {
111296
111674
  if (credentials2.driver === "aws-data-api") {
@@ -111357,7 +111735,8 @@ var init_connections = __esm({
111357
111735
  const pg = await Promise.resolve().then(() => __toESM(require_lib3()));
111358
111736
  const { drizzle } = await import("drizzle-orm/node-postgres");
111359
111737
  const { migrate } = await import("drizzle-orm/node-postgres/migrator");
111360
- const client = "url" in credentials2 ? new pg.default.Pool({ connectionString: credentials2.url, max: 1 }) : new pg.default.Pool({ ...credentials2, max: 1 });
111738
+ const ssl = "ssl" in credentials2 ? credentials2.ssl === "prefer" || credentials2.ssl === "require" || credentials2.ssl === "allow" ? { rejectUnauthorized: false } : credentials2.ssl === "verify-full" ? {} : credentials2.ssl : {};
111739
+ const client = "url" in credentials2 ? new pg.default.Pool({ connectionString: credentials2.url, max: 1 }) : new pg.default.Pool({ ...credentials2, ssl, max: 1 });
111361
111740
  const db2 = drizzle(client);
111362
111741
  const migrateFn = async (config) => {
111363
111742
  return migrate(db2, config);
@@ -111409,11 +111788,11 @@ var init_connections = __esm({
111409
111788
  "'@vercel/postgres' can only connect to remote Neon/Vercel Postgres/Supabase instances through a websocket"
111410
111789
  )
111411
111790
  );
111412
- const { VercelClient: VercelClient2 } = await Promise.resolve().then(() => (init_index_node(), index_node_exports));
111791
+ const { VercelPool: VercelPool2 } = await Promise.resolve().then(() => (init_index_node(), index_node_exports));
111413
111792
  const { drizzle } = await import("drizzle-orm/vercel-postgres");
111414
111793
  const { migrate } = await import("drizzle-orm/vercel-postgres/migrator");
111415
- const client = "url" in credentials2 ? new VercelClient2(credentials2.url) : new VercelClient2(credentials2);
111416
- client.neonConfig.webSocketConstructor = wrapper_default;
111794
+ const ssl = "ssl" in credentials2 ? credentials2.ssl === "prefer" || credentials2.ssl === "require" || credentials2.ssl === "allow" ? { rejectUnauthorized: false } : credentials2.ssl === "verify-full" ? {} : credentials2.ssl : {};
111795
+ const client = "url" in credentials2 ? new VercelPool2({ connectionString: credentials2.url }) : new VercelPool2({ ...credentials2, ssl });
111417
111796
  await client.connect();
111418
111797
  const db2 = drizzle(client);
111419
111798
  const migrateFn = async (config) => {
@@ -111444,16 +111823,16 @@ var init_connections = __esm({
111444
111823
  "'@neondatabase/serverless' can only connect to remote Neon/Vercel Postgres/Supabase instances through a websocket"
111445
111824
  )
111446
111825
  );
111447
- const { Client: Client2 } = await Promise.resolve().then(() => (init_serverless2(), serverless_exports));
111826
+ const { Pool, neonConfig } = await Promise.resolve().then(() => (init_serverless2(), serverless_exports));
111448
111827
  const { drizzle } = await import("drizzle-orm/neon-serverless");
111449
111828
  const { migrate } = await import("drizzle-orm/neon-serverless/migrator");
111450
- const client = "url" in credentials2 ? new Client2(credentials2.url) : new Client2(credentials2);
111829
+ const ssl = "ssl" in credentials2 ? credentials2.ssl === "prefer" || credentials2.ssl === "require" || credentials2.ssl === "allow" ? { rejectUnauthorized: false } : credentials2.ssl === "verify-full" ? {} : credentials2.ssl : {};
111830
+ const client = "url" in credentials2 ? new Pool({ connectionString: credentials2.url, max: 1 }) : new Pool({ ...credentials2, max: 1, ssl });
111831
+ neonConfig.webSocketConstructor = wrapper_default;
111451
111832
  const db2 = drizzle(client);
111452
111833
  const migrateFn = async (config) => {
111453
111834
  return migrate(db2, config);
111454
111835
  };
111455
- client.neonConfig.webSocketConstructor = wrapper_default;
111456
- await client.connect();
111457
111836
  const query = async (sql2, params) => {
111458
111837
  const result = await client.query(sql2, params ?? []);
111459
111838
  return result.rows;
@@ -111675,7 +112054,7 @@ var init_connections = __esm({
111675
112054
  const { drizzle } = await import("drizzle-orm/libsql");
111676
112055
  const { migrate } = await import("drizzle-orm/libsql/migrator");
111677
112056
  const client = createClient2({
111678
- url: credentials2.url
112057
+ url: normaliseSQLiteUrl(credentials2.url, "libsql")
111679
112058
  });
111680
112059
  const drzl = drizzle(client);
111681
112060
  const migrateFn = async (config) => {
@@ -111710,7 +112089,9 @@ var init_connections = __esm({
111710
112089
  const { default: Database } = await import("better-sqlite3");
111711
112090
  const { drizzle } = await import("drizzle-orm/better-sqlite3");
111712
112091
  const { migrate } = await import("drizzle-orm/better-sqlite3/migrator");
111713
- const sqlite = new Database(credentials2.url);
112092
+ const sqlite = new Database(
112093
+ normaliseSQLiteUrl(credentials2.url, "better-sqlite")
112094
+ );
111714
112095
  const drzl = drizzle(sqlite);
111715
112096
  const migrateFn = async (config) => {
111716
112097
  return migrate(drzl, config);
@@ -115165,6 +115546,7 @@ var init_introspect_pg = __esm({
115165
115546
  init_utils3();
115166
115547
  init_pgSerializer();
115167
115548
  init_global();
115549
+ init_vector();
115168
115550
  pgImportsList = /* @__PURE__ */ new Set([
115169
115551
  "pgTable",
115170
115552
  "pgEnum",
@@ -115193,7 +115575,11 @@ var init_introspect_pg = __esm({
115193
115575
  "macaddr8",
115194
115576
  "bigint",
115195
115577
  "doublePrecision",
115196
- "uuid"
115578
+ "uuid",
115579
+ "vector",
115580
+ "point",
115581
+ "line",
115582
+ "geometry"
115197
115583
  ]);
115198
115584
  objToStatement23 = (json) => {
115199
115585
  json = Object.fromEntries(Object.entries(json).filter((it) => it[1]));
@@ -115330,6 +115716,8 @@ var init_introspect_pg = __esm({
115330
115716
  patched = patched.startsWith("numeric(") ? "numeric" : patched;
115331
115717
  patched = patched.startsWith("time(") ? "time" : patched;
115332
115718
  patched = patched.startsWith("timestamp(") ? "timestamp" : patched;
115719
+ patched = patched.startsWith("vector(") ? "vector" : patched;
115720
+ patched = patched.startsWith("geometry(") ? "geometry" : patched;
115333
115721
  return patched;
115334
115722
  }).filter((type) => {
115335
115723
  return pgImportsList.has(type);
@@ -115520,7 +115908,7 @@ var init_introspect_pg = __esm({
115520
115908
  }
115521
115909
  if (lowered === "date") {
115522
115910
  let out = `${withCasing2(name, casing2)}: date("${name}")`;
115523
- defaultValue = defaultValue === "now()" ? ".defaultNow()" : defaultValue ? `.default(${defaultValue})` : "";
115911
+ defaultValue = defaultValue === "now()" ? ".defaultNow()" : defaultValue === "CURRENT_DATE" ? `.default(sql\`${defaultValue}\`)` : defaultValue ? `.default(${defaultValue})` : "";
115524
115912
  out += defaultValue;
115525
115913
  return out;
115526
115914
  }
@@ -115580,6 +115968,58 @@ var init_introspect_pg = __esm({
115580
115968
  out += typeof defaultValue !== "undefined" ? `.default(${defaultValue})` : "";
115581
115969
  return out;
115582
115970
  }
115971
+ if (lowered.startsWith("point")) {
115972
+ let out = `${withCasing2(name, casing2)}: point("${name}")`;
115973
+ out += typeof defaultValue !== "undefined" ? `.default(${defaultValue})` : "";
115974
+ return out;
115975
+ }
115976
+ if (lowered.startsWith("line")) {
115977
+ let out = `${withCasing2(name, casing2)}: point("${name}")`;
115978
+ out += typeof defaultValue !== "undefined" ? `.default(${defaultValue})` : "";
115979
+ return out;
115980
+ }
115981
+ if (lowered.startsWith("geometry")) {
115982
+ let out = "";
115983
+ let isGeoUnknown = false;
115984
+ if (lowered.length !== 8) {
115985
+ const geometryOptions = lowered.slice(9, -1).split(",");
115986
+ if (geometryOptions.length === 1 && geometryOptions[0] !== "") {
115987
+ out = `${withCasing2(name, casing2)}: geometry("${name}", { type: "${geometryOptions[0]}" })`;
115988
+ } else if (geometryOptions.length === 2) {
115989
+ out = `${withCasing2(name, casing2)}: geometry("${name}", { type: "${geometryOptions[0]}", srid: ${geometryOptions[1]} })`;
115990
+ } else {
115991
+ isGeoUnknown = true;
115992
+ }
115993
+ } else {
115994
+ out = `${withCasing2(name, casing2)}: geometry("${name}")`;
115995
+ }
115996
+ out += typeof defaultValue !== "undefined" ? `.default(${defaultValue})` : "";
115997
+ if (isGeoUnknown) {
115998
+ let unknown2 = `// TODO: failed to parse geometry type because found more than 2 options inside geometry function '${type}'
115999
+ // Introspect is currently supporting only type and srid options
116000
+ `;
116001
+ unknown2 += ` ${withCasing2(name, casing2)}: unknown("${name}")`;
116002
+ return unknown2;
116003
+ }
116004
+ return out;
116005
+ }
116006
+ if (lowered.startsWith("vector")) {
116007
+ const split = lowered.split(" ");
116008
+ let out;
116009
+ if (lowered.length !== 6) {
116010
+ out = `${withCasing2(
116011
+ name,
116012
+ casing2
116013
+ )}: vector("${name}", { dimensions: ${lowered.substring(
116014
+ 7,
116015
+ lowered.length - 1
116016
+ )} })`;
116017
+ } else {
116018
+ out = `${withCasing2(name, casing2)}: vector("${name}")`;
116019
+ }
116020
+ out += typeof defaultValue !== "undefined" ? `.default(${defaultValue})` : "";
116021
+ return out;
116022
+ }
115583
116023
  if (lowered.startsWith("char")) {
115584
116024
  let out;
115585
116025
  if (lowered.length !== 4) {
@@ -115693,13 +116133,35 @@ var init_introspect_pg = __esm({
115693
116133
  let idxKey = it.name.startsWith(tableName) && it.name !== tableName ? it.name.slice(tableName.length + 1) : it.name;
115694
116134
  idxKey = idxKey.endsWith("_index") ? idxKey.slice(0, -"_index".length) + "_idx" : idxKey;
115695
116135
  idxKey = withCasing2(idxKey, casing2);
115696
- const indexGeneratedName = indexName2(tableName, it.columns);
116136
+ const indexGeneratedName = indexName2(
116137
+ tableName,
116138
+ it.columns.map((it2) => it2.expression)
116139
+ );
115697
116140
  const escapedIndexName = indexGeneratedName === it.name ? "" : `"${it.name}"`;
115698
116141
  statement += ` ${idxKey}: `;
115699
116142
  statement += it.isUnique ? "uniqueIndex(" : "index(";
115700
116143
  statement += `${escapedIndexName})`;
115701
- statement += `.on(${it.columns.map((it2) => `table.${withCasing2(it2, casing2)}`).join(", ")}),`;
115702
- statement += `
116144
+ statement += `${it.concurrently ? `.concurrently()` : ""}`;
116145
+ statement += `.using("${it.method}", ${it.columns.map((it2) => {
116146
+ if (it2.isExpression) {
116147
+ return `sql\`${it2.expression}\``;
116148
+ } else {
116149
+ return `table.${withCasing2(it2.expression, casing2)}${it2.opclass && vectorOps.includes(it2.opclass) ? `.op("${it2.opclass}")` : ""}`;
116150
+ }
116151
+ }).join(", ")})`;
116152
+ statement += it.where ? `.where(sql\`${it.where}\`)` : "";
116153
+ function reverseLogic(mappedWith) {
116154
+ let reversedString = "{";
116155
+ for (const key in mappedWith) {
116156
+ if (mappedWith.hasOwnProperty(key)) {
116157
+ reversedString += `${key}: "${mappedWith[key]}",`;
116158
+ }
116159
+ }
116160
+ reversedString = reversedString.length > 1 ? reversedString.slice(0, reversedString.length - 1) : reversedString;
116161
+ return `${reversedString}}`;
116162
+ }
116163
+ statement += it.with && Object.keys(it.with).length > 0 ? `.with(${reverseLogic(it.with)})` : "";
116164
+ statement += `,
115703
116165
  `;
115704
116166
  });
115705
116167
  return statement;
@@ -116157,10 +116619,19 @@ var init_introspect = __esm({
116157
116619
  const filter2 = (tableName) => {
116158
116620
  if (matchers.length === 0)
116159
116621
  return true;
116160
- for (let i2 = 0; i2 < matchers.length; i2++) {
116161
- const matcher = matchers[i2];
116162
- if (matcher.match(tableName))
116163
- return true;
116622
+ let flags = [];
116623
+ for (let matcher of matchers) {
116624
+ if (matcher.negate) {
116625
+ if (!matcher.match(tableName)) {
116626
+ flags.push(false);
116627
+ }
116628
+ }
116629
+ if (matcher.match(tableName)) {
116630
+ flags.push(true);
116631
+ }
116632
+ }
116633
+ if (flags.length > 0) {
116634
+ return flags.every(Boolean);
116164
116635
  }
116165
116636
  return false;
116166
116637
  };
@@ -116231,10 +116702,19 @@ var init_introspect = __esm({
116231
116702
  const filter2 = (tableName) => {
116232
116703
  if (matchers.length === 0)
116233
116704
  return true;
116234
- for (let i2 = 0; i2 < matchers.length; i2++) {
116235
- const matcher = matchers[i2];
116236
- if (matcher.match(tableName))
116237
- return true;
116705
+ let flags = [];
116706
+ for (let matcher of matchers) {
116707
+ if (matcher.negate) {
116708
+ if (!matcher.match(tableName)) {
116709
+ flags.push(false);
116710
+ }
116711
+ }
116712
+ if (matcher.match(tableName)) {
116713
+ flags.push(true);
116714
+ }
116715
+ }
116716
+ if (flags.length > 0) {
116717
+ return flags.every(Boolean);
116238
116718
  }
116239
116719
  return false;
116240
116720
  };
@@ -116303,10 +116783,19 @@ var init_introspect = __esm({
116303
116783
  const filter2 = (tableName) => {
116304
116784
  if (matchers.length === 0)
116305
116785
  return true;
116306
- for (let i2 = 0; i2 < matchers.length; i2++) {
116307
- const matcher = matchers[i2];
116308
- if (matcher.match(tableName))
116309
- return true;
116786
+ let flags = [];
116787
+ for (let matcher of matchers) {
116788
+ if (matcher.negate) {
116789
+ if (!matcher.match(tableName)) {
116790
+ flags.push(false);
116791
+ }
116792
+ }
116793
+ if (matcher.match(tableName)) {
116794
+ flags.push(true);
116795
+ }
116796
+ }
116797
+ if (flags.length > 0) {
116798
+ return flags.every(Boolean);
116310
116799
  }
116311
116800
  return false;
116312
116801
  };
@@ -117099,13 +117588,13 @@ var init_url = __esm({
117099
117588
  });
117100
117589
 
117101
117590
  // node_modules/.pnpm/hono@4.3.9/node_modules/hono/dist/utils/cookie.js
117102
- var validCookieNameRegEx, validCookieValueRegEx, parse4;
117591
+ var validCookieNameRegEx, validCookieValueRegEx, parse5;
117103
117592
  var init_cookie = __esm({
117104
117593
  "node_modules/.pnpm/hono@4.3.9/node_modules/hono/dist/utils/cookie.js"() {
117105
117594
  init_url();
117106
117595
  validCookieNameRegEx = /^[\w!#$%&'*.^`|~+-]+$/;
117107
117596
  validCookieValueRegEx = /^[ !#-:<-[\]-~]*$/;
117108
- parse4 = (cookie, name) => {
117597
+ parse5 = (cookie, name) => {
117109
117598
  const pairs = cookie.trim().split(";");
117110
117599
  return pairs.reduce((parsedCookie, pairStr) => {
117111
117600
  pairStr = pairStr.trim();
@@ -117147,13 +117636,13 @@ var init_cookie2 = __esm({
117147
117636
  } else if (prefix === "host") {
117148
117637
  finalKey = "__Host-" + key;
117149
117638
  }
117150
- const obj2 = parse4(cookie, finalKey);
117639
+ const obj2 = parse5(cookie, finalKey);
117151
117640
  return obj2[finalKey];
117152
117641
  }
117153
117642
  if (!cookie) {
117154
117643
  return {};
117155
117644
  }
117156
- const obj = parse4(cookie);
117645
+ const obj = parse5(cookie);
117157
117646
  return obj;
117158
117647
  };
117159
117648
  }
@@ -119566,7 +120055,7 @@ var init_dist6 = __esm({
119566
120055
  });
119567
120056
 
119568
120057
  // node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/index.js
119569
- var SuperJSON, serialize2, deserialize, stringify3, parse5, registerClass, registerCustom, registerSymbol, allowErrorProps;
120058
+ var SuperJSON, serialize2, deserialize, stringify3, parse6, registerClass, registerCustom, registerSymbol, allowErrorProps;
119570
120059
  var init_dist7 = __esm({
119571
120060
  "node_modules/.pnpm/superjson@2.2.1/node_modules/superjson/dist/index.js"() {
119572
120061
  init_class_registry();
@@ -119651,7 +120140,7 @@ var init_dist7 = __esm({
119651
120140
  serialize2 = SuperJSON.serialize;
119652
120141
  deserialize = SuperJSON.deserialize;
119653
120142
  stringify3 = SuperJSON.stringify;
119654
- parse5 = SuperJSON.parse;
120143
+ parse6 = SuperJSON.parse;
119655
120144
  registerClass = SuperJSON.registerClass;
119656
120145
  registerCustom = SuperJSON.registerCustom;
119657
120146
  registerSymbol = SuperJSON.registerSymbol;
@@ -120141,7 +120630,11 @@ var upPgHandler = (out) => {
120141
120630
  raw: report.rawMap[it]
120142
120631
  })).forEach((it) => {
120143
120632
  const path5 = it.path;
120144
- const result = updateUpToV6(it.raw);
120633
+ let resultV6 = it.raw;
120634
+ if (it.raw.version === "5") {
120635
+ resultV6 = updateUpToV6(it.raw);
120636
+ }
120637
+ const result = updateUpToV7(resultV6);
120145
120638
  console.log(`[${source_default.green("\u2713")}] ${path5}`);
120146
120639
  (0, import_fs2.writeFileSync)(path5, JSON.stringify(result, null, 2));
120147
120640
  });
@@ -120177,6 +120670,36 @@ var updateUpToV6 = (json) => {
120177
120670
  enums
120178
120671
  };
120179
120672
  };
120673
+ var updateUpToV7 = (json) => {
120674
+ const schema5 = pgSchemaV6.parse(json);
120675
+ const tables = Object.fromEntries(
120676
+ Object.entries(schema5.tables).map((it) => {
120677
+ const table4 = it[1];
120678
+ const mappedIndexes = Object.fromEntries(
120679
+ Object.entries(table4.indexes).map((idx) => {
120680
+ const { columns, ...rest } = idx[1];
120681
+ const mappedColumns = columns.map((it2) => {
120682
+ return {
120683
+ expression: it2,
120684
+ isExpression: false,
120685
+ asc: true,
120686
+ nulls: "last",
120687
+ opClass: void 0
120688
+ };
120689
+ });
120690
+ return [idx[0], { columns: mappedColumns, ...rest }];
120691
+ })
120692
+ );
120693
+ return [it[0], { ...table4, indexes: mappedIndexes }];
120694
+ })
120695
+ );
120696
+ return {
120697
+ ...schema5,
120698
+ version: "7",
120699
+ dialect: "postgresql",
120700
+ tables
120701
+ };
120702
+ };
120180
120703
 
120181
120704
  // src/cli/commands/sqliteUp.ts
120182
120705
  init_source();
@@ -121342,7 +121865,7 @@ var printVersions = async () => {
121342
121865
  var versions = async () => {
121343
121866
  const { npmVersion } = await ormCoreVersions();
121344
121867
  const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
121345
- const envVersion = "0.21.4";
121868
+ const envVersion = "0.22.0";
121346
121869
  const kitVersion = envVersion ? `v${envVersion}` : "--";
121347
121870
  const versions2 = `drizzle-kit: ${kitVersion}
121348
121871
  ${ormVersion}`;
@@ -121529,7 +122052,7 @@ var upCommand = new import_commander.Command("up").option("--config <config>", `
121529
122052
  var pullCommand = new import_commander.Command("introspect").option("--config <config>", `Config path [default=drizzle.config.ts]`).option("--out <out>", `Migrations folder`).option("--dialect <dialect>", "Database dialect").option("--breakpoints", `Prepare SQL statements with breakpoints`).option(
121530
122053
  "--introspect-casing <introspectCasing>",
121531
122054
  "Column object keys naming strategy"
121532
- ).option("--tablesFilter", `Table name filters`).option("--schemaFilter", `Schema name filters`).option("--url <url>", "Database connection URL").option("--host <host>", "Database host").option("--port <port>", "Database port").option("--user <user>", "Database user").option("--password <password>", "Database password").option("--database <database>", "Database database name").option("--ssl <ssl>", "Database ssl").option("--auth-token <authToken>", "Database auth token [Turso]").option("--driver <driver>", "Driver used for querying the database").action(async (options) => {
122055
+ ).option("--tablesFilter", `Table name filters`).option("--extensionsFilters", `Table name filters`).option("--schemaFilter", `Schema name filters`).option("--url <url>", "Database connection URL").option("--host <host>", "Database host").option("--port <port>", "Database port").option("--user <user>", "Database user").option("--password <password>", "Database password").option("--database <database>", "Database database name").option("--ssl <ssl>", "Database ssl").option("--auth-token <authToken>", "Database auth token [Turso]").option("--driver <driver>", "Driver used for querying the database").action(async (options) => {
121533
122056
  await printVersions();
121534
122057
  await assertPackages("drizzle-orm");
121535
122058
  await assertOrmCoreVersion();