drizzle-kit 0.19.2-f1211c0 → 0.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/index.cjs +167 -167
  2. package/index.d.ts +2 -9
  3. package/package.json +3 -3
  4. package/utils.js +42 -42
package/index.d.ts CHANGED
@@ -34,10 +34,7 @@ export type Config = {
34
34
  password?: string;
35
35
  database: string;
36
36
  ssl?: boolean;
37
- };
38
- } | {
39
- driver: "pg";
40
- dbCredentials: {
37
+ } | {
41
38
  connectionString: string;
42
39
  };
43
40
  } | {
@@ -48,11 +45,7 @@ export type Config = {
48
45
  user?: string;
49
46
  password?: string;
50
47
  database: string;
51
- connectionString: string;
52
- };
53
- } | {
54
- driver: "mysql2";
55
- dbCredentials: {
48
+ } | {
56
49
  connectionString: string;
57
50
  };
58
51
  } | {});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.19.2-f1211c0",
3
+ "version": "0.19.2",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",
@@ -55,6 +55,8 @@
55
55
  "camelcase": "^7.0.1",
56
56
  "chalk": "^5.2.0",
57
57
  "commander": "^9.4.1",
58
+ "esbuild": "^0.18.6",
59
+ "esbuild-register": "^3.4.2",
58
60
  "glob": "^8.1.0",
59
61
  "hanji": "^0.0.5",
60
62
  "json-diff": "0.9.0",
@@ -76,8 +78,6 @@
76
78
  "dockerode": "^3.3.4",
77
79
  "dotenv": "^16.0.3",
78
80
  "drizzle-orm": "0.27.0-56b9edc",
79
- "esbuild": "^0.17.19",
80
- "esbuild-register": "^3.4.2",
81
81
  "eslint": "^8.29.0",
82
82
  "eslint-config-prettier": "^8.5.0",
83
83
  "eslint-plugin-prettier": "^4.2.1",
package/utils.js CHANGED
@@ -1539,7 +1539,7 @@ var init_lib = __esm({
1539
1539
  message: issueData.message || errorMessage
1540
1540
  };
1541
1541
  };
1542
- ParseStatus = class {
1542
+ ParseStatus = class _ParseStatus {
1543
1543
  constructor() {
1544
1544
  this.value = "valid";
1545
1545
  }
@@ -1570,7 +1570,7 @@ var init_lib = __esm({
1570
1570
  value: await pair.value
1571
1571
  });
1572
1572
  }
1573
- return ParseStatus.mergeObjectSync(status, syncPairs);
1573
+ return _ParseStatus.mergeObjectSync(status, syncPairs);
1574
1574
  }
1575
1575
  static mergeObjectSync(status, pairs) {
1576
1576
  const finalObject = {};
@@ -1886,7 +1886,7 @@ var init_lib = __esm({
1886
1886
  }
1887
1887
  }
1888
1888
  };
1889
- ZodString = class extends ZodType {
1889
+ ZodString = class _ZodString extends ZodType {
1890
1890
  constructor() {
1891
1891
  super(...arguments);
1892
1892
  this._regex = (regex, validation, message) => this.refinement((data) => regex.test(data), {
@@ -1895,7 +1895,7 @@ var init_lib = __esm({
1895
1895
  ...errorUtil.errToObj(message)
1896
1896
  });
1897
1897
  this.nonempty = (message) => this.min(1, errorUtil.errToObj(message));
1898
- this.trim = () => new ZodString({
1898
+ this.trim = () => new _ZodString({
1899
1899
  ...this._def,
1900
1900
  checks: [...this._def.checks, { kind: "trim" }]
1901
1901
  });
@@ -2067,7 +2067,7 @@ var init_lib = __esm({
2067
2067
  return { status: status.value, value: input.data };
2068
2068
  }
2069
2069
  _addCheck(check) {
2070
- return new ZodString({
2070
+ return new _ZodString({
2071
2071
  ...this._def,
2072
2072
  checks: [...this._def.checks, check]
2073
2073
  });
@@ -2188,7 +2188,7 @@ var init_lib = __esm({
2188
2188
  ...processCreateParams(params)
2189
2189
  });
2190
2190
  };
2191
- ZodNumber = class extends ZodType {
2191
+ ZodNumber = class _ZodNumber extends ZodType {
2192
2192
  constructor() {
2193
2193
  super(...arguments);
2194
2194
  this.min = this.gte;
@@ -2289,7 +2289,7 @@ var init_lib = __esm({
2289
2289
  return this.setLimit("max", value, false, errorUtil.toString(message));
2290
2290
  }
2291
2291
  setLimit(kind, value, inclusive, message) {
2292
- return new ZodNumber({
2292
+ return new _ZodNumber({
2293
2293
  ...this._def,
2294
2294
  checks: [
2295
2295
  ...this._def.checks,
@@ -2303,7 +2303,7 @@ var init_lib = __esm({
2303
2303
  });
2304
2304
  }
2305
2305
  _addCheck(check) {
2306
- return new ZodNumber({
2306
+ return new _ZodNumber({
2307
2307
  ...this._def,
2308
2308
  checks: [...this._def.checks, check]
2309
2309
  });
@@ -2442,7 +2442,7 @@ var init_lib = __esm({
2442
2442
  ...processCreateParams(params)
2443
2443
  });
2444
2444
  };
2445
- ZodDate = class extends ZodType {
2445
+ ZodDate = class _ZodDate extends ZodType {
2446
2446
  _parse(input) {
2447
2447
  if (this._def.coerce) {
2448
2448
  input.data = new Date(input.data);
@@ -2503,7 +2503,7 @@ var init_lib = __esm({
2503
2503
  };
2504
2504
  }
2505
2505
  _addCheck(check) {
2506
- return new ZodDate({
2506
+ return new _ZodDate({
2507
2507
  ...this._def,
2508
2508
  checks: [...this._def.checks, check]
2509
2509
  });
@@ -2682,7 +2682,7 @@ var init_lib = __esm({
2682
2682
  ...processCreateParams(params)
2683
2683
  });
2684
2684
  };
2685
- ZodArray = class extends ZodType {
2685
+ ZodArray = class _ZodArray extends ZodType {
2686
2686
  _parse(input) {
2687
2687
  const { ctx, status } = this._processInputParams(input);
2688
2688
  const def = this._def;
@@ -2752,19 +2752,19 @@ var init_lib = __esm({
2752
2752
  return this._def.type;
2753
2753
  }
2754
2754
  min(minLength, message) {
2755
- return new ZodArray({
2755
+ return new _ZodArray({
2756
2756
  ...this._def,
2757
2757
  minLength: { value: minLength, message: errorUtil.toString(message) }
2758
2758
  });
2759
2759
  }
2760
2760
  max(maxLength, message) {
2761
- return new ZodArray({
2761
+ return new _ZodArray({
2762
2762
  ...this._def,
2763
2763
  maxLength: { value: maxLength, message: errorUtil.toString(message) }
2764
2764
  });
2765
2765
  }
2766
2766
  length(len, message) {
2767
- return new ZodArray({
2767
+ return new _ZodArray({
2768
2768
  ...this._def,
2769
2769
  exactLength: { value: len, message: errorUtil.toString(message) }
2770
2770
  });
@@ -2801,7 +2801,7 @@ var init_lib = __esm({
2801
2801
  })
2802
2802
  });
2803
2803
  };
2804
- ZodObject = class extends ZodType {
2804
+ ZodObject = class _ZodObject extends ZodType {
2805
2805
  constructor() {
2806
2806
  super(...arguments);
2807
2807
  this._cached = null;
@@ -2907,7 +2907,7 @@ var init_lib = __esm({
2907
2907
  }
2908
2908
  strict(message) {
2909
2909
  errorUtil.errToObj;
2910
- return new ZodObject({
2910
+ return new _ZodObject({
2911
2911
  ...this._def,
2912
2912
  unknownKeys: "strict",
2913
2913
  ...message !== void 0 ? {
@@ -2926,13 +2926,13 @@ var init_lib = __esm({
2926
2926
  });
2927
2927
  }
2928
2928
  strip() {
2929
- return new ZodObject({
2929
+ return new _ZodObject({
2930
2930
  ...this._def,
2931
2931
  unknownKeys: "strip"
2932
2932
  });
2933
2933
  }
2934
2934
  passthrough() {
2935
- return new ZodObject({
2935
+ return new _ZodObject({
2936
2936
  ...this._def,
2937
2937
  unknownKeys: "passthrough"
2938
2938
  });
@@ -2946,7 +2946,7 @@ var init_lib = __esm({
2946
2946
  * upgrade if you are experiencing issues.
2947
2947
  */
2948
2948
  merge(merging) {
2949
- const merged = new ZodObject({
2949
+ const merged = new _ZodObject({
2950
2950
  unknownKeys: merging._def.unknownKeys,
2951
2951
  catchall: merging._def.catchall,
2952
2952
  shape: () => objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
@@ -2955,7 +2955,7 @@ var init_lib = __esm({
2955
2955
  return merged;
2956
2956
  }
2957
2957
  catchall(index4) {
2958
- return new ZodObject({
2958
+ return new _ZodObject({
2959
2959
  ...this._def,
2960
2960
  catchall: index4
2961
2961
  });
@@ -2966,7 +2966,7 @@ var init_lib = __esm({
2966
2966
  if (this.shape[key])
2967
2967
  shape[key] = this.shape[key];
2968
2968
  });
2969
- return new ZodObject({
2969
+ return new _ZodObject({
2970
2970
  ...this._def,
2971
2971
  shape: () => shape
2972
2972
  });
@@ -2978,7 +2978,7 @@ var init_lib = __esm({
2978
2978
  shape[key] = this.shape[key];
2979
2979
  }
2980
2980
  });
2981
- return new ZodObject({
2981
+ return new _ZodObject({
2982
2982
  ...this._def,
2983
2983
  shape: () => shape
2984
2984
  });
@@ -2996,7 +2996,7 @@ var init_lib = __esm({
2996
2996
  newShape[key] = this.shape[key].optional();
2997
2997
  }
2998
2998
  });
2999
- return new ZodObject({
2999
+ return new _ZodObject({
3000
3000
  ...this._def,
3001
3001
  shape: () => newShape
3002
3002
  });
@@ -3006,7 +3006,7 @@ var init_lib = __esm({
3006
3006
  newShape[key] = fieldSchema.optional();
3007
3007
  }
3008
3008
  }
3009
- return new ZodObject({
3009
+ return new _ZodObject({
3010
3010
  ...this._def,
3011
3011
  shape: () => newShape
3012
3012
  });
@@ -3036,7 +3036,7 @@ var init_lib = __esm({
3036
3036
  newShape[key] = newField;
3037
3037
  }
3038
3038
  }
3039
- return new ZodObject({
3039
+ return new _ZodObject({
3040
3040
  ...this._def,
3041
3041
  shape: () => newShape
3042
3042
  });
@@ -3184,7 +3184,7 @@ var init_lib = __esm({
3184
3184
  return null;
3185
3185
  }
3186
3186
  };
3187
- ZodDiscriminatedUnion = class extends ZodType {
3187
+ ZodDiscriminatedUnion = class _ZodDiscriminatedUnion extends ZodType {
3188
3188
  _parse(input) {
3189
3189
  const { ctx } = this._processInputParams(input);
3190
3190
  if (ctx.parsedType !== ZodParsedType.object) {
@@ -3251,7 +3251,7 @@ var init_lib = __esm({
3251
3251
  optionsMap.set(value, type);
3252
3252
  }
3253
3253
  }
3254
- return new ZodDiscriminatedUnion({
3254
+ return new _ZodDiscriminatedUnion({
3255
3255
  typeName: ZodFirstPartyTypeKind.ZodDiscriminatedUnion,
3256
3256
  discriminator,
3257
3257
  options,
@@ -3313,7 +3313,7 @@ var init_lib = __esm({
3313
3313
  ...processCreateParams(params)
3314
3314
  });
3315
3315
  };
3316
- ZodTuple = class extends ZodType {
3316
+ ZodTuple = class _ZodTuple extends ZodType {
3317
3317
  _parse(input) {
3318
3318
  const { status, ctx } = this._processInputParams(input);
3319
3319
  if (ctx.parsedType !== ZodParsedType.array) {
@@ -3363,7 +3363,7 @@ var init_lib = __esm({
3363
3363
  return this._def.items;
3364
3364
  }
3365
3365
  rest(rest) {
3366
- return new ZodTuple({
3366
+ return new _ZodTuple({
3367
3367
  ...this._def,
3368
3368
  rest
3369
3369
  });
@@ -3380,7 +3380,7 @@ var init_lib = __esm({
3380
3380
  ...processCreateParams(params)
3381
3381
  });
3382
3382
  };
3383
- ZodRecord = class extends ZodType {
3383
+ ZodRecord = class _ZodRecord extends ZodType {
3384
3384
  get keySchema() {
3385
3385
  return this._def.keyType;
3386
3386
  }
@@ -3417,14 +3417,14 @@ var init_lib = __esm({
3417
3417
  }
3418
3418
  static create(first, second, third) {
3419
3419
  if (second instanceof ZodType) {
3420
- return new ZodRecord({
3420
+ return new _ZodRecord({
3421
3421
  keyType: first,
3422
3422
  valueType: second,
3423
3423
  typeName: ZodFirstPartyTypeKind.ZodRecord,
3424
3424
  ...processCreateParams(third)
3425
3425
  });
3426
3426
  }
3427
- return new ZodRecord({
3427
+ return new _ZodRecord({
3428
3428
  keyType: ZodString.create(),
3429
3429
  valueType: first,
3430
3430
  typeName: ZodFirstPartyTypeKind.ZodRecord,
@@ -3492,7 +3492,7 @@ var init_lib = __esm({
3492
3492
  ...processCreateParams(params)
3493
3493
  });
3494
3494
  };
3495
- ZodSet = class extends ZodType {
3495
+ ZodSet = class _ZodSet extends ZodType {
3496
3496
  _parse(input) {
3497
3497
  const { status, ctx } = this._processInputParams(input);
3498
3498
  if (ctx.parsedType !== ZodParsedType.set) {
@@ -3550,13 +3550,13 @@ var init_lib = __esm({
3550
3550
  }
3551
3551
  }
3552
3552
  min(minSize, message) {
3553
- return new ZodSet({
3553
+ return new _ZodSet({
3554
3554
  ...this._def,
3555
3555
  minSize: { value: minSize, message: errorUtil.toString(message) }
3556
3556
  });
3557
3557
  }
3558
3558
  max(maxSize, message) {
3559
- return new ZodSet({
3559
+ return new _ZodSet({
3560
3560
  ...this._def,
3561
3561
  maxSize: { value: maxSize, message: errorUtil.toString(message) }
3562
3562
  });
@@ -3577,7 +3577,7 @@ var init_lib = __esm({
3577
3577
  ...processCreateParams(params)
3578
3578
  });
3579
3579
  };
3580
- ZodFunction = class extends ZodType {
3580
+ ZodFunction = class _ZodFunction extends ZodType {
3581
3581
  constructor() {
3582
3582
  super(...arguments);
3583
3583
  this.validate = this.implement;
@@ -3662,13 +3662,13 @@ var init_lib = __esm({
3662
3662
  return this._def.returns;
3663
3663
  }
3664
3664
  args(...items) {
3665
- return new ZodFunction({
3665
+ return new _ZodFunction({
3666
3666
  ...this._def,
3667
3667
  args: ZodTuple.create(items).rest(ZodUnknown.create())
3668
3668
  });
3669
3669
  }
3670
3670
  returns(returnType) {
3671
- return new ZodFunction({
3671
+ return new _ZodFunction({
3672
3672
  ...this._def,
3673
3673
  returns: returnType
3674
3674
  });
@@ -3682,7 +3682,7 @@ var init_lib = __esm({
3682
3682
  return validatedFunc;
3683
3683
  }
3684
3684
  static create(args, returns, params) {
3685
- return new ZodFunction({
3685
+ return new _ZodFunction({
3686
3686
  args: args ? args : ZodTuple.create([]).rest(ZodUnknown.create()),
3687
3687
  returns: returns || ZodUnknown.create(),
3688
3688
  typeName: ZodFirstPartyTypeKind.ZodFunction,
@@ -4093,7 +4093,7 @@ var init_lib = __esm({
4093
4093
  return this._def.type;
4094
4094
  }
4095
4095
  };
4096
- ZodPipeline = class extends ZodType {
4096
+ ZodPipeline = class _ZodPipeline extends ZodType {
4097
4097
  _parse(input) {
4098
4098
  const { status, ctx } = this._processInputParams(input);
4099
4099
  if (ctx.common.async) {
@@ -4141,7 +4141,7 @@ var init_lib = __esm({
4141
4141
  }
4142
4142
  }
4143
4143
  static create(a, b) {
4144
- return new ZodPipeline({
4144
+ return new _ZodPipeline({
4145
4145
  in: a,
4146
4146
  out: b,
4147
4147
  typeName: ZodFirstPartyTypeKind.ZodPipeline
@@ -13594,7 +13594,7 @@ var isPgNativeType = (it) => {
13594
13594
  if (pgNativeTypes.has(it))
13595
13595
  return true;
13596
13596
  const toCheck = it.replace(/ /g, "");
13597
- return toCheck.startsWith("varchar(") || toCheck.startsWith("char(") || toCheck.startsWith("numeric(") || toCheck.startsWith("timestamp(");
13597
+ 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);
13598
13598
  };
13599
13599
  var Convertor = class {
13600
13600
  };