drizzle-kit 0.25.0-178591 → 0.25.0-1f0b52f
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 +16673 -88078
- package/api.mjs +16673 -88075
- package/bin.cjs +2660 -912
- 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-1f0b52f",
|
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");
|
@@ -4921,6 +4923,17 @@ var table = objectType({
|
|
4921
4923
|
uniqueConstraints: recordType(stringType(), uniqueConstraint).default({}),
|
4922
4924
|
checkConstraint: recordType(stringType(), checkConstraint).default({})
|
4923
4925
|
}).strict();
|
4926
|
+
var viewMeta = objectType({
|
4927
|
+
algorithm: enumType(["undefined", "merge", "temptable"]),
|
4928
|
+
sqlSecurity: enumType(["definer", "invoker"]),
|
4929
|
+
withCheckOption: enumType(["local", "cascaded"]).optional()
|
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);
|
4924
4937
|
var kitInternals = objectType({
|
4925
4938
|
tables: recordType(
|
4926
4939
|
stringType(),
|
@@ -4973,6 +4986,7 @@ var schemaInternal = objectType({
|
|
4973
4986
|
version: literalType("5"),
|
4974
4987
|
dialect,
|
4975
4988
|
tables: recordType(stringType(), table),
|
4989
|
+
views: recordType(stringType(), view),
|
4976
4990
|
_meta: objectType({
|
4977
4991
|
tables: recordType(stringType(), stringType()),
|
4978
4992
|
columns: recordType(stringType(), stringType())
|
@@ -4999,10 +5013,16 @@ var tableSquashed = objectType({
|
|
4999
5013
|
uniqueConstraints: recordType(stringType(), stringType()).default({}),
|
5000
5014
|
checkConstraints: recordType(stringType(), stringType()).default({})
|
5001
5015
|
}).strict();
|
5016
|
+
var viewSquashed = view.omit({
|
5017
|
+
algorithm: true,
|
5018
|
+
sqlSecurity: true,
|
5019
|
+
withCheckOption: true
|
5020
|
+
}).extend({ meta: stringType() });
|
5002
5021
|
var schemaSquashed = objectType({
|
5003
5022
|
version: literalType("5"),
|
5004
5023
|
dialect,
|
5005
|
-
tables: recordType(stringType(), tableSquashed)
|
5024
|
+
tables: recordType(stringType(), tableSquashed),
|
5025
|
+
views: recordType(stringType(), viewSquashed)
|
5006
5026
|
}).strict();
|
5007
5027
|
var schemaSquashedV4 = objectType({
|
5008
5028
|
version: literalType("4"),
|
@@ -5020,6 +5040,7 @@ var dryMySql = mysqlSchema.parse({
|
|
5020
5040
|
prevId: "",
|
5021
5041
|
tables: {},
|
5022
5042
|
schemas: {},
|
5043
|
+
views: {},
|
5023
5044
|
_meta: {
|
5024
5045
|
schemas: {},
|
5025
5046
|
tables: {},
|
@@ -5220,6 +5241,44 @@ var uniqueConstraint2 = objectType({
|
|
5220
5241
|
columns: stringType().array(),
|
5221
5242
|
nullsNotDistinct: booleanType()
|
5222
5243
|
}).strict();
|
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({
|
5271
|
+
name: stringType(),
|
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(),
|
5279
|
+
using: stringType().optional(),
|
5280
|
+
tablespace: stringType().optional()
|
5281
|
+
}).strict();
|
5223
5282
|
var tableV42 = objectType({
|
5224
5283
|
name: stringType(),
|
5225
5284
|
schema: stringType(),
|
@@ -5355,6 +5414,7 @@ var pgSchemaInternal = objectType({
|
|
5355
5414
|
tables: recordType(stringType(), table2),
|
5356
5415
|
enums: recordType(stringType(), enumSchema),
|
5357
5416
|
schemas: recordType(stringType(), stringType()),
|
5417
|
+
views: recordType(stringType(), view2).default({}),
|
5358
5418
|
sequences: recordType(stringType(), sequenceSchema).default({}),
|
5359
5419
|
_meta: objectType({
|
5360
5420
|
schemas: recordType(stringType(), stringType()),
|
@@ -5400,6 +5460,7 @@ var pgSchemaSquashed = objectType({
|
|
5400
5460
|
tables: recordType(stringType(), tableSquashed2),
|
5401
5461
|
enums: recordType(stringType(), enumSchema),
|
5402
5462
|
schemas: recordType(stringType(), stringType()),
|
5463
|
+
views: recordType(stringType(), view2),
|
5403
5464
|
sequences: recordType(stringType(), sequenceSquashed)
|
5404
5465
|
}).strict();
|
5405
5466
|
var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
|
@@ -5484,6 +5545,12 @@ var table3 = objectType({
|
|
5484
5545
|
uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({}),
|
5485
5546
|
checkConstraints: recordType(stringType(), checkConstraint3).default({})
|
5486
5547
|
}).strict();
|
5548
|
+
var view3 = objectType({
|
5549
|
+
name: stringType(),
|
5550
|
+
columns: recordType(stringType(), column3),
|
5551
|
+
definition: stringType().optional(),
|
5552
|
+
isExisting: booleanType()
|
5553
|
+
}).strict();
|
5487
5554
|
var dialect2 = enumType(["sqlite"]);
|
5488
5555
|
var schemaHash3 = objectType({
|
5489
5556
|
id: stringType(),
|
@@ -5499,6 +5566,7 @@ var schemaInternalV42 = objectType({
|
|
5499
5566
|
version: literalType("4"),
|
5500
5567
|
dialect: dialect2,
|
5501
5568
|
tables: recordType(stringType(), table3),
|
5569
|
+
views: recordType(stringType(), view3),
|
5502
5570
|
enums: objectType({})
|
5503
5571
|
}).strict();
|
5504
5572
|
var schemaInternalV52 = objectType({
|
@@ -5527,6 +5595,7 @@ var schemaInternal2 = objectType({
|
|
5527
5595
|
version: latestVersion,
|
5528
5596
|
dialect: dialect2,
|
5529
5597
|
tables: recordType(stringType(), table3),
|
5598
|
+
views: recordType(stringType(), view3),
|
5530
5599
|
enums: objectType({}),
|
5531
5600
|
_meta: objectType({
|
5532
5601
|
tables: recordType(stringType(), stringType()),
|
@@ -5551,6 +5620,7 @@ var schemaSquashed2 = objectType({
|
|
5551
5620
|
version: latestVersion,
|
5552
5621
|
dialect: dialect2,
|
5553
5622
|
tables: recordType(stringType(), tableSquashed3),
|
5623
|
+
views: recordType(stringType(), view3),
|
5554
5624
|
enums: anyType()
|
5555
5625
|
}).strict();
|
5556
5626
|
var drySQLite = schema2.parse({
|
@@ -5559,6 +5629,7 @@ var drySQLite = schema2.parse({
|
|
5559
5629
|
id: originUUID,
|
5560
5630
|
prevId: "",
|
5561
5631
|
tables: {},
|
5632
|
+
views: {},
|
5562
5633
|
enums: {},
|
5563
5634
|
_meta: {
|
5564
5635
|
tables: {},
|
@@ -5778,6 +5849,11 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
|
|
5778
5849
|
const removedColumns = columnNames1.filter((it) => !set2.has(it));
|
5779
5850
|
return { addedColumns, removedColumns };
|
5780
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
|
+
}
|
5781
5857
|
// Annotate the CommonJS export names for ESM import in node:
|
5782
5858
|
0 && (module.exports = {
|
5783
5859
|
assertV1OutFolder,
|
@@ -5785,6 +5861,7 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
|
|
5785
5861
|
copy,
|
5786
5862
|
dryJournal,
|
5787
5863
|
findAddedAndRemoved,
|
5864
|
+
getColumnCasing,
|
5788
5865
|
isPgArrayType,
|
5789
5866
|
kloudMeta,
|
5790
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(
|
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";
|
@@ -4900,6 +4901,17 @@ var table = objectType({
|
|
4900
4901
|
uniqueConstraints: recordType(stringType(), uniqueConstraint).default({}),
|
4901
4902
|
checkConstraint: recordType(stringType(), checkConstraint).default({})
|
4902
4903
|
}).strict();
|
4904
|
+
var viewMeta = objectType({
|
4905
|
+
algorithm: enumType(["undefined", "merge", "temptable"]),
|
4906
|
+
sqlSecurity: enumType(["definer", "invoker"]),
|
4907
|
+
withCheckOption: enumType(["local", "cascaded"]).optional()
|
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);
|
4903
4915
|
var kitInternals = objectType({
|
4904
4916
|
tables: recordType(
|
4905
4917
|
stringType(),
|
@@ -4952,6 +4964,7 @@ var schemaInternal = objectType({
|
|
4952
4964
|
version: literalType("5"),
|
4953
4965
|
dialect,
|
4954
4966
|
tables: recordType(stringType(), table),
|
4967
|
+
views: recordType(stringType(), view),
|
4955
4968
|
_meta: objectType({
|
4956
4969
|
tables: recordType(stringType(), stringType()),
|
4957
4970
|
columns: recordType(stringType(), stringType())
|
@@ -4978,10 +4991,16 @@ var tableSquashed = objectType({
|
|
4978
4991
|
uniqueConstraints: recordType(stringType(), stringType()).default({}),
|
4979
4992
|
checkConstraints: recordType(stringType(), stringType()).default({})
|
4980
4993
|
}).strict();
|
4994
|
+
var viewSquashed = view.omit({
|
4995
|
+
algorithm: true,
|
4996
|
+
sqlSecurity: true,
|
4997
|
+
withCheckOption: true
|
4998
|
+
}).extend({ meta: stringType() });
|
4981
4999
|
var schemaSquashed = objectType({
|
4982
5000
|
version: literalType("5"),
|
4983
5001
|
dialect,
|
4984
|
-
tables: recordType(stringType(), tableSquashed)
|
5002
|
+
tables: recordType(stringType(), tableSquashed),
|
5003
|
+
views: recordType(stringType(), viewSquashed)
|
4985
5004
|
}).strict();
|
4986
5005
|
var schemaSquashedV4 = objectType({
|
4987
5006
|
version: literalType("4"),
|
@@ -4999,6 +5018,7 @@ var dryMySql = mysqlSchema.parse({
|
|
4999
5018
|
prevId: "",
|
5000
5019
|
tables: {},
|
5001
5020
|
schemas: {},
|
5021
|
+
views: {},
|
5002
5022
|
_meta: {
|
5003
5023
|
schemas: {},
|
5004
5024
|
tables: {},
|
@@ -5199,6 +5219,44 @@ var uniqueConstraint2 = objectType({
|
|
5199
5219
|
columns: stringType().array(),
|
5200
5220
|
nullsNotDistinct: booleanType()
|
5201
5221
|
}).strict();
|
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({
|
5249
|
+
name: stringType(),
|
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(),
|
5257
|
+
using: stringType().optional(),
|
5258
|
+
tablespace: stringType().optional()
|
5259
|
+
}).strict();
|
5202
5260
|
var tableV42 = objectType({
|
5203
5261
|
name: stringType(),
|
5204
5262
|
schema: stringType(),
|
@@ -5334,6 +5392,7 @@ var pgSchemaInternal = objectType({
|
|
5334
5392
|
tables: recordType(stringType(), table2),
|
5335
5393
|
enums: recordType(stringType(), enumSchema),
|
5336
5394
|
schemas: recordType(stringType(), stringType()),
|
5395
|
+
views: recordType(stringType(), view2).default({}),
|
5337
5396
|
sequences: recordType(stringType(), sequenceSchema).default({}),
|
5338
5397
|
_meta: objectType({
|
5339
5398
|
schemas: recordType(stringType(), stringType()),
|
@@ -5379,6 +5438,7 @@ var pgSchemaSquashed = objectType({
|
|
5379
5438
|
tables: recordType(stringType(), tableSquashed2),
|
5380
5439
|
enums: recordType(stringType(), enumSchema),
|
5381
5440
|
schemas: recordType(stringType(), stringType()),
|
5441
|
+
views: recordType(stringType(), view2),
|
5382
5442
|
sequences: recordType(stringType(), sequenceSquashed)
|
5383
5443
|
}).strict();
|
5384
5444
|
var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
|
@@ -5463,6 +5523,12 @@ var table3 = objectType({
|
|
5463
5523
|
uniqueConstraints: recordType(stringType(), uniqueConstraint3).default({}),
|
5464
5524
|
checkConstraints: recordType(stringType(), checkConstraint3).default({})
|
5465
5525
|
}).strict();
|
5526
|
+
var view3 = objectType({
|
5527
|
+
name: stringType(),
|
5528
|
+
columns: recordType(stringType(), column3),
|
5529
|
+
definition: stringType().optional(),
|
5530
|
+
isExisting: booleanType()
|
5531
|
+
}).strict();
|
5466
5532
|
var dialect2 = enumType(["sqlite"]);
|
5467
5533
|
var schemaHash3 = objectType({
|
5468
5534
|
id: stringType(),
|
@@ -5478,6 +5544,7 @@ var schemaInternalV42 = objectType({
|
|
5478
5544
|
version: literalType("4"),
|
5479
5545
|
dialect: dialect2,
|
5480
5546
|
tables: recordType(stringType(), table3),
|
5547
|
+
views: recordType(stringType(), view3),
|
5481
5548
|
enums: objectType({})
|
5482
5549
|
}).strict();
|
5483
5550
|
var schemaInternalV52 = objectType({
|
@@ -5506,6 +5573,7 @@ var schemaInternal2 = objectType({
|
|
5506
5573
|
version: latestVersion,
|
5507
5574
|
dialect: dialect2,
|
5508
5575
|
tables: recordType(stringType(), table3),
|
5576
|
+
views: recordType(stringType(), view3),
|
5509
5577
|
enums: objectType({}),
|
5510
5578
|
_meta: objectType({
|
5511
5579
|
tables: recordType(stringType(), stringType()),
|
@@ -5530,6 +5598,7 @@ var schemaSquashed2 = objectType({
|
|
5530
5598
|
version: latestVersion,
|
5531
5599
|
dialect: dialect2,
|
5532
5600
|
tables: recordType(stringType(), tableSquashed3),
|
5601
|
+
views: recordType(stringType(), view3),
|
5533
5602
|
enums: anyType()
|
5534
5603
|
}).strict();
|
5535
5604
|
var drySQLite = schema2.parse({
|
@@ -5538,6 +5607,7 @@ var drySQLite = schema2.parse({
|
|
5538
5607
|
id: originUUID,
|
5539
5608
|
prevId: "",
|
5540
5609
|
tables: {},
|
5610
|
+
views: {},
|
5541
5611
|
enums: {},
|
5542
5612
|
_meta: {
|
5543
5613
|
tables: {},
|
@@ -5757,12 +5827,18 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
|
|
5757
5827
|
const removedColumns = columnNames1.filter((it) => !set2.has(it));
|
5758
5828
|
return { addedColumns, removedColumns };
|
5759
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
|
+
}
|
5760
5835
|
export {
|
5761
5836
|
assertV1OutFolder,
|
5762
5837
|
columnRenameKey,
|
5763
5838
|
copy,
|
5764
5839
|
dryJournal,
|
5765
5840
|
findAddedAndRemoved,
|
5841
|
+
getColumnCasing,
|
5766
5842
|
isPgArrayType,
|
5767
5843
|
kloudMeta,
|
5768
5844
|
normalisePGliteUrl,
|