drizzle-kit 0.25.0-a5ec472 → 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.
Files changed (10) hide show
  1. package/api.d.mts +785 -80
  2. package/api.d.ts +785 -80
  3. package/api.js +2992 -1742
  4. package/api.mjs +2992 -1742
  5. package/bin.cjs +2694 -1381
  6. package/index.d.mts +0 -7
  7. package/index.d.ts +0 -7
  8. package/package.json +2 -2
  9. package/utils.js +101 -32
  10. package/utils.mjs +101 -32
package/index.d.mts CHANGED
@@ -124,13 +124,6 @@ type Config = {
124
124
  introspect?: {
125
125
  casing: 'camel' | 'preserve';
126
126
  };
127
- entities?: {
128
- roles?: boolean | {
129
- provider?: string;
130
- exclude?: string[];
131
- include?: string[];
132
- }[];
133
- };
134
127
  } & ({
135
128
  dialect: Verify<Dialect, 'turso'>;
136
129
  dbCredentials: {
package/index.d.ts CHANGED
@@ -124,13 +124,6 @@ type Config = {
124
124
  introspect?: {
125
125
  casing: 'camel' | 'preserve';
126
126
  };
127
- entities?: {
128
- roles?: boolean | {
129
- provider?: string;
130
- exclude?: string[];
131
- include?: string[];
132
- }[];
133
- };
134
127
  } & ({
135
128
  dialect: Verify<Dialect, 'turso'>;
136
129
  dbCredentials: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.25.0-a5ec472",
3
+ "version": "0.25.0-a88d6b6",
4
4
  "homepage": "https://orm.drizzle.team",
5
5
  "keywords": [
6
6
  "drizzle",
@@ -51,7 +51,7 @@
51
51
  "@arethetypeswrong/cli": "^0.15.3",
52
52
  "@aws-sdk/client-rds-data": "^3.556.0",
53
53
  "@cloudflare/workers-types": "^4.20230518.0",
54
- "@electric-sql/pglite": "^0.2.5",
54
+ "@electric-sql/pglite": "^0.1.5",
55
55
  "@hono/node-server": "^1.9.0",
56
56
  "@hono/zod-validator": "^0.2.1",
57
57
  "@libsql/client": "^0.10.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(view, stdin, stdout, closable) {
413
- this.view = view;
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
- view.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(view, stdout) {
514
- this.view = view;
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(view) {
533
+ function render2(view4) {
534
534
  const { stdin, stdout, closable } = (0, readline_1.prepareReadLine)();
535
- if (view instanceof Prompt2) {
536
- const terminal = new Terminal(view, 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(`${view}
540
+ stdout.write(`${view4}
541
541
  `);
542
542
  closable.close();
543
543
  return;
544
544
  }
545
545
  exports2.render = render2;
546
- function renderWithTask(view, task) {
546
+ function renderWithTask(view4, task) {
547
547
  return __awaiter(this, void 0, void 0, function* () {
548
- const terminal = new TaskTerminal(view, process.stdout);
548
+ const terminal = new TaskTerminal(view4, process.stdout);
549
549
  terminal.requestLayout();
550
550
  const result = yield task;
551
551
  terminal.clear();
@@ -4903,6 +4903,10 @@ var uniqueConstraint = objectType({
4903
4903
  name: stringType(),
4904
4904
  columns: stringType().array()
4905
4905
  }).strict();
4906
+ var checkConstraint = objectType({
4907
+ name: stringType(),
4908
+ value: stringType()
4909
+ }).strict();
4906
4910
  var tableV4 = objectType({
4907
4911
  name: stringType(),
4908
4912
  schema: stringType().optional(),
@@ -4916,8 +4920,20 @@ var table = objectType({
4916
4920
  indexes: recordType(stringType(), index),
4917
4921
  foreignKeys: recordType(stringType(), fk),
4918
4922
  compositePrimaryKeys: recordType(stringType(), compositePK),
4919
- 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()
4920
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);
4921
4937
  var kitInternals = objectType({
4922
4938
  tables: recordType(
4923
4939
  stringType(),
@@ -4970,6 +4986,7 @@ var schemaInternal = objectType({
4970
4986
  version: literalType("5"),
4971
4987
  dialect,
4972
4988
  tables: recordType(stringType(), table),
4989
+ views: recordType(stringType(), view),
4973
4990
  _meta: objectType({
4974
4991
  tables: recordType(stringType(), stringType()),
4975
4992
  columns: recordType(stringType(), stringType())
@@ -4993,12 +5010,19 @@ var tableSquashed = objectType({
4993
5010
  indexes: recordType(stringType(), stringType()),
4994
5011
  foreignKeys: recordType(stringType(), stringType()),
4995
5012
  compositePrimaryKeys: recordType(stringType(), stringType()),
4996
- uniqueConstraints: recordType(stringType(), stringType()).default({})
5013
+ uniqueConstraints: recordType(stringType(), stringType()).default({}),
5014
+ checkConstraints: recordType(stringType(), stringType()).default({})
4997
5015
  }).strict();
5016
+ var viewSquashed = view.omit({
5017
+ algorithm: true,
5018
+ sqlSecurity: true,
5019
+ withCheckOption: true
5020
+ }).extend({ meta: stringType() });
4998
5021
  var schemaSquashed = objectType({
4999
5022
  version: literalType("5"),
5000
5023
  dialect,
5001
- tables: recordType(stringType(), tableSquashed)
5024
+ tables: recordType(stringType(), tableSquashed),
5025
+ views: recordType(stringType(), viewSquashed)
5002
5026
  }).strict();
5003
5027
  var schemaSquashedV4 = objectType({
5004
5028
  version: literalType("4"),
@@ -5016,6 +5040,7 @@ var dryMySql = mysqlSchema.parse({
5016
5040
  prevId: "",
5017
5041
  tables: {},
5018
5042
  schemas: {},
5043
+ views: {},
5019
5044
  _meta: {
5020
5045
  schemas: {},
5021
5046
  tables: {},
@@ -5149,12 +5174,6 @@ var sequenceSchema = objectType({
5149
5174
  cycle: booleanType().optional(),
5150
5175
  schema: stringType()
5151
5176
  }).strict();
5152
- var roleSchema = objectType({
5153
- name: stringType(),
5154
- createDb: booleanType().optional(),
5155
- createRole: booleanType().optional(),
5156
- inherit: booleanType().optional()
5157
- }).strict();
5158
5177
  var sequenceSquashed = objectType({
5159
5178
  name: stringType(),
5160
5179
  schema: stringType(),
@@ -5187,6 +5206,10 @@ var column2 = objectType({
5187
5206
  }).optional(),
5188
5207
  identity: sequenceSchema.merge(objectType({ type: enumType(["always", "byDefault"]) })).optional()
5189
5208
  }).strict();
5209
+ var checkConstraint2 = objectType({
5210
+ name: stringType(),
5211
+ value: stringType()
5212
+ }).strict();
5190
5213
  var columnSquashed = objectType({
5191
5214
  name: stringType(),
5192
5215
  type: stringType(),
@@ -5218,13 +5241,43 @@ var uniqueConstraint2 = objectType({
5218
5241
  columns: stringType().array(),
5219
5242
  nullsNotDistinct: booleanType()
5220
5243
  }).strict();
5221
- var policy = objectType({
5244
+ var viewWithOption = objectType({
5245
+ checkOption: enumType(["local", "cascaded"]).optional(),
5246
+ securityBarrier: booleanType().optional(),
5247
+ securityInvoker: booleanType().optional()
5248
+ }).strict();
5249
+ var matViewWithOption = objectType({
5250
+ fillfactor: numberType().optional(),
5251
+ toastTupleTarget: numberType().optional(),
5252
+ parallelWorkers: numberType().optional(),
5253
+ autovacuumEnabled: booleanType().optional(),
5254
+ vacuumIndexCleanup: enumType(["auto", "off", "on"]).optional(),
5255
+ vacuumTruncate: booleanType().optional(),
5256
+ autovacuumVacuumThreshold: numberType().optional(),
5257
+ autovacuumVacuumScaleFactor: numberType().optional(),
5258
+ autovacuumVacuumCostDelay: numberType().optional(),
5259
+ autovacuumVacuumCostLimit: numberType().optional(),
5260
+ autovacuumFreezeMinAge: numberType().optional(),
5261
+ autovacuumFreezeMaxAge: numberType().optional(),
5262
+ autovacuumFreezeTableAge: numberType().optional(),
5263
+ autovacuumMultixactFreezeMinAge: numberType().optional(),
5264
+ autovacuumMultixactFreezeMaxAge: numberType().optional(),
5265
+ autovacuumMultixactFreezeTableAge: numberType().optional(),
5266
+ logAutovacuumMinDuration: numberType().optional(),
5267
+ userCatalogTable: booleanType().optional()
5268
+ }).strict();
5269
+ var mergedViewWithOption = viewWithOption.merge(matViewWithOption).strict();
5270
+ var view2 = objectType({
5222
5271
  name: stringType(),
5223
- as: enumType(["PERMISSIVE", "RESTRICTIVE"]).optional(),
5224
- for: enumType(["ALL", "SELECT", "INSERT", "UPDATE", "DELETE"]).optional(),
5225
- to: stringType().array().optional(),
5272
+ schema: stringType(),
5273
+ columns: recordType(stringType(), column2),
5274
+ definition: stringType().optional(),
5275
+ materialized: booleanType(),
5276
+ with: mergedViewWithOption.optional(),
5277
+ isExisting: booleanType(),
5278
+ withNoData: booleanType().optional(),
5226
5279
  using: stringType().optional(),
5227
- withCheck: stringType().optional()
5280
+ tablespace: stringType().optional()
5228
5281
  }).strict();
5229
5282
  var tableV42 = objectType({
5230
5283
  name: stringType(),
@@ -5268,7 +5321,7 @@ var table2 = objectType({
5268
5321
  foreignKeys: recordType(stringType(), fk2),
5269
5322
  compositePrimaryKeys: recordType(stringType(), compositePK2),
5270
5323
  uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({}),
5271
- policies: recordType(stringType(), policy).default({})
5324
+ checkConstraints: recordType(stringType(), checkConstraint2).default({})
5272
5325
  }).strict();
5273
5326
  var schemaHash2 = objectType({
5274
5327
  id: stringType(),
@@ -5361,8 +5414,8 @@ var pgSchemaInternal = objectType({
5361
5414
  tables: recordType(stringType(), table2),
5362
5415
  enums: recordType(stringType(), enumSchema),
5363
5416
  schemas: recordType(stringType(), stringType()),
5417
+ views: recordType(stringType(), view2).default({}),
5364
5418
  sequences: recordType(stringType(), sequenceSchema).default({}),
5365
- roles: recordType(stringType(), roleSchema).default({}),
5366
5419
  _meta: objectType({
5367
5420
  schemas: recordType(stringType(), stringType()),
5368
5421
  tables: recordType(stringType(), stringType()),
@@ -5378,7 +5431,7 @@ var tableSquashed2 = objectType({
5378
5431
  foreignKeys: recordType(stringType(), stringType()),
5379
5432
  compositePrimaryKeys: recordType(stringType(), stringType()),
5380
5433
  uniqueConstraints: recordType(stringType(), stringType()),
5381
- policies: recordType(stringType(), stringType())
5434
+ checkConstraints: recordType(stringType(), stringType())
5382
5435
  }).strict();
5383
5436
  var tableSquashedV42 = objectType({
5384
5437
  name: stringType(),
@@ -5407,8 +5460,8 @@ var pgSchemaSquashed = objectType({
5407
5460
  tables: recordType(stringType(), tableSquashed2),
5408
5461
  enums: recordType(stringType(), enumSchema),
5409
5462
  schemas: recordType(stringType(), stringType()),
5410
- sequences: recordType(stringType(), sequenceSquashed),
5411
- roles: recordType(stringType(), roleSchema).default({})
5463
+ views: recordType(stringType(), view2),
5464
+ sequences: recordType(stringType(), sequenceSquashed)
5412
5465
  }).strict();
5413
5466
  var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
5414
5467
  var pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
@@ -5479,13 +5532,24 @@ var uniqueConstraint3 = objectType({
5479
5532
  name: stringType(),
5480
5533
  columns: stringType().array()
5481
5534
  }).strict();
5535
+ var checkConstraint3 = objectType({
5536
+ name: stringType(),
5537
+ value: stringType()
5538
+ }).strict();
5482
5539
  var table3 = objectType({
5483
5540
  name: stringType(),
5484
5541
  columns: recordType(stringType(), column3),
5485
5542
  indexes: recordType(stringType(), index3),
5486
5543
  foreignKeys: recordType(stringType(), fk3),
5487
5544
  compositePrimaryKeys: recordType(stringType(), compositePK3),
5488
- 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()
5489
5553
  }).strict();
5490
5554
  var dialect2 = enumType(["sqlite"]);
5491
5555
  var schemaHash3 = objectType({
@@ -5502,6 +5566,7 @@ var schemaInternalV42 = objectType({
5502
5566
  version: literalType("4"),
5503
5567
  dialect: dialect2,
5504
5568
  tables: recordType(stringType(), table3),
5569
+ views: recordType(stringType(), view3),
5505
5570
  enums: objectType({})
5506
5571
  }).strict();
5507
5572
  var schemaInternalV52 = objectType({
@@ -5530,6 +5595,7 @@ var schemaInternal2 = objectType({
5530
5595
  version: latestVersion,
5531
5596
  dialect: dialect2,
5532
5597
  tables: recordType(stringType(), table3),
5598
+ views: recordType(stringType(), view3),
5533
5599
  enums: objectType({}),
5534
5600
  _meta: objectType({
5535
5601
  tables: recordType(stringType(), stringType()),
@@ -5547,12 +5613,14 @@ var tableSquashed3 = objectType({
5547
5613
  indexes: recordType(stringType(), stringType()),
5548
5614
  foreignKeys: recordType(stringType(), stringType()),
5549
5615
  compositePrimaryKeys: recordType(stringType(), stringType()),
5550
- uniqueConstraints: recordType(stringType(), stringType()).default({})
5616
+ uniqueConstraints: recordType(stringType(), stringType()).default({}),
5617
+ checkConstraints: recordType(stringType(), stringType()).default({})
5551
5618
  }).strict();
5552
5619
  var schemaSquashed2 = objectType({
5553
5620
  version: latestVersion,
5554
5621
  dialect: dialect2,
5555
5622
  tables: recordType(stringType(), tableSquashed3),
5623
+ views: recordType(stringType(), view3),
5556
5624
  enums: anyType()
5557
5625
  }).strict();
5558
5626
  var drySQLite = schema2.parse({
@@ -5561,6 +5629,7 @@ var drySQLite = schema2.parse({
5561
5629
  id: originUUID,
5562
5630
  prevId: "",
5563
5631
  tables: {},
5632
+ views: {},
5564
5633
  enums: {},
5565
5634
  _meta: {
5566
5635
  tables: {},
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(view, stdin, stdout, closable) {
414
- this.view = view;
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
- view.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(view, stdout) {
515
- this.view = view;
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(view) {
534
+ function render2(view4) {
535
535
  const { stdin, stdout, closable } = (0, readline_1.prepareReadLine)();
536
- if (view instanceof Prompt2) {
537
- const terminal = new Terminal(view, 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(`${view}
541
+ stdout.write(`${view4}
542
542
  `);
543
543
  closable.close();
544
544
  return;
545
545
  }
546
546
  exports.render = render2;
547
- function renderWithTask(view, task) {
547
+ function renderWithTask(view4, task) {
548
548
  return __awaiter(this, void 0, void 0, function* () {
549
- const terminal = new TaskTerminal(view, process.stdout);
549
+ const terminal = new TaskTerminal(view4, process.stdout);
550
550
  terminal.requestLayout();
551
551
  const result = yield task;
552
552
  terminal.clear();
@@ -4881,6 +4881,10 @@ var uniqueConstraint = objectType({
4881
4881
  name: stringType(),
4882
4882
  columns: stringType().array()
4883
4883
  }).strict();
4884
+ var checkConstraint = objectType({
4885
+ name: stringType(),
4886
+ value: stringType()
4887
+ }).strict();
4884
4888
  var tableV4 = objectType({
4885
4889
  name: stringType(),
4886
4890
  schema: stringType().optional(),
@@ -4894,8 +4898,20 @@ var table = objectType({
4894
4898
  indexes: recordType(stringType(), index),
4895
4899
  foreignKeys: recordType(stringType(), fk),
4896
4900
  compositePrimaryKeys: recordType(stringType(), compositePK),
4897
- 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()
4898
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);
4899
4915
  var kitInternals = objectType({
4900
4916
  tables: recordType(
4901
4917
  stringType(),
@@ -4948,6 +4964,7 @@ var schemaInternal = objectType({
4948
4964
  version: literalType("5"),
4949
4965
  dialect,
4950
4966
  tables: recordType(stringType(), table),
4967
+ views: recordType(stringType(), view),
4951
4968
  _meta: objectType({
4952
4969
  tables: recordType(stringType(), stringType()),
4953
4970
  columns: recordType(stringType(), stringType())
@@ -4971,12 +4988,19 @@ var tableSquashed = objectType({
4971
4988
  indexes: recordType(stringType(), stringType()),
4972
4989
  foreignKeys: recordType(stringType(), stringType()),
4973
4990
  compositePrimaryKeys: recordType(stringType(), stringType()),
4974
- uniqueConstraints: recordType(stringType(), stringType()).default({})
4991
+ uniqueConstraints: recordType(stringType(), stringType()).default({}),
4992
+ checkConstraints: recordType(stringType(), stringType()).default({})
4975
4993
  }).strict();
4994
+ var viewSquashed = view.omit({
4995
+ algorithm: true,
4996
+ sqlSecurity: true,
4997
+ withCheckOption: true
4998
+ }).extend({ meta: stringType() });
4976
4999
  var schemaSquashed = objectType({
4977
5000
  version: literalType("5"),
4978
5001
  dialect,
4979
- tables: recordType(stringType(), tableSquashed)
5002
+ tables: recordType(stringType(), tableSquashed),
5003
+ views: recordType(stringType(), viewSquashed)
4980
5004
  }).strict();
4981
5005
  var schemaSquashedV4 = objectType({
4982
5006
  version: literalType("4"),
@@ -4994,6 +5018,7 @@ var dryMySql = mysqlSchema.parse({
4994
5018
  prevId: "",
4995
5019
  tables: {},
4996
5020
  schemas: {},
5021
+ views: {},
4997
5022
  _meta: {
4998
5023
  schemas: {},
4999
5024
  tables: {},
@@ -5127,12 +5152,6 @@ var sequenceSchema = objectType({
5127
5152
  cycle: booleanType().optional(),
5128
5153
  schema: stringType()
5129
5154
  }).strict();
5130
- var roleSchema = objectType({
5131
- name: stringType(),
5132
- createDb: booleanType().optional(),
5133
- createRole: booleanType().optional(),
5134
- inherit: booleanType().optional()
5135
- }).strict();
5136
5155
  var sequenceSquashed = objectType({
5137
5156
  name: stringType(),
5138
5157
  schema: stringType(),
@@ -5165,6 +5184,10 @@ var column2 = objectType({
5165
5184
  }).optional(),
5166
5185
  identity: sequenceSchema.merge(objectType({ type: enumType(["always", "byDefault"]) })).optional()
5167
5186
  }).strict();
5187
+ var checkConstraint2 = objectType({
5188
+ name: stringType(),
5189
+ value: stringType()
5190
+ }).strict();
5168
5191
  var columnSquashed = objectType({
5169
5192
  name: stringType(),
5170
5193
  type: stringType(),
@@ -5196,13 +5219,43 @@ var uniqueConstraint2 = objectType({
5196
5219
  columns: stringType().array(),
5197
5220
  nullsNotDistinct: booleanType()
5198
5221
  }).strict();
5199
- var policy = objectType({
5222
+ var viewWithOption = objectType({
5223
+ checkOption: enumType(["local", "cascaded"]).optional(),
5224
+ securityBarrier: booleanType().optional(),
5225
+ securityInvoker: booleanType().optional()
5226
+ }).strict();
5227
+ var matViewWithOption = objectType({
5228
+ fillfactor: numberType().optional(),
5229
+ toastTupleTarget: numberType().optional(),
5230
+ parallelWorkers: numberType().optional(),
5231
+ autovacuumEnabled: booleanType().optional(),
5232
+ vacuumIndexCleanup: enumType(["auto", "off", "on"]).optional(),
5233
+ vacuumTruncate: booleanType().optional(),
5234
+ autovacuumVacuumThreshold: numberType().optional(),
5235
+ autovacuumVacuumScaleFactor: numberType().optional(),
5236
+ autovacuumVacuumCostDelay: numberType().optional(),
5237
+ autovacuumVacuumCostLimit: numberType().optional(),
5238
+ autovacuumFreezeMinAge: numberType().optional(),
5239
+ autovacuumFreezeMaxAge: numberType().optional(),
5240
+ autovacuumFreezeTableAge: numberType().optional(),
5241
+ autovacuumMultixactFreezeMinAge: numberType().optional(),
5242
+ autovacuumMultixactFreezeMaxAge: numberType().optional(),
5243
+ autovacuumMultixactFreezeTableAge: numberType().optional(),
5244
+ logAutovacuumMinDuration: numberType().optional(),
5245
+ userCatalogTable: booleanType().optional()
5246
+ }).strict();
5247
+ var mergedViewWithOption = viewWithOption.merge(matViewWithOption).strict();
5248
+ var view2 = objectType({
5200
5249
  name: stringType(),
5201
- as: enumType(["PERMISSIVE", "RESTRICTIVE"]).optional(),
5202
- for: enumType(["ALL", "SELECT", "INSERT", "UPDATE", "DELETE"]).optional(),
5203
- to: stringType().array().optional(),
5250
+ schema: stringType(),
5251
+ columns: recordType(stringType(), column2),
5252
+ definition: stringType().optional(),
5253
+ materialized: booleanType(),
5254
+ with: mergedViewWithOption.optional(),
5255
+ isExisting: booleanType(),
5256
+ withNoData: booleanType().optional(),
5204
5257
  using: stringType().optional(),
5205
- withCheck: stringType().optional()
5258
+ tablespace: stringType().optional()
5206
5259
  }).strict();
5207
5260
  var tableV42 = objectType({
5208
5261
  name: stringType(),
@@ -5246,7 +5299,7 @@ var table2 = objectType({
5246
5299
  foreignKeys: recordType(stringType(), fk2),
5247
5300
  compositePrimaryKeys: recordType(stringType(), compositePK2),
5248
5301
  uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({}),
5249
- policies: recordType(stringType(), policy).default({})
5302
+ checkConstraints: recordType(stringType(), checkConstraint2).default({})
5250
5303
  }).strict();
5251
5304
  var schemaHash2 = objectType({
5252
5305
  id: stringType(),
@@ -5339,8 +5392,8 @@ var pgSchemaInternal = objectType({
5339
5392
  tables: recordType(stringType(), table2),
5340
5393
  enums: recordType(stringType(), enumSchema),
5341
5394
  schemas: recordType(stringType(), stringType()),
5395
+ views: recordType(stringType(), view2).default({}),
5342
5396
  sequences: recordType(stringType(), sequenceSchema).default({}),
5343
- roles: recordType(stringType(), roleSchema).default({}),
5344
5397
  _meta: objectType({
5345
5398
  schemas: recordType(stringType(), stringType()),
5346
5399
  tables: recordType(stringType(), stringType()),
@@ -5356,7 +5409,7 @@ var tableSquashed2 = objectType({
5356
5409
  foreignKeys: recordType(stringType(), stringType()),
5357
5410
  compositePrimaryKeys: recordType(stringType(), stringType()),
5358
5411
  uniqueConstraints: recordType(stringType(), stringType()),
5359
- policies: recordType(stringType(), stringType())
5412
+ checkConstraints: recordType(stringType(), stringType())
5360
5413
  }).strict();
5361
5414
  var tableSquashedV42 = objectType({
5362
5415
  name: stringType(),
@@ -5385,8 +5438,8 @@ var pgSchemaSquashed = objectType({
5385
5438
  tables: recordType(stringType(), tableSquashed2),
5386
5439
  enums: recordType(stringType(), enumSchema),
5387
5440
  schemas: recordType(stringType(), stringType()),
5388
- sequences: recordType(stringType(), sequenceSquashed),
5389
- roles: recordType(stringType(), roleSchema).default({})
5441
+ views: recordType(stringType(), view2),
5442
+ sequences: recordType(stringType(), sequenceSquashed)
5390
5443
  }).strict();
5391
5444
  var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
5392
5445
  var pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
@@ -5457,13 +5510,24 @@ var uniqueConstraint3 = objectType({
5457
5510
  name: stringType(),
5458
5511
  columns: stringType().array()
5459
5512
  }).strict();
5513
+ var checkConstraint3 = objectType({
5514
+ name: stringType(),
5515
+ value: stringType()
5516
+ }).strict();
5460
5517
  var table3 = objectType({
5461
5518
  name: stringType(),
5462
5519
  columns: recordType(stringType(), column3),
5463
5520
  indexes: recordType(stringType(), index3),
5464
5521
  foreignKeys: recordType(stringType(), fk3),
5465
5522
  compositePrimaryKeys: recordType(stringType(), compositePK3),
5466
- 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()
5467
5531
  }).strict();
5468
5532
  var dialect2 = enumType(["sqlite"]);
5469
5533
  var schemaHash3 = objectType({
@@ -5480,6 +5544,7 @@ var schemaInternalV42 = objectType({
5480
5544
  version: literalType("4"),
5481
5545
  dialect: dialect2,
5482
5546
  tables: recordType(stringType(), table3),
5547
+ views: recordType(stringType(), view3),
5483
5548
  enums: objectType({})
5484
5549
  }).strict();
5485
5550
  var schemaInternalV52 = objectType({
@@ -5508,6 +5573,7 @@ var schemaInternal2 = objectType({
5508
5573
  version: latestVersion,
5509
5574
  dialect: dialect2,
5510
5575
  tables: recordType(stringType(), table3),
5576
+ views: recordType(stringType(), view3),
5511
5577
  enums: objectType({}),
5512
5578
  _meta: objectType({
5513
5579
  tables: recordType(stringType(), stringType()),
@@ -5525,12 +5591,14 @@ var tableSquashed3 = objectType({
5525
5591
  indexes: recordType(stringType(), stringType()),
5526
5592
  foreignKeys: recordType(stringType(), stringType()),
5527
5593
  compositePrimaryKeys: recordType(stringType(), stringType()),
5528
- uniqueConstraints: recordType(stringType(), stringType()).default({})
5594
+ uniqueConstraints: recordType(stringType(), stringType()).default({}),
5595
+ checkConstraints: recordType(stringType(), stringType()).default({})
5529
5596
  }).strict();
5530
5597
  var schemaSquashed2 = objectType({
5531
5598
  version: latestVersion,
5532
5599
  dialect: dialect2,
5533
5600
  tables: recordType(stringType(), tableSquashed3),
5601
+ views: recordType(stringType(), view3),
5534
5602
  enums: anyType()
5535
5603
  }).strict();
5536
5604
  var drySQLite = schema2.parse({
@@ -5539,6 +5607,7 @@ var drySQLite = schema2.parse({
5539
5607
  id: originUUID,
5540
5608
  prevId: "",
5541
5609
  tables: {},
5610
+ views: {},
5542
5611
  enums: {},
5543
5612
  _meta: {
5544
5613
  tables: {},