drizzle-kit 0.25.0-d1da3b8 → 0.25.0-e7d524d
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.
- package/api.d.mts +723 -3
- package/api.d.ts +723 -3
- package/api.js +16324 -94209
- package/api.mjs +16323 -94204
- package/bin.cjs +2524 -799
- package/common-DYjgLS6u.d.mts +8 -0
- package/common-DYjgLS6u.d.ts +8 -0
- package/index.d.mts +2 -5
- package/index.d.ts +2 -5
- package/package.json +2 -2
- package/utils.js +89 -12
- package/utils.mjs +88 -12
@@ -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-
|
3
|
+
"version": "0.25.0-e7d524d",
|
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.
|
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(
|
413
|
-
this.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
|
-
|
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(
|
514
|
-
this.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(
|
533
|
+
function render2(view4) {
|
534
534
|
const { stdin, stdout, closable } = (0, readline_1.prepareReadLine)();
|
535
|
-
if (
|
536
|
-
const terminal = new Terminal(
|
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(`${
|
540
|
+
stdout.write(`${view4}
|
541
541
|
`);
|
542
542
|
closable.close();
|
543
543
|
return;
|
544
544
|
}
|
545
545
|
exports2.render = render2;
|
546
|
-
function renderWithTask(
|
546
|
+
function renderWithTask(view4, task) {
|
547
547
|
return __awaiter(this, void 0, void 0, function* () {
|
548
|
-
const terminal = new TaskTerminal(
|
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");
|
@@ -4916,6 +4918,17 @@ var table = objectType({
|
|
4916
4918
|
compositePrimaryKeys: recordType(stringType(), compositePK),
|
4917
4919
|
uniqueConstraints: recordType(stringType(), uniqueConstraint).default({})
|
4918
4920
|
}).strict();
|
4921
|
+
var viewMeta = objectType({
|
4922
|
+
algorithm: enumType(["undefined", "merge", "temptable"]),
|
4923
|
+
sqlSecurity: enumType(["definer", "invoker"]),
|
4924
|
+
withCheckOption: enumType(["local", "cascaded"]).optional()
|
4925
|
+
}).strict();
|
4926
|
+
var view = objectType({
|
4927
|
+
name: stringType(),
|
4928
|
+
columns: recordType(stringType(), column),
|
4929
|
+
definition: stringType().optional(),
|
4930
|
+
isExisting: booleanType()
|
4931
|
+
}).strict().merge(viewMeta);
|
4919
4932
|
var kitInternals = objectType({
|
4920
4933
|
tables: recordType(
|
4921
4934
|
stringType(),
|
@@ -4968,6 +4981,7 @@ var schemaInternal = objectType({
|
|
4968
4981
|
version: literalType("5"),
|
4969
4982
|
dialect,
|
4970
4983
|
tables: recordType(stringType(), table),
|
4984
|
+
views: recordType(stringType(), view),
|
4971
4985
|
_meta: objectType({
|
4972
4986
|
tables: recordType(stringType(), stringType()),
|
4973
4987
|
columns: recordType(stringType(), stringType())
|
@@ -4993,10 +5007,16 @@ var tableSquashed = objectType({
|
|
4993
5007
|
compositePrimaryKeys: recordType(stringType(), stringType()),
|
4994
5008
|
uniqueConstraints: recordType(stringType(), stringType()).default({})
|
4995
5009
|
}).strict();
|
5010
|
+
var viewSquashed = view.omit({
|
5011
|
+
algorithm: true,
|
5012
|
+
sqlSecurity: true,
|
5013
|
+
withCheckOption: true
|
5014
|
+
}).extend({ meta: stringType() });
|
4996
5015
|
var schemaSquashed = objectType({
|
4997
5016
|
version: literalType("5"),
|
4998
5017
|
dialect,
|
4999
|
-
tables: recordType(stringType(), tableSquashed)
|
5018
|
+
tables: recordType(stringType(), tableSquashed),
|
5019
|
+
views: recordType(stringType(), viewSquashed)
|
5000
5020
|
}).strict();
|
5001
5021
|
var schemaSquashedV4 = objectType({
|
5002
5022
|
version: literalType("4"),
|
@@ -5014,6 +5034,7 @@ var dryMySql = mysqlSchema.parse({
|
|
5014
5034
|
prevId: "",
|
5015
5035
|
tables: {},
|
5016
5036
|
schemas: {},
|
5037
|
+
views: {},
|
5017
5038
|
_meta: {
|
5018
5039
|
schemas: {},
|
5019
5040
|
tables: {},
|
@@ -5210,6 +5231,44 @@ var uniqueConstraint2 = objectType({
|
|
5210
5231
|
columns: stringType().array(),
|
5211
5232
|
nullsNotDistinct: booleanType()
|
5212
5233
|
}).strict();
|
5234
|
+
var viewWithOption = objectType({
|
5235
|
+
checkOption: enumType(["local", "cascaded"]).optional(),
|
5236
|
+
securityBarrier: booleanType().optional(),
|
5237
|
+
securityInvoker: booleanType().optional()
|
5238
|
+
}).strict();
|
5239
|
+
var matViewWithOption = objectType({
|
5240
|
+
fillfactor: numberType().optional(),
|
5241
|
+
toastTupleTarget: numberType().optional(),
|
5242
|
+
parallelWorkers: numberType().optional(),
|
5243
|
+
autovacuumEnabled: booleanType().optional(),
|
5244
|
+
vacuumIndexCleanup: enumType(["auto", "off", "on"]).optional(),
|
5245
|
+
vacuumTruncate: booleanType().optional(),
|
5246
|
+
autovacuumVacuumThreshold: numberType().optional(),
|
5247
|
+
autovacuumVacuumScaleFactor: numberType().optional(),
|
5248
|
+
autovacuumVacuumCostDelay: numberType().optional(),
|
5249
|
+
autovacuumVacuumCostLimit: numberType().optional(),
|
5250
|
+
autovacuumFreezeMinAge: numberType().optional(),
|
5251
|
+
autovacuumFreezeMaxAge: numberType().optional(),
|
5252
|
+
autovacuumFreezeTableAge: numberType().optional(),
|
5253
|
+
autovacuumMultixactFreezeMinAge: numberType().optional(),
|
5254
|
+
autovacuumMultixactFreezeMaxAge: numberType().optional(),
|
5255
|
+
autovacuumMultixactFreezeTableAge: numberType().optional(),
|
5256
|
+
logAutovacuumMinDuration: numberType().optional(),
|
5257
|
+
userCatalogTable: booleanType().optional()
|
5258
|
+
}).strict();
|
5259
|
+
var mergedViewWithOption = viewWithOption.merge(matViewWithOption).strict();
|
5260
|
+
var view2 = objectType({
|
5261
|
+
name: stringType(),
|
5262
|
+
schema: stringType(),
|
5263
|
+
columns: recordType(stringType(), column2),
|
5264
|
+
definition: stringType().optional(),
|
5265
|
+
materialized: booleanType(),
|
5266
|
+
with: mergedViewWithOption.optional(),
|
5267
|
+
isExisting: booleanType(),
|
5268
|
+
withNoData: booleanType().optional(),
|
5269
|
+
using: stringType().optional(),
|
5270
|
+
tablespace: stringType().optional()
|
5271
|
+
}).strict();
|
5213
5272
|
var tableV42 = objectType({
|
5214
5273
|
name: stringType(),
|
5215
5274
|
schema: stringType(),
|
@@ -5344,6 +5403,7 @@ var pgSchemaInternal = objectType({
|
|
5344
5403
|
tables: recordType(stringType(), table2),
|
5345
5404
|
enums: recordType(stringType(), enumSchema),
|
5346
5405
|
schemas: recordType(stringType(), stringType()),
|
5406
|
+
views: recordType(stringType(), view2).default({}),
|
5347
5407
|
sequences: recordType(stringType(), sequenceSchema).default({}),
|
5348
5408
|
_meta: objectType({
|
5349
5409
|
schemas: recordType(stringType(), stringType()),
|
@@ -5388,6 +5448,7 @@ var pgSchemaSquashed = objectType({
|
|
5388
5448
|
tables: recordType(stringType(), tableSquashed2),
|
5389
5449
|
enums: recordType(stringType(), enumSchema),
|
5390
5450
|
schemas: recordType(stringType(), stringType()),
|
5451
|
+
views: recordType(stringType(), view2),
|
5391
5452
|
sequences: recordType(stringType(), sequenceSquashed)
|
5392
5453
|
}).strict();
|
5393
5454
|
var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
|
@@ -5467,6 +5528,12 @@ var table3 = objectType({
|
|
5467
5528
|
compositePrimaryKeys: recordType(stringType(), compositePK3),
|
5468
5529
|
uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({})
|
5469
5530
|
}).strict();
|
5531
|
+
var view3 = objectType({
|
5532
|
+
name: stringType(),
|
5533
|
+
columns: recordType(stringType(), column3),
|
5534
|
+
definition: stringType().optional(),
|
5535
|
+
isExisting: booleanType()
|
5536
|
+
}).strict();
|
5470
5537
|
var dialect2 = enumType(["sqlite"]);
|
5471
5538
|
var schemaHash3 = objectType({
|
5472
5539
|
id: stringType(),
|
@@ -5482,6 +5549,7 @@ var schemaInternalV42 = objectType({
|
|
5482
5549
|
version: literalType("4"),
|
5483
5550
|
dialect: dialect2,
|
5484
5551
|
tables: recordType(stringType(), table3),
|
5552
|
+
views: recordType(stringType(), view3),
|
5485
5553
|
enums: objectType({})
|
5486
5554
|
}).strict();
|
5487
5555
|
var schemaInternalV52 = objectType({
|
@@ -5510,6 +5578,7 @@ var schemaInternal2 = objectType({
|
|
5510
5578
|
version: latestVersion,
|
5511
5579
|
dialect: dialect2,
|
5512
5580
|
tables: recordType(stringType(), table3),
|
5581
|
+
views: recordType(stringType(), view3),
|
5513
5582
|
enums: objectType({}),
|
5514
5583
|
_meta: objectType({
|
5515
5584
|
tables: recordType(stringType(), stringType()),
|
@@ -5533,6 +5602,7 @@ var schemaSquashed2 = objectType({
|
|
5533
5602
|
version: latestVersion,
|
5534
5603
|
dialect: dialect2,
|
5535
5604
|
tables: recordType(stringType(), tableSquashed3),
|
5605
|
+
views: recordType(stringType(), view3),
|
5536
5606
|
enums: anyType()
|
5537
5607
|
}).strict();
|
5538
5608
|
var drySQLite = schema2.parse({
|
@@ -5541,6 +5611,7 @@ var drySQLite = schema2.parse({
|
|
5541
5611
|
id: originUUID,
|
5542
5612
|
prevId: "",
|
5543
5613
|
tables: {},
|
5614
|
+
views: {},
|
5544
5615
|
enums: {},
|
5545
5616
|
_meta: {
|
5546
5617
|
tables: {},
|
@@ -5760,6 +5831,11 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
|
|
5760
5831
|
const removedColumns = columnNames1.filter((it) => !set2.has(it));
|
5761
5832
|
return { addedColumns, removedColumns };
|
5762
5833
|
}
|
5834
|
+
function getColumnCasing(column4, casing) {
|
5835
|
+
if (!column4.name)
|
5836
|
+
return "";
|
5837
|
+
return !column4.keyAsName || casing === void 0 ? column4.name : casing === "camelCase" ? (0, import_casing.toCamelCase)(column4.name) : (0, import_casing.toSnakeCase)(column4.name);
|
5838
|
+
}
|
5763
5839
|
// Annotate the CommonJS export names for ESM import in node:
|
5764
5840
|
0 && (module.exports = {
|
5765
5841
|
assertV1OutFolder,
|
@@ -5767,6 +5843,7 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
|
|
5767
5843
|
copy,
|
5768
5844
|
dryJournal,
|
5769
5845
|
findAddedAndRemoved,
|
5846
|
+
getColumnCasing,
|
5770
5847
|
isPgArrayType,
|
5771
5848
|
kloudMeta,
|
5772
5849
|
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(
|
414
|
-
this.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
|
-
|
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(
|
515
|
-
this.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(
|
534
|
+
function render2(view4) {
|
535
535
|
const { stdin, stdout, closable } = (0, readline_1.prepareReadLine)();
|
536
|
-
if (
|
537
|
-
const terminal = new Terminal(
|
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(`${
|
541
|
+
stdout.write(`${view4}
|
542
542
|
`);
|
543
543
|
closable.close();
|
544
544
|
return;
|
545
545
|
}
|
546
546
|
exports.render = render2;
|
547
|
-
function renderWithTask(
|
547
|
+
function renderWithTask(view4, task) {
|
548
548
|
return __awaiter(this, void 0, void 0, function* () {
|
549
|
-
const terminal = new TaskTerminal(
|
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";
|
@@ -4895,6 +4896,17 @@ var table = objectType({
|
|
4895
4896
|
compositePrimaryKeys: recordType(stringType(), compositePK),
|
4896
4897
|
uniqueConstraints: recordType(stringType(), uniqueConstraint).default({})
|
4897
4898
|
}).strict();
|
4899
|
+
var viewMeta = objectType({
|
4900
|
+
algorithm: enumType(["undefined", "merge", "temptable"]),
|
4901
|
+
sqlSecurity: enumType(["definer", "invoker"]),
|
4902
|
+
withCheckOption: enumType(["local", "cascaded"]).optional()
|
4903
|
+
}).strict();
|
4904
|
+
var view = objectType({
|
4905
|
+
name: stringType(),
|
4906
|
+
columns: recordType(stringType(), column),
|
4907
|
+
definition: stringType().optional(),
|
4908
|
+
isExisting: booleanType()
|
4909
|
+
}).strict().merge(viewMeta);
|
4898
4910
|
var kitInternals = objectType({
|
4899
4911
|
tables: recordType(
|
4900
4912
|
stringType(),
|
@@ -4947,6 +4959,7 @@ var schemaInternal = objectType({
|
|
4947
4959
|
version: literalType("5"),
|
4948
4960
|
dialect,
|
4949
4961
|
tables: recordType(stringType(), table),
|
4962
|
+
views: recordType(stringType(), view),
|
4950
4963
|
_meta: objectType({
|
4951
4964
|
tables: recordType(stringType(), stringType()),
|
4952
4965
|
columns: recordType(stringType(), stringType())
|
@@ -4972,10 +4985,16 @@ var tableSquashed = objectType({
|
|
4972
4985
|
compositePrimaryKeys: recordType(stringType(), stringType()),
|
4973
4986
|
uniqueConstraints: recordType(stringType(), stringType()).default({})
|
4974
4987
|
}).strict();
|
4988
|
+
var viewSquashed = view.omit({
|
4989
|
+
algorithm: true,
|
4990
|
+
sqlSecurity: true,
|
4991
|
+
withCheckOption: true
|
4992
|
+
}).extend({ meta: stringType() });
|
4975
4993
|
var schemaSquashed = objectType({
|
4976
4994
|
version: literalType("5"),
|
4977
4995
|
dialect,
|
4978
|
-
tables: recordType(stringType(), tableSquashed)
|
4996
|
+
tables: recordType(stringType(), tableSquashed),
|
4997
|
+
views: recordType(stringType(), viewSquashed)
|
4979
4998
|
}).strict();
|
4980
4999
|
var schemaSquashedV4 = objectType({
|
4981
5000
|
version: literalType("4"),
|
@@ -4993,6 +5012,7 @@ var dryMySql = mysqlSchema.parse({
|
|
4993
5012
|
prevId: "",
|
4994
5013
|
tables: {},
|
4995
5014
|
schemas: {},
|
5015
|
+
views: {},
|
4996
5016
|
_meta: {
|
4997
5017
|
schemas: {},
|
4998
5018
|
tables: {},
|
@@ -5189,6 +5209,44 @@ var uniqueConstraint2 = objectType({
|
|
5189
5209
|
columns: stringType().array(),
|
5190
5210
|
nullsNotDistinct: booleanType()
|
5191
5211
|
}).strict();
|
5212
|
+
var viewWithOption = objectType({
|
5213
|
+
checkOption: enumType(["local", "cascaded"]).optional(),
|
5214
|
+
securityBarrier: booleanType().optional(),
|
5215
|
+
securityInvoker: booleanType().optional()
|
5216
|
+
}).strict();
|
5217
|
+
var matViewWithOption = objectType({
|
5218
|
+
fillfactor: numberType().optional(),
|
5219
|
+
toastTupleTarget: numberType().optional(),
|
5220
|
+
parallelWorkers: numberType().optional(),
|
5221
|
+
autovacuumEnabled: booleanType().optional(),
|
5222
|
+
vacuumIndexCleanup: enumType(["auto", "off", "on"]).optional(),
|
5223
|
+
vacuumTruncate: booleanType().optional(),
|
5224
|
+
autovacuumVacuumThreshold: numberType().optional(),
|
5225
|
+
autovacuumVacuumScaleFactor: numberType().optional(),
|
5226
|
+
autovacuumVacuumCostDelay: numberType().optional(),
|
5227
|
+
autovacuumVacuumCostLimit: numberType().optional(),
|
5228
|
+
autovacuumFreezeMinAge: numberType().optional(),
|
5229
|
+
autovacuumFreezeMaxAge: numberType().optional(),
|
5230
|
+
autovacuumFreezeTableAge: numberType().optional(),
|
5231
|
+
autovacuumMultixactFreezeMinAge: numberType().optional(),
|
5232
|
+
autovacuumMultixactFreezeMaxAge: numberType().optional(),
|
5233
|
+
autovacuumMultixactFreezeTableAge: numberType().optional(),
|
5234
|
+
logAutovacuumMinDuration: numberType().optional(),
|
5235
|
+
userCatalogTable: booleanType().optional()
|
5236
|
+
}).strict();
|
5237
|
+
var mergedViewWithOption = viewWithOption.merge(matViewWithOption).strict();
|
5238
|
+
var view2 = objectType({
|
5239
|
+
name: stringType(),
|
5240
|
+
schema: stringType(),
|
5241
|
+
columns: recordType(stringType(), column2),
|
5242
|
+
definition: stringType().optional(),
|
5243
|
+
materialized: booleanType(),
|
5244
|
+
with: mergedViewWithOption.optional(),
|
5245
|
+
isExisting: booleanType(),
|
5246
|
+
withNoData: booleanType().optional(),
|
5247
|
+
using: stringType().optional(),
|
5248
|
+
tablespace: stringType().optional()
|
5249
|
+
}).strict();
|
5192
5250
|
var tableV42 = objectType({
|
5193
5251
|
name: stringType(),
|
5194
5252
|
schema: stringType(),
|
@@ -5323,6 +5381,7 @@ var pgSchemaInternal = objectType({
|
|
5323
5381
|
tables: recordType(stringType(), table2),
|
5324
5382
|
enums: recordType(stringType(), enumSchema),
|
5325
5383
|
schemas: recordType(stringType(), stringType()),
|
5384
|
+
views: recordType(stringType(), view2).default({}),
|
5326
5385
|
sequences: recordType(stringType(), sequenceSchema).default({}),
|
5327
5386
|
_meta: objectType({
|
5328
5387
|
schemas: recordType(stringType(), stringType()),
|
@@ -5367,6 +5426,7 @@ var pgSchemaSquashed = objectType({
|
|
5367
5426
|
tables: recordType(stringType(), tableSquashed2),
|
5368
5427
|
enums: recordType(stringType(), enumSchema),
|
5369
5428
|
schemas: recordType(stringType(), stringType()),
|
5429
|
+
views: recordType(stringType(), view2),
|
5370
5430
|
sequences: recordType(stringType(), sequenceSquashed)
|
5371
5431
|
}).strict();
|
5372
5432
|
var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
|
@@ -5446,6 +5506,12 @@ var table3 = objectType({
|
|
5446
5506
|
compositePrimaryKeys: recordType(stringType(), compositePK3),
|
5447
5507
|
uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({})
|
5448
5508
|
}).strict();
|
5509
|
+
var view3 = objectType({
|
5510
|
+
name: stringType(),
|
5511
|
+
columns: recordType(stringType(), column3),
|
5512
|
+
definition: stringType().optional(),
|
5513
|
+
isExisting: booleanType()
|
5514
|
+
}).strict();
|
5449
5515
|
var dialect2 = enumType(["sqlite"]);
|
5450
5516
|
var schemaHash3 = objectType({
|
5451
5517
|
id: stringType(),
|
@@ -5461,6 +5527,7 @@ var schemaInternalV42 = objectType({
|
|
5461
5527
|
version: literalType("4"),
|
5462
5528
|
dialect: dialect2,
|
5463
5529
|
tables: recordType(stringType(), table3),
|
5530
|
+
views: recordType(stringType(), view3),
|
5464
5531
|
enums: objectType({})
|
5465
5532
|
}).strict();
|
5466
5533
|
var schemaInternalV52 = objectType({
|
@@ -5489,6 +5556,7 @@ var schemaInternal2 = objectType({
|
|
5489
5556
|
version: latestVersion,
|
5490
5557
|
dialect: dialect2,
|
5491
5558
|
tables: recordType(stringType(), table3),
|
5559
|
+
views: recordType(stringType(), view3),
|
5492
5560
|
enums: objectType({}),
|
5493
5561
|
_meta: objectType({
|
5494
5562
|
tables: recordType(stringType(), stringType()),
|
@@ -5512,6 +5580,7 @@ var schemaSquashed2 = objectType({
|
|
5512
5580
|
version: latestVersion,
|
5513
5581
|
dialect: dialect2,
|
5514
5582
|
tables: recordType(stringType(), tableSquashed3),
|
5583
|
+
views: recordType(stringType(), view3),
|
5515
5584
|
enums: anyType()
|
5516
5585
|
}).strict();
|
5517
5586
|
var drySQLite = schema2.parse({
|
@@ -5520,6 +5589,7 @@ var drySQLite = schema2.parse({
|
|
5520
5589
|
id: originUUID,
|
5521
5590
|
prevId: "",
|
5522
5591
|
tables: {},
|
5592
|
+
views: {},
|
5523
5593
|
enums: {},
|
5524
5594
|
_meta: {
|
5525
5595
|
tables: {},
|
@@ -5739,12 +5809,18 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
|
|
5739
5809
|
const removedColumns = columnNames1.filter((it) => !set2.has(it));
|
5740
5810
|
return { addedColumns, removedColumns };
|
5741
5811
|
}
|
5812
|
+
function getColumnCasing(column4, casing) {
|
5813
|
+
if (!column4.name)
|
5814
|
+
return "";
|
5815
|
+
return !column4.keyAsName || casing === void 0 ? column4.name : casing === "camelCase" ? toCamelCase(column4.name) : toSnakeCase(column4.name);
|
5816
|
+
}
|
5742
5817
|
export {
|
5743
5818
|
assertV1OutFolder,
|
5744
5819
|
columnRenameKey,
|
5745
5820
|
copy,
|
5746
5821
|
dryJournal,
|
5747
5822
|
findAddedAndRemoved,
|
5823
|
+
getColumnCasing,
|
5748
5824
|
isPgArrayType,
|
5749
5825
|
kloudMeta,
|
5750
5826
|
normalisePGliteUrl,
|