drizzle-kit 0.25.0-a5a41e0 → 0.25.0-a5ec472
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 +96 -473
- package/api.d.ts +96 -473
- package/api.js +16882 -96380
- package/api.mjs +16913 -96407
- package/bin.cjs +1673 -1677
- package/common-DYjgLS6u.d.mts +8 -0
- package/common-DYjgLS6u.d.ts +8 -0
- package/index.d.mts +9 -5
- package/index.d.ts +9 -5
- package/package.json +3 -3
- package/utils.js +37 -51
- package/utils.mjs +36 -51
@@ -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;
|
@@ -127,6 +124,13 @@ type Config = {
|
|
127
124
|
introspect?: {
|
128
125
|
casing: 'camel' | 'preserve';
|
129
126
|
};
|
127
|
+
entities?: {
|
128
|
+
roles?: boolean | {
|
129
|
+
provider?: string;
|
130
|
+
exclude?: string[];
|
131
|
+
include?: string[];
|
132
|
+
}[];
|
133
|
+
};
|
130
134
|
} & ({
|
131
135
|
dialect: Verify<Dialect, 'turso'>;
|
132
136
|
dbCredentials: {
|
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;
|
@@ -127,6 +124,13 @@ type Config = {
|
|
127
124
|
introspect?: {
|
128
125
|
casing: 'camel' | 'preserve';
|
129
126
|
};
|
127
|
+
entities?: {
|
128
|
+
roles?: boolean | {
|
129
|
+
provider?: string;
|
130
|
+
exclude?: string[];
|
131
|
+
include?: string[];
|
132
|
+
}[];
|
133
|
+
};
|
130
134
|
} & ({
|
131
135
|
dialect: Verify<Dialect, 'turso'>;
|
132
136
|
dbCredentials: {
|
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-a5ec472",
|
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.
|
54
|
+
"@electric-sql/pglite": "^0.2.5",
|
55
55
|
"@hono/node-server": "^1.9.0",
|
56
56
|
"@hono/zod-validator": "^0.2.1",
|
57
57
|
"@libsql/client": "^0.10.0",
|
@@ -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(view, stdin, stdout, closable) {
|
413
|
+
this.view = view;
|
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
|
+
view.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(view, stdout) {
|
514
|
+
this.view = view;
|
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(view) {
|
534
534
|
const { stdin, stdout, closable } = (0, readline_1.prepareReadLine)();
|
535
|
-
if (
|
536
|
-
const terminal = new Terminal(
|
535
|
+
if (view instanceof Prompt2) {
|
536
|
+
const terminal = new Terminal(view, stdin, stdout, closable);
|
537
537
|
terminal.requestLayout();
|
538
538
|
return terminal.result();
|
539
539
|
}
|
540
|
-
stdout.write(`${
|
540
|
+
stdout.write(`${view}
|
541
541
|
`);
|
542
542
|
closable.close();
|
543
543
|
return;
|
544
544
|
}
|
545
545
|
exports2.render = render2;
|
546
|
-
function renderWithTask(
|
546
|
+
function renderWithTask(view, task) {
|
547
547
|
return __awaiter(this, void 0, void 0, function* () {
|
548
|
-
const terminal = new TaskTerminal(
|
548
|
+
const terminal = new TaskTerminal(view, 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");
|
@@ -5147,6 +5149,12 @@ var sequenceSchema = objectType({
|
|
5147
5149
|
cycle: booleanType().optional(),
|
5148
5150
|
schema: stringType()
|
5149
5151
|
}).strict();
|
5152
|
+
var roleSchema = objectType({
|
5153
|
+
name: stringType(),
|
5154
|
+
createDb: booleanType().optional(),
|
5155
|
+
createRole: booleanType().optional(),
|
5156
|
+
inherit: booleanType().optional()
|
5157
|
+
}).strict();
|
5150
5158
|
var sequenceSquashed = objectType({
|
5151
5159
|
name: stringType(),
|
5152
5160
|
schema: stringType(),
|
@@ -5210,43 +5218,13 @@ var uniqueConstraint2 = objectType({
|
|
5210
5218
|
columns: stringType().array(),
|
5211
5219
|
nullsNotDistinct: booleanType()
|
5212
5220
|
}).strict();
|
5213
|
-
var
|
5214
|
-
checkOption: enumType(["local", "cascaded"]).optional(),
|
5215
|
-
securityBarrier: booleanType().optional(),
|
5216
|
-
securityInvoker: booleanType().optional()
|
5217
|
-
}).strict();
|
5218
|
-
var matViewWithOption = objectType({
|
5219
|
-
fillfactor: numberType().optional(),
|
5220
|
-
toastTupleTarget: numberType().optional(),
|
5221
|
-
parallelWorkers: numberType().optional(),
|
5222
|
-
autovacuumEnabled: booleanType().optional(),
|
5223
|
-
vacuumIndexCleanup: enumType(["auto", "off", "on"]).optional(),
|
5224
|
-
vacuumTruncate: booleanType().optional(),
|
5225
|
-
autovacuumVacuumThreshold: numberType().optional(),
|
5226
|
-
autovacuumVacuumScaleFactor: numberType().optional(),
|
5227
|
-
autovacuumVacuumCostDelay: numberType().optional(),
|
5228
|
-
autovacuumVacuumCostLimit: numberType().optional(),
|
5229
|
-
autovacuumFreezeMinAge: numberType().optional(),
|
5230
|
-
autovacuumFreezeMaxAge: numberType().optional(),
|
5231
|
-
autovacuumFreezeTableAge: numberType().optional(),
|
5232
|
-
autovacuumMultixactFreezeMinAge: numberType().optional(),
|
5233
|
-
autovacuumMultixactFreezeMaxAge: numberType().optional(),
|
5234
|
-
autovacuumMultixactFreezeTableAge: numberType().optional(),
|
5235
|
-
logAutovacuumMinDuration: numberType().optional(),
|
5236
|
-
userCatalogTable: booleanType().optional()
|
5237
|
-
}).strict();
|
5238
|
-
var mergedViewWithOption = viewWithOption.merge(matViewWithOption);
|
5239
|
-
var view = objectType({
|
5221
|
+
var policy = objectType({
|
5240
5222
|
name: stringType(),
|
5241
|
-
|
5242
|
-
|
5243
|
-
|
5244
|
-
materialized: booleanType(),
|
5245
|
-
with: mergedViewWithOption.optional(),
|
5246
|
-
isExisting: booleanType(),
|
5247
|
-
withNoData: booleanType().optional(),
|
5223
|
+
as: enumType(["PERMISSIVE", "RESTRICTIVE"]).optional(),
|
5224
|
+
for: enumType(["ALL", "SELECT", "INSERT", "UPDATE", "DELETE"]).optional(),
|
5225
|
+
to: stringType().array().optional(),
|
5248
5226
|
using: stringType().optional(),
|
5249
|
-
|
5227
|
+
withCheck: stringType().optional()
|
5250
5228
|
}).strict();
|
5251
5229
|
var tableV42 = objectType({
|
5252
5230
|
name: stringType(),
|
@@ -5289,7 +5267,8 @@ var table2 = objectType({
|
|
5289
5267
|
indexes: recordType(stringType(), index2),
|
5290
5268
|
foreignKeys: recordType(stringType(), fk2),
|
5291
5269
|
compositePrimaryKeys: recordType(stringType(), compositePK2),
|
5292
|
-
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
|
5270
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({}),
|
5271
|
+
policies: recordType(stringType(), policy).default({})
|
5293
5272
|
}).strict();
|
5294
5273
|
var schemaHash2 = objectType({
|
5295
5274
|
id: stringType(),
|
@@ -5382,8 +5361,8 @@ var pgSchemaInternal = objectType({
|
|
5382
5361
|
tables: recordType(stringType(), table2),
|
5383
5362
|
enums: recordType(stringType(), enumSchema),
|
5384
5363
|
schemas: recordType(stringType(), stringType()),
|
5385
|
-
views: recordType(stringType(), view).default({}),
|
5386
5364
|
sequences: recordType(stringType(), sequenceSchema).default({}),
|
5365
|
+
roles: recordType(stringType(), roleSchema).default({}),
|
5387
5366
|
_meta: objectType({
|
5388
5367
|
schemas: recordType(stringType(), stringType()),
|
5389
5368
|
tables: recordType(stringType(), stringType()),
|
@@ -5398,7 +5377,8 @@ var tableSquashed2 = objectType({
|
|
5398
5377
|
indexes: recordType(stringType(), stringType()),
|
5399
5378
|
foreignKeys: recordType(stringType(), stringType()),
|
5400
5379
|
compositePrimaryKeys: recordType(stringType(), stringType()),
|
5401
|
-
uniqueConstraints: recordType(stringType(), stringType())
|
5380
|
+
uniqueConstraints: recordType(stringType(), stringType()),
|
5381
|
+
policies: recordType(stringType(), stringType())
|
5402
5382
|
}).strict();
|
5403
5383
|
var tableSquashedV42 = objectType({
|
5404
5384
|
name: stringType(),
|
@@ -5427,8 +5407,8 @@ var pgSchemaSquashed = objectType({
|
|
5427
5407
|
tables: recordType(stringType(), tableSquashed2),
|
5428
5408
|
enums: recordType(stringType(), enumSchema),
|
5429
5409
|
schemas: recordType(stringType(), stringType()),
|
5430
|
-
|
5431
|
-
|
5410
|
+
sequences: recordType(stringType(), sequenceSquashed),
|
5411
|
+
roles: recordType(stringType(), roleSchema).default({})
|
5432
5412
|
}).strict();
|
5433
5413
|
var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
|
5434
5414
|
var pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
|
@@ -5800,6 +5780,11 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
|
|
5800
5780
|
const removedColumns = columnNames1.filter((it) => !set2.has(it));
|
5801
5781
|
return { addedColumns, removedColumns };
|
5802
5782
|
}
|
5783
|
+
function getColumnCasing(column4, casing) {
|
5784
|
+
if (!column4.name)
|
5785
|
+
return "";
|
5786
|
+
return !column4.keyAsName || casing === void 0 ? column4.name : casing === "camelCase" ? (0, import_casing.toCamelCase)(column4.name) : (0, import_casing.toSnakeCase)(column4.name);
|
5787
|
+
}
|
5803
5788
|
// Annotate the CommonJS export names for ESM import in node:
|
5804
5789
|
0 && (module.exports = {
|
5805
5790
|
assertV1OutFolder,
|
@@ -5807,6 +5792,7 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
|
|
5807
5792
|
copy,
|
5808
5793
|
dryJournal,
|
5809
5794
|
findAddedAndRemoved,
|
5795
|
+
getColumnCasing,
|
5810
5796
|
isPgArrayType,
|
5811
5797
|
kloudMeta,
|
5812
5798
|
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(view, stdin, stdout, closable) {
|
414
|
+
this.view = view;
|
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
|
+
view.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(view, stdout) {
|
515
|
+
this.view = view;
|
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(view) {
|
535
535
|
const { stdin, stdout, closable } = (0, readline_1.prepareReadLine)();
|
536
|
-
if (
|
537
|
-
const terminal = new Terminal(
|
536
|
+
if (view instanceof Prompt2) {
|
537
|
+
const terminal = new Terminal(view, stdin, stdout, closable);
|
538
538
|
terminal.requestLayout();
|
539
539
|
return terminal.result();
|
540
540
|
}
|
541
|
-
stdout.write(`${
|
541
|
+
stdout.write(`${view}
|
542
542
|
`);
|
543
543
|
closable.close();
|
544
544
|
return;
|
545
545
|
}
|
546
546
|
exports.render = render2;
|
547
|
-
function renderWithTask(
|
547
|
+
function renderWithTask(view, task) {
|
548
548
|
return __awaiter(this, void 0, void 0, function* () {
|
549
|
-
const terminal = new TaskTerminal(
|
549
|
+
const terminal = new TaskTerminal(view, 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";
|
@@ -5126,6 +5127,12 @@ var sequenceSchema = objectType({
|
|
5126
5127
|
cycle: booleanType().optional(),
|
5127
5128
|
schema: stringType()
|
5128
5129
|
}).strict();
|
5130
|
+
var roleSchema = objectType({
|
5131
|
+
name: stringType(),
|
5132
|
+
createDb: booleanType().optional(),
|
5133
|
+
createRole: booleanType().optional(),
|
5134
|
+
inherit: booleanType().optional()
|
5135
|
+
}).strict();
|
5129
5136
|
var sequenceSquashed = objectType({
|
5130
5137
|
name: stringType(),
|
5131
5138
|
schema: stringType(),
|
@@ -5189,43 +5196,13 @@ var uniqueConstraint2 = objectType({
|
|
5189
5196
|
columns: stringType().array(),
|
5190
5197
|
nullsNotDistinct: booleanType()
|
5191
5198
|
}).strict();
|
5192
|
-
var
|
5193
|
-
checkOption: enumType(["local", "cascaded"]).optional(),
|
5194
|
-
securityBarrier: booleanType().optional(),
|
5195
|
-
securityInvoker: booleanType().optional()
|
5196
|
-
}).strict();
|
5197
|
-
var matViewWithOption = objectType({
|
5198
|
-
fillfactor: numberType().optional(),
|
5199
|
-
toastTupleTarget: numberType().optional(),
|
5200
|
-
parallelWorkers: numberType().optional(),
|
5201
|
-
autovacuumEnabled: booleanType().optional(),
|
5202
|
-
vacuumIndexCleanup: enumType(["auto", "off", "on"]).optional(),
|
5203
|
-
vacuumTruncate: booleanType().optional(),
|
5204
|
-
autovacuumVacuumThreshold: numberType().optional(),
|
5205
|
-
autovacuumVacuumScaleFactor: numberType().optional(),
|
5206
|
-
autovacuumVacuumCostDelay: numberType().optional(),
|
5207
|
-
autovacuumVacuumCostLimit: numberType().optional(),
|
5208
|
-
autovacuumFreezeMinAge: numberType().optional(),
|
5209
|
-
autovacuumFreezeMaxAge: numberType().optional(),
|
5210
|
-
autovacuumFreezeTableAge: numberType().optional(),
|
5211
|
-
autovacuumMultixactFreezeMinAge: numberType().optional(),
|
5212
|
-
autovacuumMultixactFreezeMaxAge: numberType().optional(),
|
5213
|
-
autovacuumMultixactFreezeTableAge: numberType().optional(),
|
5214
|
-
logAutovacuumMinDuration: numberType().optional(),
|
5215
|
-
userCatalogTable: booleanType().optional()
|
5216
|
-
}).strict();
|
5217
|
-
var mergedViewWithOption = viewWithOption.merge(matViewWithOption);
|
5218
|
-
var view = objectType({
|
5199
|
+
var policy = objectType({
|
5219
5200
|
name: stringType(),
|
5220
|
-
|
5221
|
-
|
5222
|
-
|
5223
|
-
materialized: booleanType(),
|
5224
|
-
with: mergedViewWithOption.optional(),
|
5225
|
-
isExisting: booleanType(),
|
5226
|
-
withNoData: booleanType().optional(),
|
5201
|
+
as: enumType(["PERMISSIVE", "RESTRICTIVE"]).optional(),
|
5202
|
+
for: enumType(["ALL", "SELECT", "INSERT", "UPDATE", "DELETE"]).optional(),
|
5203
|
+
to: stringType().array().optional(),
|
5227
5204
|
using: stringType().optional(),
|
5228
|
-
|
5205
|
+
withCheck: stringType().optional()
|
5229
5206
|
}).strict();
|
5230
5207
|
var tableV42 = objectType({
|
5231
5208
|
name: stringType(),
|
@@ -5268,7 +5245,8 @@ var table2 = objectType({
|
|
5268
5245
|
indexes: recordType(stringType(), index2),
|
5269
5246
|
foreignKeys: recordType(stringType(), fk2),
|
5270
5247
|
compositePrimaryKeys: recordType(stringType(), compositePK2),
|
5271
|
-
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({})
|
5248
|
+
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({}),
|
5249
|
+
policies: recordType(stringType(), policy).default({})
|
5272
5250
|
}).strict();
|
5273
5251
|
var schemaHash2 = objectType({
|
5274
5252
|
id: stringType(),
|
@@ -5361,8 +5339,8 @@ var pgSchemaInternal = objectType({
|
|
5361
5339
|
tables: recordType(stringType(), table2),
|
5362
5340
|
enums: recordType(stringType(), enumSchema),
|
5363
5341
|
schemas: recordType(stringType(), stringType()),
|
5364
|
-
views: recordType(stringType(), view).default({}),
|
5365
5342
|
sequences: recordType(stringType(), sequenceSchema).default({}),
|
5343
|
+
roles: recordType(stringType(), roleSchema).default({}),
|
5366
5344
|
_meta: objectType({
|
5367
5345
|
schemas: recordType(stringType(), stringType()),
|
5368
5346
|
tables: recordType(stringType(), stringType()),
|
@@ -5377,7 +5355,8 @@ var tableSquashed2 = objectType({
|
|
5377
5355
|
indexes: recordType(stringType(), stringType()),
|
5378
5356
|
foreignKeys: recordType(stringType(), stringType()),
|
5379
5357
|
compositePrimaryKeys: recordType(stringType(), stringType()),
|
5380
|
-
uniqueConstraints: recordType(stringType(), stringType())
|
5358
|
+
uniqueConstraints: recordType(stringType(), stringType()),
|
5359
|
+
policies: recordType(stringType(), stringType())
|
5381
5360
|
}).strict();
|
5382
5361
|
var tableSquashedV42 = objectType({
|
5383
5362
|
name: stringType(),
|
@@ -5406,8 +5385,8 @@ var pgSchemaSquashed = objectType({
|
|
5406
5385
|
tables: recordType(stringType(), tableSquashed2),
|
5407
5386
|
enums: recordType(stringType(), enumSchema),
|
5408
5387
|
schemas: recordType(stringType(), stringType()),
|
5409
|
-
|
5410
|
-
|
5388
|
+
sequences: recordType(stringType(), sequenceSquashed),
|
5389
|
+
roles: recordType(stringType(), roleSchema).default({})
|
5411
5390
|
}).strict();
|
5412
5391
|
var pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
|
5413
5392
|
var pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
|
@@ -5779,12 +5758,18 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
|
|
5779
5758
|
const removedColumns = columnNames1.filter((it) => !set2.has(it));
|
5780
5759
|
return { addedColumns, removedColumns };
|
5781
5760
|
}
|
5761
|
+
function getColumnCasing(column4, casing) {
|
5762
|
+
if (!column4.name)
|
5763
|
+
return "";
|
5764
|
+
return !column4.keyAsName || casing === void 0 ? column4.name : casing === "camelCase" ? toCamelCase(column4.name) : toSnakeCase(column4.name);
|
5765
|
+
}
|
5782
5766
|
export {
|
5783
5767
|
assertV1OutFolder,
|
5784
5768
|
columnRenameKey,
|
5785
5769
|
copy,
|
5786
5770
|
dryJournal,
|
5787
5771
|
findAddedAndRemoved,
|
5772
|
+
getColumnCasing,
|
5788
5773
|
isPgArrayType,
|
5789
5774
|
kloudMeta,
|
5790
5775
|
normalisePGliteUrl,
|