drizzle-kit 0.25.0-a5a41e0 → 0.25.0-a88d6b6

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.
@@ -0,0 +1,8 @@
1
+ declare const prefixes: readonly ["index", "timestamp", "supabase", "unix", "none"];
2
+ type Prefix = (typeof prefixes)[number];
3
+ declare const casingTypes: readonly ["snake_case", "camelCase"];
4
+ type CasingType = (typeof casingTypes)[number];
5
+ declare const drivers: readonly ["d1-http", "expo", "aws-data-api", "pglite"];
6
+ type Driver = (typeof drivers)[number];
7
+
8
+ export type { CasingType as C, Driver as D, Prefix as P };
@@ -0,0 +1,8 @@
1
+ declare const prefixes: readonly ["index", "timestamp", "supabase", "unix", "none"];
2
+ type Prefix = (typeof prefixes)[number];
3
+ declare const casingTypes: readonly ["snake_case", "camelCase"];
4
+ type CasingType = (typeof casingTypes)[number];
5
+ declare const drivers: readonly ["d1-http", "expo", "aws-data-api", "pglite"];
6
+ type Driver = (typeof drivers)[number];
7
+
8
+ export type { CasingType as C, Driver as D, Prefix as P };
package/index.d.mts CHANGED
@@ -1,9 +1,5 @@
1
1
  import { ConnectionOptions } from 'tls';
2
-
3
- declare const prefixes: readonly ["index", "timestamp", "supabase", "unix", "none"];
4
- type Prefix = (typeof prefixes)[number];
5
- declare const drivers: readonly ["d1-http", "expo", "aws-data-api", "pglite"];
6
- type Driver = (typeof drivers)[number];
2
+ import { P as Prefix, D as Driver } from './common-DYjgLS6u.mjs';
7
3
 
8
4
  declare const dialects: readonly ["postgresql", "mysql", "sqlite", "turso"];
9
5
  type Dialect = (typeof dialects)[number];
@@ -119,6 +115,7 @@ type Config = {
119
115
  schema?: string | string[];
120
116
  verbose?: boolean;
121
117
  strict?: boolean;
118
+ casing?: 'camelCase' | 'snake_case';
122
119
  migrations?: {
123
120
  table?: string;
124
121
  schema?: string;
package/index.d.ts CHANGED
@@ -1,9 +1,5 @@
1
1
  import { ConnectionOptions } from 'tls';
2
-
3
- declare const prefixes: readonly ["index", "timestamp", "supabase", "unix", "none"];
4
- type Prefix = (typeof prefixes)[number];
5
- declare const drivers: readonly ["d1-http", "expo", "aws-data-api", "pglite"];
6
- type Driver = (typeof drivers)[number];
2
+ import { P as Prefix, D as Driver } from './common-DYjgLS6u.js';
7
3
 
8
4
  declare const dialects: readonly ["postgresql", "mysql", "sqlite", "turso"];
9
5
  type Dialect = (typeof dialects)[number];
@@ -119,6 +115,7 @@ type Config = {
119
115
  schema?: string | string[];
120
116
  verbose?: boolean;
121
117
  strict?: boolean;
118
+ casing?: 'camelCase' | 'snake_case';
122
119
  migrations?: {
123
120
  table?: string;
124
121
  schema?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.25.0-a5a41e0",
3
+ "version": "0.25.0-a88d6b6",
4
4
  "homepage": "https://orm.drizzle.team",
5
5
  "keywords": [
6
6
  "drizzle",
@@ -80,7 +80,7 @@
80
80
  "commander": "^12.1.0",
81
81
  "dockerode": "^3.3.4",
82
82
  "dotenv": "^16.0.3",
83
- "drizzle-kit": "0.21.2",
83
+ "drizzle-kit": "0.25.0-b1faa33",
84
84
  "drizzle-orm": "workspace:./drizzle-orm/dist",
85
85
  "env-paths": "^3.0.0",
86
86
  "esbuild-node-externals": "^1.9.0",
package/utils.js CHANGED
@@ -409,8 +409,8 @@ var require_hanji = __commonJS({
409
409
  };
410
410
  exports2.deferred = deferred;
411
411
  var Terminal = class {
412
- constructor(view2, stdin, stdout, closable) {
413
- this.view = view2;
412
+ constructor(view4, stdin, stdout, closable) {
413
+ this.view = view4;
414
414
  this.stdin = stdin;
415
415
  this.stdout = stdout;
416
416
  this.closable = closable;
@@ -448,7 +448,7 @@ var require_hanji = __commonJS({
448
448
  this.resolve({ status: "submitted", data: this.view.result() });
449
449
  return;
450
450
  }
451
- view2.input(str, key);
451
+ view4.input(str, key);
452
452
  };
453
453
  this.stdin.on("keypress", keypress);
454
454
  this.view.attach(this);
@@ -510,8 +510,8 @@ var require_hanji = __commonJS({
510
510
  };
511
511
  exports2.TaskView = TaskView2;
512
512
  var TaskTerminal = class {
513
- constructor(view2, stdout) {
514
- this.view = view2;
513
+ constructor(view4, stdout) {
514
+ this.view = view4;
515
515
  this.stdout = stdout;
516
516
  this.text = "";
517
517
  this.view.attach(this);
@@ -530,22 +530,22 @@ var require_hanji = __commonJS({
530
530
  }
531
531
  };
532
532
  exports2.TaskTerminal = TaskTerminal;
533
- function render2(view2) {
533
+ function render2(view4) {
534
534
  const { stdin, stdout, closable } = (0, readline_1.prepareReadLine)();
535
- if (view2 instanceof Prompt2) {
536
- const terminal = new Terminal(view2, stdin, stdout, closable);
535
+ if (view4 instanceof Prompt2) {
536
+ const terminal = new Terminal(view4, stdin, stdout, closable);
537
537
  terminal.requestLayout();
538
538
  return terminal.result();
539
539
  }
540
- stdout.write(`${view2}
540
+ stdout.write(`${view4}
541
541
  `);
542
542
  closable.close();
543
543
  return;
544
544
  }
545
545
  exports2.render = render2;
546
- function renderWithTask(view2, task) {
546
+ function renderWithTask(view4, task) {
547
547
  return __awaiter(this, void 0, void 0, function* () {
548
- const terminal = new TaskTerminal(view2, process.stdout);
548
+ const terminal = new TaskTerminal(view4, process.stdout);
549
549
  terminal.requestLayout();
550
550
  const result = yield task;
551
551
  terminal.clear();
@@ -569,6 +569,7 @@ __export(utils_exports, {
569
569
  copy: () => copy,
570
570
  dryJournal: () => dryJournal,
571
571
  findAddedAndRemoved: () => findAddedAndRemoved,
572
+ getColumnCasing: () => getColumnCasing,
572
573
  isPgArrayType: () => isPgArrayType,
573
574
  kloudMeta: () => kloudMeta,
574
575
  normalisePGliteUrl: () => normalisePGliteUrl,
@@ -1073,6 +1074,7 @@ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
1073
1074
  var source_default = chalk;
1074
1075
 
1075
1076
  // src/utils.ts
1077
+ var import_casing = require("drizzle-orm/casing");
1076
1078
  var import_fs = require("fs");
1077
1079
  var import_path = require("path");
1078
1080
  var import_url = require("url");
@@ -4901,6 +4903,10 @@ var uniqueConstraint = objectType({
4901
4903
  name: stringType(),
4902
4904
  columns: stringType().array()
4903
4905
  }).strict();
4906
+ var checkConstraint = objectType({
4907
+ name: stringType(),
4908
+ value: stringType()
4909
+ }).strict();
4904
4910
  var tableV4 = objectType({
4905
4911
  name: stringType(),
4906
4912
  schema: stringType().optional(),
@@ -4914,8 +4920,20 @@ var table = objectType({
4914
4920
  indexes: recordType(stringType(), index),
4915
4921
  foreignKeys: recordType(stringType(), fk),
4916
4922
  compositePrimaryKeys: recordType(stringType(), compositePK),
4917
- uniqueConstraints: recordType(stringType(), uniqueConstraint).default({})
4923
+ uniqueConstraints: recordType(stringType(), uniqueConstraint).default({}),
4924
+ checkConstraint: recordType(stringType(), checkConstraint).default({})
4925
+ }).strict();
4926
+ var viewMeta = objectType({
4927
+ algorithm: enumType(["undefined", "merge", "temptable"]),
4928
+ sqlSecurity: enumType(["definer", "invoker"]),
4929
+ withCheckOption: enumType(["local", "cascaded"]).optional()
4918
4930
  }).strict();
4931
+ var view = objectType({
4932
+ name: stringType(),
4933
+ columns: recordType(stringType(), column),
4934
+ definition: stringType().optional(),
4935
+ isExisting: booleanType()
4936
+ }).strict().merge(viewMeta);
4919
4937
  var kitInternals = objectType({
4920
4938
  tables: recordType(
4921
4939
  stringType(),
@@ -4968,6 +4986,7 @@ var schemaInternal = objectType({
4968
4986
  version: literalType("5"),
4969
4987
  dialect,
4970
4988
  tables: recordType(stringType(), table),
4989
+ views: recordType(stringType(), view),
4971
4990
  _meta: objectType({
4972
4991
  tables: recordType(stringType(), stringType()),
4973
4992
  columns: recordType(stringType(), stringType())
@@ -4991,12 +5010,19 @@ var tableSquashed = objectType({
4991
5010
  indexes: recordType(stringType(), stringType()),
4992
5011
  foreignKeys: recordType(stringType(), stringType()),
4993
5012
  compositePrimaryKeys: recordType(stringType(), stringType()),
4994
- uniqueConstraints: recordType(stringType(), stringType()).default({})
5013
+ uniqueConstraints: recordType(stringType(), stringType()).default({}),
5014
+ checkConstraints: recordType(stringType(), stringType()).default({})
4995
5015
  }).strict();
5016
+ var viewSquashed = view.omit({
5017
+ algorithm: true,
5018
+ sqlSecurity: true,
5019
+ withCheckOption: true
5020
+ }).extend({ meta: stringType() });
4996
5021
  var schemaSquashed = objectType({
4997
5022
  version: literalType("5"),
4998
5023
  dialect,
4999
- tables: recordType(stringType(), tableSquashed)
5024
+ tables: recordType(stringType(), tableSquashed),
5025
+ views: recordType(stringType(), viewSquashed)
5000
5026
  }).strict();
5001
5027
  var schemaSquashedV4 = objectType({
5002
5028
  version: literalType("4"),
@@ -5014,6 +5040,7 @@ var dryMySql = mysqlSchema.parse({
5014
5040
  prevId: "",
5015
5041
  tables: {},
5016
5042
  schemas: {},
5043
+ views: {},
5017
5044
  _meta: {
5018
5045
  schemas: {},
5019
5046
  tables: {},
@@ -5179,6 +5206,10 @@ var column2 = objectType({
5179
5206
  }).optional(),
5180
5207
  identity: sequenceSchema.merge(objectType({ type: enumType(["always", "byDefault"]) })).optional()
5181
5208
  }).strict();
5209
+ var checkConstraint2 = objectType({
5210
+ name: stringType(),
5211
+ value: stringType()
5212
+ }).strict();
5182
5213
  var columnSquashed = objectType({
5183
5214
  name: stringType(),
5184
5215
  type: stringType(),
@@ -5235,8 +5266,8 @@ var matViewWithOption = objectType({
5235
5266
  logAutovacuumMinDuration: numberType().optional(),
5236
5267
  userCatalogTable: booleanType().optional()
5237
5268
  }).strict();
5238
- var mergedViewWithOption = viewWithOption.merge(matViewWithOption);
5239
- var view = objectType({
5269
+ var mergedViewWithOption = viewWithOption.merge(matViewWithOption).strict();
5270
+ var view2 = objectType({
5240
5271
  name: stringType(),
5241
5272
  schema: stringType(),
5242
5273
  columns: recordType(stringType(), column2),
@@ -5289,7 +5320,8 @@ var table2 = objectType({
5289
5320
  indexes: recordType(stringType(), index2),
5290
5321
  foreignKeys: recordType(stringType(), fk2),
5291
5322
  compositePrimaryKeys: recordType(stringType(), compositePK2),
5292
- uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
5323
+ uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({}),
5324
+ checkConstraints: recordType(stringType(), checkConstraint2).default({})
5293
5325
  }).strict();
5294
5326
  var schemaHash2 = objectType({
5295
5327
  id: stringType(),
@@ -5382,7 +5414,7 @@ var pgSchemaInternal = objectType({
5382
5414
  tables: recordType(stringType(), table2),
5383
5415
  enums: recordType(stringType(), enumSchema),
5384
5416
  schemas: recordType(stringType(), stringType()),
5385
- views: recordType(stringType(), view).default({}),
5417
+ views: recordType(stringType(), view2).default({}),
5386
5418
  sequences: recordType(stringType(), sequenceSchema).default({}),
5387
5419
  _meta: objectType({
5388
5420
  schemas: recordType(stringType(), stringType()),
@@ -5398,7 +5430,8 @@ var tableSquashed2 = objectType({
5398
5430
  indexes: recordType(stringType(), stringType()),
5399
5431
  foreignKeys: recordType(stringType(), stringType()),
5400
5432
  compositePrimaryKeys: recordType(stringType(), stringType()),
5401
- uniqueConstraints: recordType(stringType(), stringType())
5433
+ uniqueConstraints: recordType(stringType(), stringType()),
5434
+ checkConstraints: recordType(stringType(), stringType())
5402
5435
  }).strict();
5403
5436
  var tableSquashedV42 = objectType({
5404
5437
  name: stringType(),
@@ -5427,7 +5460,7 @@ var pgSchemaSquashed = objectType({
5427
5460
  tables: recordType(stringType(), tableSquashed2),
5428
5461
  enums: recordType(stringType(), enumSchema),
5429
5462
  schemas: recordType(stringType(), stringType()),
5430
- views: recordType(stringType(), view),
5463
+ views: recordType(stringType(), view2),
5431
5464
  sequences: recordType(stringType(), sequenceSquashed)
5432
5465
  }).strict();
5433
5466
  var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
@@ -5499,13 +5532,24 @@ var uniqueConstraint3 = objectType({
5499
5532
  name: stringType(),
5500
5533
  columns: stringType().array()
5501
5534
  }).strict();
5535
+ var checkConstraint3 = objectType({
5536
+ name: stringType(),
5537
+ value: stringType()
5538
+ }).strict();
5502
5539
  var table3 = objectType({
5503
5540
  name: stringType(),
5504
5541
  columns: recordType(stringType(), column3),
5505
5542
  indexes: recordType(stringType(), index3),
5506
5543
  foreignKeys: recordType(stringType(), fk3),
5507
5544
  compositePrimaryKeys: recordType(stringType(), compositePK3),
5508
- uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({})
5545
+ uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({}),
5546
+ checkConstraints: recordType(stringType(), checkConstraint3).default({})
5547
+ }).strict();
5548
+ var view3 = objectType({
5549
+ name: stringType(),
5550
+ columns: recordType(stringType(), column3),
5551
+ definition: stringType().optional(),
5552
+ isExisting: booleanType()
5509
5553
  }).strict();
5510
5554
  var dialect2 = enumType(["sqlite"]);
5511
5555
  var schemaHash3 = objectType({
@@ -5522,6 +5566,7 @@ var schemaInternalV42 = objectType({
5522
5566
  version: literalType("4"),
5523
5567
  dialect: dialect2,
5524
5568
  tables: recordType(stringType(), table3),
5569
+ views: recordType(stringType(), view3),
5525
5570
  enums: objectType({})
5526
5571
  }).strict();
5527
5572
  var schemaInternalV52 = objectType({
@@ -5550,6 +5595,7 @@ var schemaInternal2 = objectType({
5550
5595
  version: latestVersion,
5551
5596
  dialect: dialect2,
5552
5597
  tables: recordType(stringType(), table3),
5598
+ views: recordType(stringType(), view3),
5553
5599
  enums: objectType({}),
5554
5600
  _meta: objectType({
5555
5601
  tables: recordType(stringType(), stringType()),
@@ -5567,12 +5613,14 @@ var tableSquashed3 = objectType({
5567
5613
  indexes: recordType(stringType(), stringType()),
5568
5614
  foreignKeys: recordType(stringType(), stringType()),
5569
5615
  compositePrimaryKeys: recordType(stringType(), stringType()),
5570
- uniqueConstraints: recordType(stringType(), stringType()).default({})
5616
+ uniqueConstraints: recordType(stringType(), stringType()).default({}),
5617
+ checkConstraints: recordType(stringType(), stringType()).default({})
5571
5618
  }).strict();
5572
5619
  var schemaSquashed2 = objectType({
5573
5620
  version: latestVersion,
5574
5621
  dialect: dialect2,
5575
5622
  tables: recordType(stringType(), tableSquashed3),
5623
+ views: recordType(stringType(), view3),
5576
5624
  enums: anyType()
5577
5625
  }).strict();
5578
5626
  var drySQLite = schema2.parse({
@@ -5581,6 +5629,7 @@ var drySQLite = schema2.parse({
5581
5629
  id: originUUID,
5582
5630
  prevId: "",
5583
5631
  tables: {},
5632
+ views: {},
5584
5633
  enums: {},
5585
5634
  _meta: {
5586
5635
  tables: {},
@@ -5800,6 +5849,11 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
5800
5849
  const removedColumns = columnNames1.filter((it) => !set2.has(it));
5801
5850
  return { addedColumns, removedColumns };
5802
5851
  }
5852
+ function getColumnCasing(column4, casing) {
5853
+ if (!column4.name)
5854
+ return "";
5855
+ return !column4.keyAsName || casing === void 0 ? column4.name : casing === "camelCase" ? (0, import_casing.toCamelCase)(column4.name) : (0, import_casing.toSnakeCase)(column4.name);
5856
+ }
5803
5857
  // Annotate the CommonJS export names for ESM import in node:
5804
5858
  0 && (module.exports = {
5805
5859
  assertV1OutFolder,
@@ -5807,6 +5861,7 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
5807
5861
  copy,
5808
5862
  dryJournal,
5809
5863
  findAddedAndRemoved,
5864
+ getColumnCasing,
5810
5865
  isPgArrayType,
5811
5866
  kloudMeta,
5812
5867
  normalisePGliteUrl,
package/utils.mjs CHANGED
@@ -410,8 +410,8 @@ var require_hanji = __commonJS({
410
410
  };
411
411
  exports.deferred = deferred;
412
412
  var Terminal = class {
413
- constructor(view2, stdin, stdout, closable) {
414
- this.view = view2;
413
+ constructor(view4, stdin, stdout, closable) {
414
+ this.view = view4;
415
415
  this.stdin = stdin;
416
416
  this.stdout = stdout;
417
417
  this.closable = closable;
@@ -449,7 +449,7 @@ var require_hanji = __commonJS({
449
449
  this.resolve({ status: "submitted", data: this.view.result() });
450
450
  return;
451
451
  }
452
- view2.input(str, key);
452
+ view4.input(str, key);
453
453
  };
454
454
  this.stdin.on("keypress", keypress);
455
455
  this.view.attach(this);
@@ -511,8 +511,8 @@ var require_hanji = __commonJS({
511
511
  };
512
512
  exports.TaskView = TaskView2;
513
513
  var TaskTerminal = class {
514
- constructor(view2, stdout) {
515
- this.view = view2;
514
+ constructor(view4, stdout) {
515
+ this.view = view4;
516
516
  this.stdout = stdout;
517
517
  this.text = "";
518
518
  this.view.attach(this);
@@ -531,22 +531,22 @@ var require_hanji = __commonJS({
531
531
  }
532
532
  };
533
533
  exports.TaskTerminal = TaskTerminal;
534
- function render2(view2) {
534
+ function render2(view4) {
535
535
  const { stdin, stdout, closable } = (0, readline_1.prepareReadLine)();
536
- if (view2 instanceof Prompt2) {
537
- const terminal = new Terminal(view2, stdin, stdout, closable);
536
+ if (view4 instanceof Prompt2) {
537
+ const terminal = new Terminal(view4, stdin, stdout, closable);
538
538
  terminal.requestLayout();
539
539
  return terminal.result();
540
540
  }
541
- stdout.write(`${view2}
541
+ stdout.write(`${view4}
542
542
  `);
543
543
  closable.close();
544
544
  return;
545
545
  }
546
546
  exports.render = render2;
547
- function renderWithTask(view2, task) {
547
+ function renderWithTask(view4, task) {
548
548
  return __awaiter(this, void 0, void 0, function* () {
549
- const terminal = new TaskTerminal(view2, process.stdout);
549
+ const terminal = new TaskTerminal(view4, process.stdout);
550
550
  terminal.requestLayout();
551
551
  const result = yield task;
552
552
  terminal.clear();
@@ -1052,6 +1052,7 @@ var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
1052
1052
  var source_default = chalk;
1053
1053
 
1054
1054
  // src/utils.ts
1055
+ import { toCamelCase, toSnakeCase } from "drizzle-orm/casing";
1055
1056
  import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from "fs";
1056
1057
  import { join } from "path";
1057
1058
  import { parse } from "url";
@@ -4880,6 +4881,10 @@ var uniqueConstraint = objectType({
4880
4881
  name: stringType(),
4881
4882
  columns: stringType().array()
4882
4883
  }).strict();
4884
+ var checkConstraint = objectType({
4885
+ name: stringType(),
4886
+ value: stringType()
4887
+ }).strict();
4883
4888
  var tableV4 = objectType({
4884
4889
  name: stringType(),
4885
4890
  schema: stringType().optional(),
@@ -4893,8 +4898,20 @@ var table = objectType({
4893
4898
  indexes: recordType(stringType(), index),
4894
4899
  foreignKeys: recordType(stringType(), fk),
4895
4900
  compositePrimaryKeys: recordType(stringType(), compositePK),
4896
- uniqueConstraints: recordType(stringType(), uniqueConstraint).default({})
4901
+ uniqueConstraints: recordType(stringType(), uniqueConstraint).default({}),
4902
+ checkConstraint: recordType(stringType(), checkConstraint).default({})
4903
+ }).strict();
4904
+ var viewMeta = objectType({
4905
+ algorithm: enumType(["undefined", "merge", "temptable"]),
4906
+ sqlSecurity: enumType(["definer", "invoker"]),
4907
+ withCheckOption: enumType(["local", "cascaded"]).optional()
4897
4908
  }).strict();
4909
+ var view = objectType({
4910
+ name: stringType(),
4911
+ columns: recordType(stringType(), column),
4912
+ definition: stringType().optional(),
4913
+ isExisting: booleanType()
4914
+ }).strict().merge(viewMeta);
4898
4915
  var kitInternals = objectType({
4899
4916
  tables: recordType(
4900
4917
  stringType(),
@@ -4947,6 +4964,7 @@ var schemaInternal = objectType({
4947
4964
  version: literalType("5"),
4948
4965
  dialect,
4949
4966
  tables: recordType(stringType(), table),
4967
+ views: recordType(stringType(), view),
4950
4968
  _meta: objectType({
4951
4969
  tables: recordType(stringType(), stringType()),
4952
4970
  columns: recordType(stringType(), stringType())
@@ -4970,12 +4988,19 @@ var tableSquashed = objectType({
4970
4988
  indexes: recordType(stringType(), stringType()),
4971
4989
  foreignKeys: recordType(stringType(), stringType()),
4972
4990
  compositePrimaryKeys: recordType(stringType(), stringType()),
4973
- uniqueConstraints: recordType(stringType(), stringType()).default({})
4991
+ uniqueConstraints: recordType(stringType(), stringType()).default({}),
4992
+ checkConstraints: recordType(stringType(), stringType()).default({})
4974
4993
  }).strict();
4994
+ var viewSquashed = view.omit({
4995
+ algorithm: true,
4996
+ sqlSecurity: true,
4997
+ withCheckOption: true
4998
+ }).extend({ meta: stringType() });
4975
4999
  var schemaSquashed = objectType({
4976
5000
  version: literalType("5"),
4977
5001
  dialect,
4978
- tables: recordType(stringType(), tableSquashed)
5002
+ tables: recordType(stringType(), tableSquashed),
5003
+ views: recordType(stringType(), viewSquashed)
4979
5004
  }).strict();
4980
5005
  var schemaSquashedV4 = objectType({
4981
5006
  version: literalType("4"),
@@ -4993,6 +5018,7 @@ var dryMySql = mysqlSchema.parse({
4993
5018
  prevId: "",
4994
5019
  tables: {},
4995
5020
  schemas: {},
5021
+ views: {},
4996
5022
  _meta: {
4997
5023
  schemas: {},
4998
5024
  tables: {},
@@ -5158,6 +5184,10 @@ var column2 = objectType({
5158
5184
  }).optional(),
5159
5185
  identity: sequenceSchema.merge(objectType({ type: enumType(["always", "byDefault"]) })).optional()
5160
5186
  }).strict();
5187
+ var checkConstraint2 = objectType({
5188
+ name: stringType(),
5189
+ value: stringType()
5190
+ }).strict();
5161
5191
  var columnSquashed = objectType({
5162
5192
  name: stringType(),
5163
5193
  type: stringType(),
@@ -5214,8 +5244,8 @@ var matViewWithOption = objectType({
5214
5244
  logAutovacuumMinDuration: numberType().optional(),
5215
5245
  userCatalogTable: booleanType().optional()
5216
5246
  }).strict();
5217
- var mergedViewWithOption = viewWithOption.merge(matViewWithOption);
5218
- var view = objectType({
5247
+ var mergedViewWithOption = viewWithOption.merge(matViewWithOption).strict();
5248
+ var view2 = objectType({
5219
5249
  name: stringType(),
5220
5250
  schema: stringType(),
5221
5251
  columns: recordType(stringType(), column2),
@@ -5268,7 +5298,8 @@ var table2 = objectType({
5268
5298
  indexes: recordType(stringType(), index2),
5269
5299
  foreignKeys: recordType(stringType(), fk2),
5270
5300
  compositePrimaryKeys: recordType(stringType(), compositePK2),
5271
- uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
5301
+ uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({}),
5302
+ checkConstraints: recordType(stringType(), checkConstraint2).default({})
5272
5303
  }).strict();
5273
5304
  var schemaHash2 = objectType({
5274
5305
  id: stringType(),
@@ -5361,7 +5392,7 @@ var pgSchemaInternal = objectType({
5361
5392
  tables: recordType(stringType(), table2),
5362
5393
  enums: recordType(stringType(), enumSchema),
5363
5394
  schemas: recordType(stringType(), stringType()),
5364
- views: recordType(stringType(), view).default({}),
5395
+ views: recordType(stringType(), view2).default({}),
5365
5396
  sequences: recordType(stringType(), sequenceSchema).default({}),
5366
5397
  _meta: objectType({
5367
5398
  schemas: recordType(stringType(), stringType()),
@@ -5377,7 +5408,8 @@ var tableSquashed2 = objectType({
5377
5408
  indexes: recordType(stringType(), stringType()),
5378
5409
  foreignKeys: recordType(stringType(), stringType()),
5379
5410
  compositePrimaryKeys: recordType(stringType(), stringType()),
5380
- uniqueConstraints: recordType(stringType(), stringType())
5411
+ uniqueConstraints: recordType(stringType(), stringType()),
5412
+ checkConstraints: recordType(stringType(), stringType())
5381
5413
  }).strict();
5382
5414
  var tableSquashedV42 = objectType({
5383
5415
  name: stringType(),
@@ -5406,7 +5438,7 @@ var pgSchemaSquashed = objectType({
5406
5438
  tables: recordType(stringType(), tableSquashed2),
5407
5439
  enums: recordType(stringType(), enumSchema),
5408
5440
  schemas: recordType(stringType(), stringType()),
5409
- views: recordType(stringType(), view),
5441
+ views: recordType(stringType(), view2),
5410
5442
  sequences: recordType(stringType(), sequenceSquashed)
5411
5443
  }).strict();
5412
5444
  var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
@@ -5478,13 +5510,24 @@ var uniqueConstraint3 = objectType({
5478
5510
  name: stringType(),
5479
5511
  columns: stringType().array()
5480
5512
  }).strict();
5513
+ var checkConstraint3 = objectType({
5514
+ name: stringType(),
5515
+ value: stringType()
5516
+ }).strict();
5481
5517
  var table3 = objectType({
5482
5518
  name: stringType(),
5483
5519
  columns: recordType(stringType(), column3),
5484
5520
  indexes: recordType(stringType(), index3),
5485
5521
  foreignKeys: recordType(stringType(), fk3),
5486
5522
  compositePrimaryKeys: recordType(stringType(), compositePK3),
5487
- uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({})
5523
+ uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({}),
5524
+ checkConstraints: recordType(stringType(), checkConstraint3).default({})
5525
+ }).strict();
5526
+ var view3 = objectType({
5527
+ name: stringType(),
5528
+ columns: recordType(stringType(), column3),
5529
+ definition: stringType().optional(),
5530
+ isExisting: booleanType()
5488
5531
  }).strict();
5489
5532
  var dialect2 = enumType(["sqlite"]);
5490
5533
  var schemaHash3 = objectType({
@@ -5501,6 +5544,7 @@ var schemaInternalV42 = objectType({
5501
5544
  version: literalType("4"),
5502
5545
  dialect: dialect2,
5503
5546
  tables: recordType(stringType(), table3),
5547
+ views: recordType(stringType(), view3),
5504
5548
  enums: objectType({})
5505
5549
  }).strict();
5506
5550
  var schemaInternalV52 = objectType({
@@ -5529,6 +5573,7 @@ var schemaInternal2 = objectType({
5529
5573
  version: latestVersion,
5530
5574
  dialect: dialect2,
5531
5575
  tables: recordType(stringType(), table3),
5576
+ views: recordType(stringType(), view3),
5532
5577
  enums: objectType({}),
5533
5578
  _meta: objectType({
5534
5579
  tables: recordType(stringType(), stringType()),
@@ -5546,12 +5591,14 @@ var tableSquashed3 = objectType({
5546
5591
  indexes: recordType(stringType(), stringType()),
5547
5592
  foreignKeys: recordType(stringType(), stringType()),
5548
5593
  compositePrimaryKeys: recordType(stringType(), stringType()),
5549
- uniqueConstraints: recordType(stringType(), stringType()).default({})
5594
+ uniqueConstraints: recordType(stringType(), stringType()).default({}),
5595
+ checkConstraints: recordType(stringType(), stringType()).default({})
5550
5596
  }).strict();
5551
5597
  var schemaSquashed2 = objectType({
5552
5598
  version: latestVersion,
5553
5599
  dialect: dialect2,
5554
5600
  tables: recordType(stringType(), tableSquashed3),
5601
+ views: recordType(stringType(), view3),
5555
5602
  enums: anyType()
5556
5603
  }).strict();
5557
5604
  var drySQLite = schema2.parse({
@@ -5560,6 +5607,7 @@ var drySQLite = schema2.parse({
5560
5607
  id: originUUID,
5561
5608
  prevId: "",
5562
5609
  tables: {},
5610
+ views: {},
5563
5611
  enums: {},
5564
5612
  _meta: {
5565
5613
  tables: {},
@@ -5779,12 +5827,18 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
5779
5827
  const removedColumns = columnNames1.filter((it) => !set2.has(it));
5780
5828
  return { addedColumns, removedColumns };
5781
5829
  }
5830
+ function getColumnCasing(column4, casing) {
5831
+ if (!column4.name)
5832
+ return "";
5833
+ return !column4.keyAsName || casing === void 0 ? column4.name : casing === "camelCase" ? toCamelCase(column4.name) : toSnakeCase(column4.name);
5834
+ }
5782
5835
  export {
5783
5836
  assertV1OutFolder,
5784
5837
  columnRenameKey,
5785
5838
  copy,
5786
5839
  dryJournal,
5787
5840
  findAddedAndRemoved,
5841
+ getColumnCasing,
5788
5842
  isPgArrayType,
5789
5843
  kloudMeta,
5790
5844
  normalisePGliteUrl,