drizzle-kit 0.26.1 → 0.26.2-05e88e4
Sign up to get free protection for your applications and to get access to all the features.
- package/api.d.mts +103 -1
- package/api.d.ts +103 -1
- package/api.js +1511 -567
- package/api.mjs +1511 -567
- package/bin.cjs +1036 -147
- package/index.d.mts +7 -0
- package/index.d.ts +7 -0
- package/package.json +2 -2
- package/utils.js +23 -3
- package/utils.mjs +23 -3
package/api.js
CHANGED
@@ -2475,9 +2475,9 @@ var require_inflight = __commonJS({
|
|
2475
2475
|
}
|
2476
2476
|
function slice(args) {
|
2477
2477
|
var length = args.length;
|
2478
|
-
var
|
2479
|
-
for (var i = 0; i < length; i++)
|
2480
|
-
return
|
2478
|
+
var array2 = [];
|
2479
|
+
for (var i = 0; i < length; i++) array2[i] = args[i];
|
2480
|
+
return array2;
|
2481
2481
|
}
|
2482
2482
|
}
|
2483
2483
|
});
|
@@ -3647,13 +3647,13 @@ function processCreateParams(params) {
|
|
3647
3647
|
if (errorMap2)
|
3648
3648
|
return { errorMap: errorMap2, description };
|
3649
3649
|
const customMap = (iss, ctx) => {
|
3650
|
-
var
|
3650
|
+
var _a326, _b233;
|
3651
3651
|
const { message } = params;
|
3652
3652
|
if (iss.code === "invalid_enum_value") {
|
3653
3653
|
return { message: message !== null && message !== void 0 ? message : ctx.defaultError };
|
3654
3654
|
}
|
3655
3655
|
if (typeof ctx.data === "undefined") {
|
3656
|
-
return { message: (
|
3656
|
+
return { message: (_a326 = message !== null && message !== void 0 ? message : required_error) !== null && _a326 !== void 0 ? _a326 : ctx.defaultError };
|
3657
3657
|
}
|
3658
3658
|
if (iss.code !== "invalid_type")
|
3659
3659
|
return { message: ctx.defaultError };
|
@@ -3820,8 +3820,8 @@ var init_lib = __esm({
|
|
3820
3820
|
return void 0;
|
3821
3821
|
};
|
3822
3822
|
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
3823
|
-
function joinValues(
|
3824
|
-
return
|
3823
|
+
function joinValues(array2, separator = " | ") {
|
3824
|
+
return array2.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
|
3825
3825
|
}
|
3826
3826
|
util2.joinValues = joinValues;
|
3827
3827
|
util2.jsonStringifyReplacer = (_2, value) => {
|
@@ -4319,11 +4319,11 @@ var init_lib = __esm({
|
|
4319
4319
|
throw result.error;
|
4320
4320
|
}
|
4321
4321
|
safeParse(data, params) {
|
4322
|
-
var
|
4322
|
+
var _a326;
|
4323
4323
|
const ctx = {
|
4324
4324
|
common: {
|
4325
4325
|
issues: [],
|
4326
|
-
async: (
|
4326
|
+
async: (_a326 = params === null || params === void 0 ? void 0 : params.async) !== null && _a326 !== void 0 ? _a326 : false,
|
4327
4327
|
contextualErrorMap: params === null || params === void 0 ? void 0 : params.errorMap
|
4328
4328
|
},
|
4329
4329
|
path: (params === null || params === void 0 ? void 0 : params.path) || [],
|
@@ -4645,7 +4645,7 @@ var init_lib = __esm({
|
|
4645
4645
|
} else if (check.kind === "url") {
|
4646
4646
|
try {
|
4647
4647
|
new URL(input.data);
|
4648
|
-
} catch (
|
4648
|
+
} catch (_a326) {
|
4649
4649
|
ctx = this._getOrReturnCtx(input, ctx);
|
4650
4650
|
addIssueToContext(ctx, {
|
4651
4651
|
validation: "url",
|
@@ -4815,7 +4815,7 @@ var init_lib = __esm({
|
|
4815
4815
|
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
4816
4816
|
}
|
4817
4817
|
datetime(options) {
|
4818
|
-
var
|
4818
|
+
var _a326, _b233;
|
4819
4819
|
if (typeof options === "string") {
|
4820
4820
|
return this._addCheck({
|
4821
4821
|
kind: "datetime",
|
@@ -4828,7 +4828,7 @@ var init_lib = __esm({
|
|
4828
4828
|
return this._addCheck({
|
4829
4829
|
kind: "datetime",
|
4830
4830
|
precision: typeof (options === null || options === void 0 ? void 0 : options.precision) === "undefined" ? null : options === null || options === void 0 ? void 0 : options.precision,
|
4831
|
-
offset: (
|
4831
|
+
offset: (_a326 = options === null || options === void 0 ? void 0 : options.offset) !== null && _a326 !== void 0 ? _a326 : false,
|
4832
4832
|
local: (_b233 = options === null || options === void 0 ? void 0 : options.local) !== null && _b233 !== void 0 ? _b233 : false,
|
4833
4833
|
...errorUtil.errToObj(options === null || options === void 0 ? void 0 : options.message)
|
4834
4834
|
});
|
@@ -4992,11 +4992,11 @@ var init_lib = __esm({
|
|
4992
4992
|
}
|
4993
4993
|
};
|
4994
4994
|
ZodString.create = (params) => {
|
4995
|
-
var
|
4995
|
+
var _a326;
|
4996
4996
|
return new ZodString({
|
4997
4997
|
checks: [],
|
4998
4998
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
4999
|
-
coerce: (
|
4999
|
+
coerce: (_a326 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a326 !== void 0 ? _a326 : false,
|
5000
5000
|
...processCreateParams(params)
|
5001
5001
|
});
|
5002
5002
|
};
|
@@ -5389,11 +5389,11 @@ var init_lib = __esm({
|
|
5389
5389
|
}
|
5390
5390
|
};
|
5391
5391
|
ZodBigInt.create = (params) => {
|
5392
|
-
var
|
5392
|
+
var _a326;
|
5393
5393
|
return new ZodBigInt({
|
5394
5394
|
checks: [],
|
5395
5395
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
5396
|
-
coerce: (
|
5396
|
+
coerce: (_a326 = params === null || params === void 0 ? void 0 : params.coerce) !== null && _a326 !== void 0 ? _a326 : false,
|
5397
5397
|
...processCreateParams(params)
|
5398
5398
|
});
|
5399
5399
|
};
|
@@ -5873,8 +5873,8 @@ var init_lib = __esm({
|
|
5873
5873
|
unknownKeys: "strict",
|
5874
5874
|
...message !== void 0 ? {
|
5875
5875
|
errorMap: (issue, ctx) => {
|
5876
|
-
var
|
5877
|
-
const defaultError = (_c11 = (_b233 = (
|
5876
|
+
var _a326, _b233, _c11, _d5;
|
5877
|
+
const defaultError = (_c11 = (_b233 = (_a326 = this._def).errorMap) === null || _b233 === void 0 ? void 0 : _b233.call(_a326, issue, ctx).message) !== null && _c11 !== void 0 ? _c11 : ctx.defaultError;
|
5878
5878
|
if (issue.code === "unrecognized_keys")
|
5879
5879
|
return {
|
5880
5880
|
message: (_d5 = errorUtil.errToObj(message).message) !== null && _d5 !== void 0 ? _d5 : defaultError
|
@@ -7722,7 +7722,7 @@ var init_vector = __esm({
|
|
7722
7722
|
});
|
7723
7723
|
|
7724
7724
|
// src/serializer/pgSchema.ts
|
7725
|
-
var indexV2, columnV2, tableV2, enumSchemaV1, enumSchema, pgSchemaV2, references, columnV1, tableV1, pgSchemaV1, indexColumn, index2, indexV4, indexV5, indexV6, fk2, sequenceSchema, sequenceSquashed, columnV7, column2, checkConstraint2, columnSquashed, tableV32, compositePK2, uniqueConstraint2, viewWithOption, matViewWithOption, mergedViewWithOption, view2, tableV42, tableV5, tableV6, tableV7, table2, schemaHash2, kitInternals2, pgSchemaInternalV3, pgSchemaInternalV4, pgSchemaInternalV5, pgSchemaInternalV6, pgSchemaExternal, pgSchemaInternalV7, pgSchemaInternal, tableSquashed2, tableSquashedV42, pgSchemaSquashedV4, pgSchemaSquashedV6, pgSchemaSquashed, pgSchemaV3, pgSchemaV4, pgSchemaV5, pgSchemaV6, pgSchemaV7, pgSchema, backwardCompatiblePgSchema, PgSquasher, squashPgScheme, dryPg;
|
7725
|
+
var indexV2, columnV2, tableV2, enumSchemaV1, enumSchema, pgSchemaV2, references, columnV1, tableV1, pgSchemaV1, indexColumn, index2, indexV4, indexV5, indexV6, fk2, sequenceSchema, roleSchema, sequenceSquashed, columnV7, column2, checkConstraint2, columnSquashed, tableV32, compositePK2, uniqueConstraint2, policy, viewWithOption, matViewWithOption, mergedViewWithOption, view2, tableV42, tableV5, tableV6, tableV7, table2, schemaHash2, kitInternals2, pgSchemaInternalV3, pgSchemaInternalV4, pgSchemaInternalV5, pgSchemaInternalV6, pgSchemaExternal, pgSchemaInternalV7, pgSchemaInternal, tableSquashed2, tableSquashedV42, pgSchemaSquashedV4, pgSchemaSquashedV6, pgSchemaSquashed, pgSchemaV3, pgSchemaV4, pgSchemaV5, pgSchemaV6, pgSchemaV7, pgSchema, backwardCompatiblePgSchema, PgSquasher, squashPgScheme, dryPg;
|
7726
7726
|
var init_pgSchema = __esm({
|
7727
7727
|
"src/serializer/pgSchema.ts"() {
|
7728
7728
|
"use strict";
|
@@ -7854,6 +7854,12 @@ var init_pgSchema = __esm({
|
|
7854
7854
|
cycle: booleanType().optional(),
|
7855
7855
|
schema: stringType()
|
7856
7856
|
}).strict();
|
7857
|
+
roleSchema = objectType({
|
7858
|
+
name: stringType(),
|
7859
|
+
createDb: booleanType().optional(),
|
7860
|
+
createRole: booleanType().optional(),
|
7861
|
+
inherit: booleanType().optional()
|
7862
|
+
}).strict();
|
7857
7863
|
sequenceSquashed = objectType({
|
7858
7864
|
name: stringType(),
|
7859
7865
|
schema: stringType(),
|
@@ -7921,6 +7927,14 @@ var init_pgSchema = __esm({
|
|
7921
7927
|
columns: stringType().array(),
|
7922
7928
|
nullsNotDistinct: booleanType()
|
7923
7929
|
}).strict();
|
7930
|
+
policy = objectType({
|
7931
|
+
name: stringType(),
|
7932
|
+
as: enumType(["PERMISSIVE", "RESTRICTIVE"]).optional(),
|
7933
|
+
for: enumType(["ALL", "SELECT", "INSERT", "UPDATE", "DELETE"]).optional(),
|
7934
|
+
to: stringType().array().optional(),
|
7935
|
+
using: stringType().optional(),
|
7936
|
+
withCheck: stringType().optional()
|
7937
|
+
}).strict();
|
7924
7938
|
viewWithOption = objectType({
|
7925
7939
|
checkOption: enumType(["local", "cascaded"]).optional(),
|
7926
7940
|
securityBarrier: booleanType().optional(),
|
@@ -8001,7 +8015,9 @@ var init_pgSchema = __esm({
|
|
8001
8015
|
foreignKeys: recordType(stringType(), fk2),
|
8002
8016
|
compositePrimaryKeys: recordType(stringType(), compositePK2),
|
8003
8017
|
uniqueConstraints: recordType(stringType(), uniqueConstraint2).default({}),
|
8004
|
-
|
8018
|
+
policies: recordType(stringType(), policy).default({}),
|
8019
|
+
checkConstraints: recordType(stringType(), checkConstraint2).default({}),
|
8020
|
+
isRLSEnabled: booleanType().default(false)
|
8005
8021
|
}).strict();
|
8006
8022
|
schemaHash2 = objectType({
|
8007
8023
|
id: stringType(),
|
@@ -8096,6 +8112,7 @@ var init_pgSchema = __esm({
|
|
8096
8112
|
schemas: recordType(stringType(), stringType()),
|
8097
8113
|
views: recordType(stringType(), view2).default({}),
|
8098
8114
|
sequences: recordType(stringType(), sequenceSchema).default({}),
|
8115
|
+
roles: recordType(stringType(), roleSchema).default({}),
|
8099
8116
|
_meta: objectType({
|
8100
8117
|
schemas: recordType(stringType(), stringType()),
|
8101
8118
|
tables: recordType(stringType(), stringType()),
|
@@ -8111,7 +8128,9 @@ var init_pgSchema = __esm({
|
|
8111
8128
|
foreignKeys: recordType(stringType(), stringType()),
|
8112
8129
|
compositePrimaryKeys: recordType(stringType(), stringType()),
|
8113
8130
|
uniqueConstraints: recordType(stringType(), stringType()),
|
8114
|
-
|
8131
|
+
policies: recordType(stringType(), stringType()),
|
8132
|
+
checkConstraints: recordType(stringType(), stringType()),
|
8133
|
+
isRLSEnabled: booleanType().default(false)
|
8115
8134
|
}).strict();
|
8116
8135
|
tableSquashedV42 = objectType({
|
8117
8136
|
name: stringType(),
|
@@ -8141,7 +8160,8 @@ var init_pgSchema = __esm({
|
|
8141
8160
|
enums: recordType(stringType(), enumSchema),
|
8142
8161
|
schemas: recordType(stringType(), stringType()),
|
8143
8162
|
views: recordType(stringType(), view2),
|
8144
|
-
sequences: recordType(stringType(), sequenceSquashed)
|
8163
|
+
sequences: recordType(stringType(), sequenceSquashed),
|
8164
|
+
roles: recordType(stringType(), roleSchema).default({})
|
8145
8165
|
}).strict();
|
8146
8166
|
pgSchemaV3 = pgSchemaInternalV3.merge(schemaHash2);
|
8147
8167
|
pgSchemaV4 = pgSchemaInternalV4.merge(schemaHash2);
|
@@ -8224,6 +8244,23 @@ var init_pgSchema = __esm({
|
|
8224
8244
|
squashFK: (fk4) => {
|
8225
8245
|
return `${fk4.name};${fk4.tableFrom};${fk4.columnsFrom.join(",")};${fk4.tableTo};${fk4.columnsTo.join(",")};${fk4.onUpdate ?? ""};${fk4.onDelete ?? ""};${fk4.schemaTo || "public"}`;
|
8226
8246
|
},
|
8247
|
+
squashPolicy: (policy2) => {
|
8248
|
+
return `${policy2.name}--${policy2.as}--${policy2.for}--${policy2.to?.join(",")}--${policy2.using}--${policy2.withCheck}`;
|
8249
|
+
},
|
8250
|
+
unsquashPolicy: (policy2) => {
|
8251
|
+
const splitted = policy2.split("--");
|
8252
|
+
return {
|
8253
|
+
name: splitted[0],
|
8254
|
+
as: splitted[1],
|
8255
|
+
for: splitted[2],
|
8256
|
+
to: splitted[3].split(","),
|
8257
|
+
using: splitted[4] !== "undefined" ? splitted[4] : void 0,
|
8258
|
+
withCheck: splitted[5] !== "undefined" ? splitted[5] : void 0
|
8259
|
+
};
|
8260
|
+
},
|
8261
|
+
squashPolicyPush: (policy2) => {
|
8262
|
+
return `${policy2.name}--${policy2.as}--${policy2.for}--${policy2.to?.join(",")}`;
|
8263
|
+
},
|
8227
8264
|
squashPK: (pk) => {
|
8228
8265
|
return `${pk.columns.join(",")};${pk.name}`;
|
8229
8266
|
},
|
@@ -8336,6 +8373,9 @@ var init_pgSchema = __esm({
|
|
8336
8373
|
return PgSquasher.squashUnique(unq);
|
8337
8374
|
}
|
8338
8375
|
);
|
8376
|
+
const squashedPolicies = mapValues(it[1].policies, (policy2) => {
|
8377
|
+
return action === "push" ? PgSquasher.squashPolicyPush(policy2) : PgSquasher.squashPolicy(policy2);
|
8378
|
+
});
|
8339
8379
|
const squashedChecksContraints = mapValues(
|
8340
8380
|
it[1].checkConstraints,
|
8341
8381
|
(check) => {
|
@@ -8352,7 +8392,9 @@ var init_pgSchema = __esm({
|
|
8352
8392
|
foreignKeys: squashedFKs,
|
8353
8393
|
compositePrimaryKeys: squashedPKs,
|
8354
8394
|
uniqueConstraints: squashedUniqueConstraints,
|
8355
|
-
|
8395
|
+
policies: squashedPolicies,
|
8396
|
+
checkConstraints: squashedChecksContraints,
|
8397
|
+
isRLSEnabled: it[1].isRLSEnabled ?? false
|
8356
8398
|
}
|
8357
8399
|
];
|
8358
8400
|
})
|
@@ -8376,7 +8418,8 @@ var init_pgSchema = __esm({
|
|
8376
8418
|
enums: json3.enums,
|
8377
8419
|
schemas: json3.schemas,
|
8378
8420
|
views: json3.views,
|
8379
|
-
sequences: mappedSequences
|
8421
|
+
sequences: mappedSequences,
|
8422
|
+
roles: json3.roles
|
8380
8423
|
};
|
8381
8424
|
};
|
8382
8425
|
dryPg = pgSchema.parse({
|
@@ -8760,7 +8803,7 @@ var init_utils = __esm({
|
|
8760
8803
|
});
|
8761
8804
|
|
8762
8805
|
// src/cli/views.ts
|
8763
|
-
var import_hanji, warning, error, isRenamePromptItem, ResolveColumnSelect, tableKey, ResolveSelect, ResolveSchemasSelect, Spinner, ProgressView;
|
8806
|
+
var import_hanji, warning, error, isRenamePromptItem, ResolveColumnSelect, tableKey, ResolveSelectNamed, ResolveSelect, ResolveSchemasSelect, Spinner, ProgressView;
|
8764
8807
|
var init_views = __esm({
|
8765
8808
|
"src/cli/views.ts"() {
|
8766
8809
|
"use strict";
|
@@ -8825,6 +8868,53 @@ Is ${source_default.bold.blue(
|
|
8825
8868
|
tableKey = (it) => {
|
8826
8869
|
return it.schema === "public" || !it.schema ? it.name : `${it.schema}.${it.name}`;
|
8827
8870
|
};
|
8871
|
+
ResolveSelectNamed = class extends import_hanji.Prompt {
|
8872
|
+
constructor(base, data, entityType) {
|
8873
|
+
super();
|
8874
|
+
this.base = base;
|
8875
|
+
this.entityType = entityType;
|
8876
|
+
this.on("attach", (terminal) => terminal.toggleCursor("hide"));
|
8877
|
+
this.state = new import_hanji.SelectState(data);
|
8878
|
+
this.state.bind(this);
|
8879
|
+
this.base = base;
|
8880
|
+
}
|
8881
|
+
render(status) {
|
8882
|
+
if (status === "submitted" || status === "aborted") {
|
8883
|
+
return "";
|
8884
|
+
}
|
8885
|
+
const key = this.base.name;
|
8886
|
+
let text4 = `
|
8887
|
+
Is ${source_default.bold.blue(key)} ${this.entityType} created or renamed from another ${this.entityType}?
|
8888
|
+
`;
|
8889
|
+
const isSelectedRenamed = isRenamePromptItem(
|
8890
|
+
this.state.items[this.state.selectedIdx]
|
8891
|
+
);
|
8892
|
+
const selectedPrefix = isSelectedRenamed ? source_default.yellow("\u276F ") : source_default.green("\u276F ");
|
8893
|
+
const labelLength = this.state.items.filter((it) => isRenamePromptItem(it)).map((_2) => {
|
8894
|
+
const it = _2;
|
8895
|
+
const keyFrom = it.from.name;
|
8896
|
+
return key.length + 3 + keyFrom.length;
|
8897
|
+
}).reduce((a, b) => {
|
8898
|
+
if (a > b) {
|
8899
|
+
return a;
|
8900
|
+
}
|
8901
|
+
return b;
|
8902
|
+
}, 0);
|
8903
|
+
const entityType = this.entityType;
|
8904
|
+
this.state.items.forEach((it, idx) => {
|
8905
|
+
const isSelected = idx === this.state.selectedIdx;
|
8906
|
+
const isRenamed = isRenamePromptItem(it);
|
8907
|
+
const title = isRenamed ? `${it.from.name} \u203A ${it.to.name}`.padEnd(labelLength, " ") : it.name.padEnd(labelLength, " ");
|
8908
|
+
const label = isRenamed ? `${source_default.yellow("~")} ${title} ${source_default.gray(`rename ${entityType}`)}` : `${source_default.green("+")} ${title} ${source_default.gray(`create ${entityType}`)}`;
|
8909
|
+
text4 += isSelected ? `${selectedPrefix}${label}` : ` ${label}`;
|
8910
|
+
text4 += idx != this.state.items.length - 1 ? "\n" : "";
|
8911
|
+
});
|
8912
|
+
return text4;
|
8913
|
+
}
|
8914
|
+
result() {
|
8915
|
+
return this.state.items[this.state.selectedIdx];
|
8916
|
+
}
|
8917
|
+
};
|
8828
8918
|
ResolveSelect = class extends import_hanji.Prompt {
|
8829
8919
|
constructor(base, data, entityType) {
|
8830
8920
|
super();
|
@@ -9041,57 +9131,57 @@ var require_heap = __commonJS({
|
|
9041
9131
|
}
|
9042
9132
|
return [].splice.apply(a, [lo, lo - lo].concat(x)), x;
|
9043
9133
|
};
|
9044
|
-
heappush = function(
|
9134
|
+
heappush = function(array2, item, cmp) {
|
9045
9135
|
if (cmp == null) {
|
9046
9136
|
cmp = defaultCmp;
|
9047
9137
|
}
|
9048
|
-
|
9049
|
-
return _siftdown(
|
9138
|
+
array2.push(item);
|
9139
|
+
return _siftdown(array2, 0, array2.length - 1, cmp);
|
9050
9140
|
};
|
9051
|
-
heappop = function(
|
9141
|
+
heappop = function(array2, cmp) {
|
9052
9142
|
var lastelt, returnitem;
|
9053
9143
|
if (cmp == null) {
|
9054
9144
|
cmp = defaultCmp;
|
9055
9145
|
}
|
9056
|
-
lastelt =
|
9057
|
-
if (
|
9058
|
-
returnitem =
|
9059
|
-
|
9060
|
-
_siftup(
|
9146
|
+
lastelt = array2.pop();
|
9147
|
+
if (array2.length) {
|
9148
|
+
returnitem = array2[0];
|
9149
|
+
array2[0] = lastelt;
|
9150
|
+
_siftup(array2, 0, cmp);
|
9061
9151
|
} else {
|
9062
9152
|
returnitem = lastelt;
|
9063
9153
|
}
|
9064
9154
|
return returnitem;
|
9065
9155
|
};
|
9066
|
-
heapreplace = function(
|
9156
|
+
heapreplace = function(array2, item, cmp) {
|
9067
9157
|
var returnitem;
|
9068
9158
|
if (cmp == null) {
|
9069
9159
|
cmp = defaultCmp;
|
9070
9160
|
}
|
9071
|
-
returnitem =
|
9072
|
-
|
9073
|
-
_siftup(
|
9161
|
+
returnitem = array2[0];
|
9162
|
+
array2[0] = item;
|
9163
|
+
_siftup(array2, 0, cmp);
|
9074
9164
|
return returnitem;
|
9075
9165
|
};
|
9076
|
-
heappushpop = function(
|
9166
|
+
heappushpop = function(array2, item, cmp) {
|
9077
9167
|
var _ref;
|
9078
9168
|
if (cmp == null) {
|
9079
9169
|
cmp = defaultCmp;
|
9080
9170
|
}
|
9081
|
-
if (
|
9082
|
-
_ref = [
|
9083
|
-
_siftup(
|
9171
|
+
if (array2.length && cmp(array2[0], item) < 0) {
|
9172
|
+
_ref = [array2[0], item], item = _ref[0], array2[0] = _ref[1];
|
9173
|
+
_siftup(array2, 0, cmp);
|
9084
9174
|
}
|
9085
9175
|
return item;
|
9086
9176
|
};
|
9087
|
-
heapify = function(
|
9177
|
+
heapify = function(array2, cmp) {
|
9088
9178
|
var i, _i2, _j2, _len, _ref, _ref1, _results, _results1;
|
9089
9179
|
if (cmp == null) {
|
9090
9180
|
cmp = defaultCmp;
|
9091
9181
|
}
|
9092
9182
|
_ref1 = function() {
|
9093
9183
|
_results1 = [];
|
9094
|
-
for (var _j3 = 0, _ref2 = floor(
|
9184
|
+
for (var _j3 = 0, _ref2 = floor(array2.length / 2); 0 <= _ref2 ? _j3 < _ref2 : _j3 > _ref2; 0 <= _ref2 ? _j3++ : _j3--) {
|
9095
9185
|
_results1.push(_j3);
|
9096
9186
|
}
|
9097
9187
|
return _results1;
|
@@ -9099,51 +9189,51 @@ var require_heap = __commonJS({
|
|
9099
9189
|
_results = [];
|
9100
9190
|
for (_i2 = 0, _len = _ref1.length; _i2 < _len; _i2++) {
|
9101
9191
|
i = _ref1[_i2];
|
9102
|
-
_results.push(_siftup(
|
9192
|
+
_results.push(_siftup(array2, i, cmp));
|
9103
9193
|
}
|
9104
9194
|
return _results;
|
9105
9195
|
};
|
9106
|
-
updateItem = function(
|
9196
|
+
updateItem = function(array2, item, cmp) {
|
9107
9197
|
var pos;
|
9108
9198
|
if (cmp == null) {
|
9109
9199
|
cmp = defaultCmp;
|
9110
9200
|
}
|
9111
|
-
pos =
|
9201
|
+
pos = array2.indexOf(item);
|
9112
9202
|
if (pos === -1) {
|
9113
9203
|
return;
|
9114
9204
|
}
|
9115
|
-
_siftdown(
|
9116
|
-
return _siftup(
|
9205
|
+
_siftdown(array2, 0, pos, cmp);
|
9206
|
+
return _siftup(array2, pos, cmp);
|
9117
9207
|
};
|
9118
|
-
nlargest = function(
|
9208
|
+
nlargest = function(array2, n, cmp) {
|
9119
9209
|
var elem, result, _i2, _len, _ref;
|
9120
9210
|
if (cmp == null) {
|
9121
9211
|
cmp = defaultCmp;
|
9122
9212
|
}
|
9123
|
-
result =
|
9213
|
+
result = array2.slice(0, n);
|
9124
9214
|
if (!result.length) {
|
9125
9215
|
return result;
|
9126
9216
|
}
|
9127
9217
|
heapify(result, cmp);
|
9128
|
-
_ref =
|
9218
|
+
_ref = array2.slice(n);
|
9129
9219
|
for (_i2 = 0, _len = _ref.length; _i2 < _len; _i2++) {
|
9130
9220
|
elem = _ref[_i2];
|
9131
9221
|
heappushpop(result, elem, cmp);
|
9132
9222
|
}
|
9133
9223
|
return result.sort(cmp).reverse();
|
9134
9224
|
};
|
9135
|
-
nsmallest = function(
|
9225
|
+
nsmallest = function(array2, n, cmp) {
|
9136
9226
|
var elem, i, los, result, _i2, _j2, _len, _ref, _ref1, _results;
|
9137
9227
|
if (cmp == null) {
|
9138
9228
|
cmp = defaultCmp;
|
9139
9229
|
}
|
9140
|
-
if (n * 10 <=
|
9141
|
-
result =
|
9230
|
+
if (n * 10 <= array2.length) {
|
9231
|
+
result = array2.slice(0, n).sort(cmp);
|
9142
9232
|
if (!result.length) {
|
9143
9233
|
return result;
|
9144
9234
|
}
|
9145
9235
|
los = result[result.length - 1];
|
9146
|
-
_ref =
|
9236
|
+
_ref = array2.slice(n);
|
9147
9237
|
for (_i2 = 0, _len = _ref.length; _i2 < _len; _i2++) {
|
9148
9238
|
elem = _ref[_i2];
|
9149
9239
|
if (cmp(elem, los) < 0) {
|
@@ -9154,51 +9244,51 @@ var require_heap = __commonJS({
|
|
9154
9244
|
}
|
9155
9245
|
return result;
|
9156
9246
|
}
|
9157
|
-
heapify(
|
9247
|
+
heapify(array2, cmp);
|
9158
9248
|
_results = [];
|
9159
|
-
for (i = _j2 = 0, _ref1 = min2(n,
|
9160
|
-
_results.push(heappop(
|
9249
|
+
for (i = _j2 = 0, _ref1 = min2(n, array2.length); 0 <= _ref1 ? _j2 < _ref1 : _j2 > _ref1; i = 0 <= _ref1 ? ++_j2 : --_j2) {
|
9250
|
+
_results.push(heappop(array2, cmp));
|
9161
9251
|
}
|
9162
9252
|
return _results;
|
9163
9253
|
};
|
9164
|
-
_siftdown = function(
|
9254
|
+
_siftdown = function(array2, startpos, pos, cmp) {
|
9165
9255
|
var newitem, parent, parentpos;
|
9166
9256
|
if (cmp == null) {
|
9167
9257
|
cmp = defaultCmp;
|
9168
9258
|
}
|
9169
|
-
newitem =
|
9259
|
+
newitem = array2[pos];
|
9170
9260
|
while (pos > startpos) {
|
9171
9261
|
parentpos = pos - 1 >> 1;
|
9172
|
-
parent =
|
9262
|
+
parent = array2[parentpos];
|
9173
9263
|
if (cmp(newitem, parent) < 0) {
|
9174
|
-
|
9264
|
+
array2[pos] = parent;
|
9175
9265
|
pos = parentpos;
|
9176
9266
|
continue;
|
9177
9267
|
}
|
9178
9268
|
break;
|
9179
9269
|
}
|
9180
|
-
return
|
9270
|
+
return array2[pos] = newitem;
|
9181
9271
|
};
|
9182
|
-
_siftup = function(
|
9272
|
+
_siftup = function(array2, pos, cmp) {
|
9183
9273
|
var childpos, endpos, newitem, rightpos, startpos;
|
9184
9274
|
if (cmp == null) {
|
9185
9275
|
cmp = defaultCmp;
|
9186
9276
|
}
|
9187
|
-
endpos =
|
9277
|
+
endpos = array2.length;
|
9188
9278
|
startpos = pos;
|
9189
|
-
newitem =
|
9279
|
+
newitem = array2[pos];
|
9190
9280
|
childpos = 2 * pos + 1;
|
9191
9281
|
while (childpos < endpos) {
|
9192
9282
|
rightpos = childpos + 1;
|
9193
|
-
if (rightpos < endpos && !(cmp(
|
9283
|
+
if (rightpos < endpos && !(cmp(array2[childpos], array2[rightpos]) < 0)) {
|
9194
9284
|
childpos = rightpos;
|
9195
9285
|
}
|
9196
|
-
|
9286
|
+
array2[pos] = array2[childpos];
|
9197
9287
|
pos = childpos;
|
9198
9288
|
childpos = 2 * pos + 1;
|
9199
9289
|
}
|
9200
|
-
|
9201
|
-
return _siftdown(
|
9290
|
+
array2[pos] = newitem;
|
9291
|
+
return _siftdown(array2, startpos, pos, cmp);
|
9202
9292
|
};
|
9203
9293
|
Heap = function() {
|
9204
9294
|
Heap2.push = heappush;
|
@@ -11125,12 +11215,12 @@ var require_lib = __commonJS({
|
|
11125
11215
|
}
|
11126
11216
|
return bestMatch;
|
11127
11217
|
}
|
11128
|
-
scalarize(
|
11218
|
+
scalarize(array2, originals, fuzzyOriginals) {
|
11129
11219
|
const fuzzyMatches = [];
|
11130
11220
|
if (fuzzyOriginals) {
|
11131
11221
|
const keyScores = {};
|
11132
|
-
for (let index4 = 0; index4 <
|
11133
|
-
const item =
|
11222
|
+
for (let index4 = 0; index4 < array2.length; index4++) {
|
11223
|
+
const item = array2[index4];
|
11134
11224
|
if (this.isScalar(item)) {
|
11135
11225
|
continue;
|
11136
11226
|
}
|
@@ -11144,8 +11234,8 @@ var require_lib = __commonJS({
|
|
11144
11234
|
}
|
11145
11235
|
}
|
11146
11236
|
const result = [];
|
11147
|
-
for (let index4 = 0; index4 <
|
11148
|
-
const item =
|
11237
|
+
for (let index4 = 0; index4 < array2.length; index4++) {
|
11238
|
+
const item = array2[index4];
|
11149
11239
|
if (this.isScalar(item)) {
|
11150
11240
|
result.push(item);
|
11151
11241
|
} else {
|
@@ -11367,6 +11457,37 @@ function diffColumns(left, right) {
|
|
11367
11457
|
);
|
11368
11458
|
return alteredTables;
|
11369
11459
|
}
|
11460
|
+
function diffPolicies(left, right) {
|
11461
|
+
left = JSON.parse(JSON.stringify(left));
|
11462
|
+
right = JSON.parse(JSON.stringify(right));
|
11463
|
+
const result = (0, import_json_diff.diff)(left, right) ?? {};
|
11464
|
+
const alteredTables = Object.fromEntries(
|
11465
|
+
Object.entries(result).filter((it) => {
|
11466
|
+
return !(it[0].includes("__added") || it[0].includes("__deleted"));
|
11467
|
+
}).map((tableEntry) => {
|
11468
|
+
const deletedPolicies = Object.entries(tableEntry[1].policies ?? {}).filter((it) => {
|
11469
|
+
return it[0].endsWith("__deleted");
|
11470
|
+
}).map((it) => {
|
11471
|
+
return it[1];
|
11472
|
+
});
|
11473
|
+
const addedPolicies = Object.entries(tableEntry[1].policies ?? {}).filter((it) => {
|
11474
|
+
return it[0].endsWith("__added");
|
11475
|
+
}).map((it) => {
|
11476
|
+
return it[1];
|
11477
|
+
});
|
11478
|
+
tableEntry[1].policies = {
|
11479
|
+
added: addedPolicies,
|
11480
|
+
deleted: deletedPolicies
|
11481
|
+
};
|
11482
|
+
const table4 = left[tableEntry[0]];
|
11483
|
+
return [
|
11484
|
+
tableEntry[0],
|
11485
|
+
{ name: table4.name, schema: table4.schema, ...tableEntry[1] }
|
11486
|
+
];
|
11487
|
+
})
|
11488
|
+
);
|
11489
|
+
return alteredTables;
|
11490
|
+
}
|
11370
11491
|
function applyJsonDiff(json1, json22) {
|
11371
11492
|
json1 = JSON.parse(JSON.stringify(json1));
|
11372
11493
|
json22 = JSON.parse(JSON.stringify(json22));
|
@@ -11376,6 +11497,7 @@ function applyJsonDiff(json1, json22) {
|
|
11376
11497
|
difference.tables = difference.tables || {};
|
11377
11498
|
difference.enums = difference.enums || {};
|
11378
11499
|
difference.sequences = difference.sequences || {};
|
11500
|
+
difference.roles = difference.roles || {};
|
11379
11501
|
difference.views = difference.views || {};
|
11380
11502
|
const schemaKeys = Object.keys(difference.schemas);
|
11381
11503
|
for (let key of schemaKeys) {
|
@@ -11432,6 +11554,10 @@ function applyJsonDiff(json1, json22) {
|
|
11432
11554
|
const alteredSequences = sequencesEntries.filter((it) => !(it[0].includes("__added") || it[0].includes("__deleted")) && "values" in it[1]).map((it) => {
|
11433
11555
|
return json22.sequences[it[0]];
|
11434
11556
|
});
|
11557
|
+
const rolesEntries = Object.entries(difference.roles);
|
11558
|
+
const alteredRoles = rolesEntries.filter((it) => !(it[0].includes("__added") || it[0].includes("__deleted"))).map((it) => {
|
11559
|
+
return json22.roles[it[0]];
|
11560
|
+
});
|
11435
11561
|
const viewsEntries = Object.entries(difference.views);
|
11436
11562
|
const alteredViews = viewsEntries.filter((it) => !(it[0].includes("__added") || it[0].includes("__deleted"))).map(
|
11437
11563
|
([nameWithSchema, view4]) => {
|
@@ -11505,6 +11631,7 @@ function applyJsonDiff(json1, json22) {
|
|
11505
11631
|
alteredTablesWithColumns,
|
11506
11632
|
alteredEnums,
|
11507
11633
|
alteredSequences,
|
11634
|
+
alteredRoles,
|
11508
11635
|
alteredViews
|
11509
11636
|
};
|
11510
11637
|
}
|
@@ -11565,6 +11692,21 @@ var init_jsonDiffer = __esm({
|
|
11565
11692
|
return !it[0].endsWith("__deleted") && !it[0].endsWith("__added");
|
11566
11693
|
})
|
11567
11694
|
);
|
11695
|
+
const deletedPolicies = Object.fromEntries(
|
11696
|
+
Object.entries(table4.policies__deleted || {}).concat(
|
11697
|
+
Object.entries(table4.policies || {}).filter((it) => it[0].includes("__deleted"))
|
11698
|
+
).map((entry) => [entry[0].replace("__deleted", ""), entry[1]])
|
11699
|
+
);
|
11700
|
+
const addedPolicies = Object.fromEntries(
|
11701
|
+
Object.entries(table4.policies__added || {}).concat(
|
11702
|
+
Object.entries(table4.policies || {}).filter((it) => it[0].includes("__added"))
|
11703
|
+
).map((entry) => [entry[0].replace("__added", ""), entry[1]])
|
11704
|
+
);
|
11705
|
+
const alteredPolicies = Object.fromEntries(
|
11706
|
+
Object.entries(table4.policies || {}).filter((it) => {
|
11707
|
+
return !it[0].endsWith("__deleted") && !it[0].endsWith("__added");
|
11708
|
+
})
|
11709
|
+
);
|
11568
11710
|
const deletedForeignKeys = Object.fromEntries(
|
11569
11711
|
Object.entries(table4.foreignKeys__deleted || {}).concat(
|
11570
11712
|
Object.entries(table4.foreignKeys || {}).filter((it) => it[0].includes("__deleted"))
|
@@ -11642,6 +11784,9 @@ var init_jsonDiffer = __esm({
|
|
11642
11784
|
addedUniqueConstraints,
|
11643
11785
|
deletedUniqueConstraints,
|
11644
11786
|
alteredUniqueConstraints,
|
11787
|
+
deletedPolicies,
|
11788
|
+
addedPolicies,
|
11789
|
+
alteredPolicies,
|
11645
11790
|
addedCheckConstraints,
|
11646
11791
|
deletedCheckConstraints,
|
11647
11792
|
alteredCheckConstraints
|
@@ -11944,7 +12089,7 @@ function fromJson(statements, dialect4, action, json22) {
|
|
11944
12089
|
}).filter((it) => it !== "");
|
11945
12090
|
return result;
|
11946
12091
|
}
|
11947
|
-
var pgNativeTypes, isPgNativeType, Convertor, PgCreateTableConvertor, MySqlCreateTableConvertor, SQLiteCreateTableConvertor, PgCreateViewConvertor, MySqlCreateViewConvertor, SqliteCreateViewConvertor, PgDropViewConvertor, MySqlDropViewConvertor, SqliteDropViewConvertor, MySqlAlterViewConvertor, PgRenameViewConvertor, MySqlRenameViewConvertor, PgAlterViewSchemaConvertor, PgAlterViewAddWithOptionConvertor, PgAlterViewDropWithOptionConvertor, PgAlterViewAlterTablespaceConvertor, PgAlterViewAlterUsingConvertor, PgAlterTableAlterColumnSetGenerated, PgAlterTableAlterColumnDropGenerated, PgAlterTableAlterColumnAlterGenerated, PgAlterTableAddUniqueConstraintConvertor, PgAlterTableDropUniqueConstraintConvertor, PgAlterTableAddCheckConstraintConvertor, PgAlterTableDeleteCheckConstraintConvertor, MySQLAlterTableAddUniqueConstraintConvertor, MySQLAlterTableDropUniqueConstraintConvertor, MySqlAlterTableAddCheckConstraintConvertor, MySqlAlterTableDeleteCheckConstraintConvertor, CreatePgSequenceConvertor, DropPgSequenceConvertor, RenamePgSequenceConvertor, MovePgSequenceConvertor, AlterPgSequenceConvertor, CreateTypeEnumConvertor, DropTypeEnumConvertor, AlterTypeAddValueConvertor, AlterTypeSetSchemaConvertor, AlterRenameTypeConvertor, AlterTypeDropValueConvertor, PgDropTableConvertor, MySQLDropTableConvertor, SQLiteDropTableConvertor, PgRenameTableConvertor, SqliteRenameTableConvertor, MySqlRenameTableConvertor, PgAlterTableRenameColumnConvertor, MySqlAlterTableRenameColumnConvertor, SQLiteAlterTableRenameColumnConvertor, PgAlterTableDropColumnConvertor, MySqlAlterTableDropColumnConvertor, SQLiteAlterTableDropColumnConvertor, PgAlterTableAddColumnConvertor, MySqlAlterTableAddColumnConvertor, SQLiteAlterTableAddColumnConvertor, PgAlterTableAlterColumnSetTypeConvertor, PgAlterTableAlterColumnSetDefaultConvertor, PgAlterTableAlterColumnDropDefaultConvertor, PgAlterTableAlterColumnDropGeneratedConvertor, PgAlterTableAlterColumnSetExpressionConvertor, PgAlterTableAlterColumnAlterrGeneratedConvertor, SqliteAlterTableAlterColumnDropGeneratedConvertor, SqliteAlterTableAlterColumnSetExpressionConvertor, SqliteAlterTableAlterColumnAlterGeneratedConvertor, MySqlAlterTableAlterColumnAlterrGeneratedConvertor, MySqlAlterTableAddPk, MySqlAlterTableDropPk, LibSQLModifyColumn, MySqlModifyColumn, PgAlterTableCreateCompositePrimaryKeyConvertor, PgAlterTableDeleteCompositePrimaryKeyConvertor, PgAlterTableAlterCompositePrimaryKeyConvertor, MySqlAlterTableCreateCompositePrimaryKeyConvertor, MySqlAlterTableDeleteCompositePrimaryKeyConvertor, MySqlAlterTableAlterCompositePrimaryKeyConvertor, PgAlterTableAlterColumnSetPrimaryKeyConvertor, PgAlterTableAlterColumnDropPrimaryKeyConvertor, PgAlterTableAlterColumnSetNotNullConvertor, PgAlterTableAlterColumnDropNotNullConvertor, PgCreateForeignKeyConvertor, LibSQLCreateForeignKeyConvertor, MySqlCreateForeignKeyConvertor, PgAlterForeignKeyConvertor, PgDeleteForeignKeyConvertor, MySqlDeleteForeignKeyConvertor, CreatePgIndexConvertor, CreateMySqlIndexConvertor, CreateSqliteIndexConvertor, PgDropIndexConvertor, PgCreateSchemaConvertor, PgRenameSchemaConvertor, PgDropSchemaConvertor, PgAlterTableSetSchemaConvertor, PgAlterTableSetNewSchemaConvertor, PgAlterTableRemoveFromSchemaConvertor, SqliteDropIndexConvertor, MySqlDropIndexConvertor, SQLiteRecreateTableConvertor, LibSQLRecreateTableConvertor, convertors;
|
12092
|
+
var pgNativeTypes, isPgNativeType, Convertor, PgCreateRoleConvertor, PgDropRoleConvertor, PgRenameRoleConvertor, PgAlterRoleConvertor, PgCreatePolicyConvertor, PgDropPolicyConvertor, PgRenamePolicyConvertor, PgAlterPolicyConvertor, PgEnableRlsConvertor, PgDisableRlsConvertor, PgCreateTableConvertor, MySqlCreateTableConvertor, SQLiteCreateTableConvertor, PgCreateViewConvertor, MySqlCreateViewConvertor, SqliteCreateViewConvertor, PgDropViewConvertor, MySqlDropViewConvertor, SqliteDropViewConvertor, MySqlAlterViewConvertor, PgRenameViewConvertor, MySqlRenameViewConvertor, PgAlterViewSchemaConvertor, PgAlterViewAddWithOptionConvertor, PgAlterViewDropWithOptionConvertor, PgAlterViewAlterTablespaceConvertor, PgAlterViewAlterUsingConvertor, PgAlterTableAlterColumnSetGenerated, PgAlterTableAlterColumnDropGenerated, PgAlterTableAlterColumnAlterGenerated, PgAlterTableAddUniqueConstraintConvertor, PgAlterTableDropUniqueConstraintConvertor, PgAlterTableAddCheckConstraintConvertor, PgAlterTableDeleteCheckConstraintConvertor, MySQLAlterTableAddUniqueConstraintConvertor, MySQLAlterTableDropUniqueConstraintConvertor, MySqlAlterTableAddCheckConstraintConvertor, MySqlAlterTableDeleteCheckConstraintConvertor, CreatePgSequenceConvertor, DropPgSequenceConvertor, RenamePgSequenceConvertor, MovePgSequenceConvertor, AlterPgSequenceConvertor, CreateTypeEnumConvertor, DropTypeEnumConvertor, AlterTypeAddValueConvertor, AlterTypeSetSchemaConvertor, AlterRenameTypeConvertor, AlterTypeDropValueConvertor, PgDropTableConvertor, MySQLDropTableConvertor, SQLiteDropTableConvertor, PgRenameTableConvertor, SqliteRenameTableConvertor, MySqlRenameTableConvertor, PgAlterTableRenameColumnConvertor, MySqlAlterTableRenameColumnConvertor, SQLiteAlterTableRenameColumnConvertor, PgAlterTableDropColumnConvertor, MySqlAlterTableDropColumnConvertor, SQLiteAlterTableDropColumnConvertor, PgAlterTableAddColumnConvertor, MySqlAlterTableAddColumnConvertor, SQLiteAlterTableAddColumnConvertor, PgAlterTableAlterColumnSetTypeConvertor, PgAlterTableAlterColumnSetDefaultConvertor, PgAlterTableAlterColumnDropDefaultConvertor, PgAlterTableAlterColumnDropGeneratedConvertor, PgAlterTableAlterColumnSetExpressionConvertor, PgAlterTableAlterColumnAlterrGeneratedConvertor, SqliteAlterTableAlterColumnDropGeneratedConvertor, SqliteAlterTableAlterColumnSetExpressionConvertor, SqliteAlterTableAlterColumnAlterGeneratedConvertor, MySqlAlterTableAlterColumnAlterrGeneratedConvertor, MySqlAlterTableAddPk, MySqlAlterTableDropPk, LibSQLModifyColumn, MySqlModifyColumn, PgAlterTableCreateCompositePrimaryKeyConvertor, PgAlterTableDeleteCompositePrimaryKeyConvertor, PgAlterTableAlterCompositePrimaryKeyConvertor, MySqlAlterTableCreateCompositePrimaryKeyConvertor, MySqlAlterTableDeleteCompositePrimaryKeyConvertor, MySqlAlterTableAlterCompositePrimaryKeyConvertor, PgAlterTableAlterColumnSetPrimaryKeyConvertor, PgAlterTableAlterColumnDropPrimaryKeyConvertor, PgAlterTableAlterColumnSetNotNullConvertor, PgAlterTableAlterColumnDropNotNullConvertor, PgCreateForeignKeyConvertor, LibSQLCreateForeignKeyConvertor, MySqlCreateForeignKeyConvertor, PgAlterForeignKeyConvertor, PgDeleteForeignKeyConvertor, MySqlDeleteForeignKeyConvertor, CreatePgIndexConvertor, CreateMySqlIndexConvertor, CreateSqliteIndexConvertor, PgDropIndexConvertor, PgCreateSchemaConvertor, PgRenameSchemaConvertor, PgDropSchemaConvertor, PgAlterTableSetSchemaConvertor, PgAlterTableSetNewSchemaConvertor, PgAlterTableRemoveFromSchemaConvertor, SqliteDropIndexConvertor, MySqlDropIndexConvertor, SQLiteRecreateTableConvertor, LibSQLRecreateTableConvertor, convertors;
|
11948
12093
|
var init_sqlgenerator = __esm({
|
11949
12094
|
"src/sqlgenerator.ts"() {
|
11950
12095
|
"use strict";
|
@@ -12000,12 +12145,109 @@ var init_sqlgenerator = __esm({
|
|
12000
12145
|
};
|
12001
12146
|
Convertor = class {
|
12002
12147
|
};
|
12148
|
+
PgCreateRoleConvertor = class extends Convertor {
|
12149
|
+
can(statement, dialect4) {
|
12150
|
+
return statement.type === "create_role" && dialect4 === "postgresql";
|
12151
|
+
}
|
12152
|
+
convert(statement) {
|
12153
|
+
return `CREATE ROLE "${statement.name}"${statement.values.createDb || statement.values.createRole || !statement.values.inherit ? ` WITH${statement.values.createDb ? " CREATEDB" : ""}${statement.values.createRole ? " CREATEROLE" : ""}${statement.values.inherit ? "" : " NOINHERIT"}` : ""};`;
|
12154
|
+
}
|
12155
|
+
};
|
12156
|
+
PgDropRoleConvertor = class extends Convertor {
|
12157
|
+
can(statement, dialect4) {
|
12158
|
+
return statement.type === "drop_role" && dialect4 === "postgresql";
|
12159
|
+
}
|
12160
|
+
convert(statement) {
|
12161
|
+
return `DROP ROLE "${statement.name}";`;
|
12162
|
+
}
|
12163
|
+
};
|
12164
|
+
PgRenameRoleConvertor = class extends Convertor {
|
12165
|
+
can(statement, dialect4) {
|
12166
|
+
return statement.type === "rename_role" && dialect4 === "postgresql";
|
12167
|
+
}
|
12168
|
+
convert(statement) {
|
12169
|
+
return `ALTER ROLE "${statement.nameFrom}" RENAME TO "${statement.nameTo}";`;
|
12170
|
+
}
|
12171
|
+
};
|
12172
|
+
PgAlterRoleConvertor = class extends Convertor {
|
12173
|
+
can(statement, dialect4) {
|
12174
|
+
return statement.type === "alter_role" && dialect4 === "postgresql";
|
12175
|
+
}
|
12176
|
+
convert(statement) {
|
12177
|
+
return `ALTER ROLE "${statement.name}"${` WITH${statement.values.createDb ? " CREATEDB" : " NOCREATEDB"}${statement.values.createRole ? " CREATEROLE" : " NOCREATEROLE"}${statement.values.inherit ? " INHERIT" : " NOINHERIT"}`};`;
|
12178
|
+
}
|
12179
|
+
};
|
12180
|
+
PgCreatePolicyConvertor = class extends Convertor {
|
12181
|
+
can(statement, dialect4) {
|
12182
|
+
return statement.type === "create_policy" && dialect4 === "postgresql";
|
12183
|
+
}
|
12184
|
+
convert(statement) {
|
12185
|
+
const policy2 = statement.data;
|
12186
|
+
const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
|
12187
|
+
const usingPart = policy2.using ? ` USING (${policy2.using})` : "";
|
12188
|
+
const withCheckPart = policy2.withCheck ? ` WITH CHECK (${policy2.withCheck})` : "";
|
12189
|
+
const policyToPart = policy2.to?.map(
|
12190
|
+
(v) => ["current_user", "current_role", "session_user", "public"].includes(v) ? v : `"${v}"`
|
12191
|
+
).join(", ");
|
12192
|
+
return `CREATE POLICY "${policy2.name}" ON ${tableNameWithSchema} AS ${policy2.as?.toUpperCase()} FOR ${policy2.for?.toUpperCase()} TO ${policyToPart}${usingPart}${withCheckPart};`;
|
12193
|
+
}
|
12194
|
+
};
|
12195
|
+
PgDropPolicyConvertor = class extends Convertor {
|
12196
|
+
can(statement, dialect4) {
|
12197
|
+
return statement.type === "drop_policy" && dialect4 === "postgresql";
|
12198
|
+
}
|
12199
|
+
convert(statement) {
|
12200
|
+
const policy2 = statement.data;
|
12201
|
+
const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
|
12202
|
+
return `DROP POLICY "${policy2.name}" ON ${tableNameWithSchema} CASCADE;`;
|
12203
|
+
}
|
12204
|
+
};
|
12205
|
+
PgRenamePolicyConvertor = class extends Convertor {
|
12206
|
+
can(statement, dialect4) {
|
12207
|
+
return statement.type === "rename_policy" && dialect4 === "postgresql";
|
12208
|
+
}
|
12209
|
+
convert(statement) {
|
12210
|
+
const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
|
12211
|
+
return `ALTER POLICY "${statement.oldName}" ON ${tableNameWithSchema} RENAME TO "${statement.newName}";`;
|
12212
|
+
}
|
12213
|
+
};
|
12214
|
+
PgAlterPolicyConvertor = class extends Convertor {
|
12215
|
+
can(statement, dialect4) {
|
12216
|
+
return statement.type === "alter_policy" && dialect4 === "postgresql";
|
12217
|
+
}
|
12218
|
+
convert(statement) {
|
12219
|
+
const newPolicy = PgSquasher.unsquashPolicy(statement.newData);
|
12220
|
+
const oldPolicy = PgSquasher.unsquashPolicy(statement.oldData);
|
12221
|
+
const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
|
12222
|
+
const usingPart = newPolicy.using ? ` USING (${newPolicy.using})` : oldPolicy.using ? ` USING (${oldPolicy.using})` : "";
|
12223
|
+
const withCheckPart = newPolicy.withCheck ? ` WITH CHECK (${newPolicy.withCheck})` : oldPolicy.withCheck ? ` WITH CHECK (${oldPolicy.withCheck})` : "";
|
12224
|
+
return `ALTER POLICY "${oldPolicy.name}" ON ${tableNameWithSchema} TO ${newPolicy.to}${usingPart}${withCheckPart};`;
|
12225
|
+
}
|
12226
|
+
};
|
12227
|
+
PgEnableRlsConvertor = class extends Convertor {
|
12228
|
+
can(statement, dialect4) {
|
12229
|
+
return statement.type === "enable_rls" && dialect4 === "postgresql";
|
12230
|
+
}
|
12231
|
+
convert(statement) {
|
12232
|
+
const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
|
12233
|
+
return `ALTER TABLE ${tableNameWithSchema} ENABLE ROW LEVEL SECURITY;`;
|
12234
|
+
}
|
12235
|
+
};
|
12236
|
+
PgDisableRlsConvertor = class extends Convertor {
|
12237
|
+
can(statement, dialect4) {
|
12238
|
+
return statement.type === "disable_rls" && dialect4 === "postgresql";
|
12239
|
+
}
|
12240
|
+
convert(statement) {
|
12241
|
+
const tableNameWithSchema = statement.schema ? `"${statement.schema}"."${statement.tableName}"` : `"${statement.tableName}"`;
|
12242
|
+
return `ALTER TABLE ${tableNameWithSchema} DISABLE ROW LEVEL SECURITY;`;
|
12243
|
+
}
|
12244
|
+
};
|
12003
12245
|
PgCreateTableConvertor = class extends Convertor {
|
12004
12246
|
can(statement, dialect4) {
|
12005
12247
|
return statement.type === "create_table" && dialect4 === "postgresql";
|
12006
12248
|
}
|
12007
12249
|
convert(st) {
|
12008
|
-
const { tableName, schema: schema4, columns, compositePKs, uniqueConstraints, checkConstraints } = st;
|
12250
|
+
const { tableName, schema: schema4, columns, compositePKs, uniqueConstraints, checkConstraints, policies, isRLSEnabled } = st;
|
12009
12251
|
let statement = "";
|
12010
12252
|
const name2 = schema4 ? `"${schema4}"."${tableName}"` : `"${tableName}"`;
|
12011
12253
|
statement += `CREATE TABLE IF NOT EXISTS ${name2} (
|
@@ -12049,7 +12291,12 @@ var init_sqlgenerator = __esm({
|
|
12049
12291
|
);`;
|
12050
12292
|
statement += `
|
12051
12293
|
`;
|
12052
|
-
|
12294
|
+
const enableRls = new PgEnableRlsConvertor().convert({
|
12295
|
+
type: "enable_rls",
|
12296
|
+
tableName,
|
12297
|
+
schema: schema4
|
12298
|
+
});
|
12299
|
+
return [statement, ...policies && policies.length > 0 || isRLSEnabled ? [enableRls] : []];
|
12053
12300
|
}
|
12054
12301
|
};
|
12055
12302
|
MySqlCreateTableConvertor = class extends Convertor {
|
@@ -12648,9 +12895,21 @@ WITH ${withCheckOption} CHECK OPTION` : "";
|
|
12648
12895
|
return statement.type === "drop_table" && dialect4 === "postgresql";
|
12649
12896
|
}
|
12650
12897
|
convert(statement) {
|
12651
|
-
const { tableName, schema: schema4 } = statement;
|
12898
|
+
const { tableName, schema: schema4, policies } = statement;
|
12652
12899
|
const tableNameWithSchema = schema4 ? `"${schema4}"."${tableName}"` : `"${tableName}"`;
|
12653
|
-
|
12900
|
+
const dropPolicyConvertor = new PgDropPolicyConvertor();
|
12901
|
+
const droppedPolicies = policies?.map((p) => {
|
12902
|
+
return dropPolicyConvertor.convert({
|
12903
|
+
type: "drop_policy",
|
12904
|
+
tableName,
|
12905
|
+
data: PgSquasher.unsquashPolicy(p),
|
12906
|
+
schema: schema4
|
12907
|
+
});
|
12908
|
+
}) ?? [];
|
12909
|
+
return [
|
12910
|
+
...droppedPolicies,
|
12911
|
+
`DROP TABLE ${tableNameWithSchema} CASCADE;`
|
12912
|
+
];
|
12654
12913
|
}
|
12655
12914
|
};
|
12656
12915
|
MySQLDropTableConvertor = class extends Convertor {
|
@@ -13852,6 +14111,16 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
13852
14111
|
convertors.push(new PgAlterTableAlterColumnDropNotNullConvertor());
|
13853
14112
|
convertors.push(new PgAlterTableAlterColumnSetDefaultConvertor());
|
13854
14113
|
convertors.push(new PgAlterTableAlterColumnDropDefaultConvertor());
|
14114
|
+
convertors.push(new PgAlterPolicyConvertor());
|
14115
|
+
convertors.push(new PgCreatePolicyConvertor());
|
14116
|
+
convertors.push(new PgDropPolicyConvertor());
|
14117
|
+
convertors.push(new PgRenamePolicyConvertor());
|
14118
|
+
convertors.push(new PgEnableRlsConvertor());
|
14119
|
+
convertors.push(new PgDisableRlsConvertor());
|
14120
|
+
convertors.push(new PgDropRoleConvertor());
|
14121
|
+
convertors.push(new PgAlterRoleConvertor());
|
14122
|
+
convertors.push(new PgCreateRoleConvertor());
|
14123
|
+
convertors.push(new PgRenameRoleConvertor());
|
13855
14124
|
convertors.push(new PgAlterTableAlterColumnSetExpressionConvertor());
|
13856
14125
|
convertors.push(new PgAlterTableAlterColumnDropGeneratedConvertor());
|
13857
14126
|
convertors.push(new PgAlterTableAlterColumnAlterrGeneratedConvertor());
|
@@ -14151,7 +14420,7 @@ var init_sqlitePushUtils = __esm({
|
|
14151
14420
|
});
|
14152
14421
|
|
14153
14422
|
// src/jsonStatements.ts
|
14154
|
-
var preparePgCreateTableJson, prepareMySqlCreateTableJson, prepareSQLiteCreateTable, prepareDropTableJson, prepareRenameTableJson, prepareCreateEnumJson, prepareAddValuesToEnumJson, prepareDropEnumValues, prepareDropEnumJson, prepareMoveEnumJson, prepareRenameEnumJson, prepareCreateSequenceJson, prepareAlterSequenceJson, prepareDropSequenceJson, prepareMoveSequenceJson, prepareRenameSequenceJson, prepareCreateSchemasJson, prepareRenameSchemasJson, prepareDeleteSchemasJson, prepareRenameColumns, _prepareDropColumns, _prepareAddColumns, _prepareSqliteAddColumns, prepareAlterColumnsMysql, preparePgAlterColumns, prepareSqliteAlterColumns, preparePgCreateIndexesJson, prepareCreateIndexesJson, prepareCreateReferencesJson, prepareLibSQLCreateReferencesJson, prepareDropReferencesJson, prepareLibSQLDropReferencesJson, prepareAlterReferencesJson, prepareDropIndexesJson, prepareAddCompositePrimaryKeySqlite, prepareDeleteCompositePrimaryKeySqlite, prepareAlterCompositePrimaryKeySqlite, prepareAddCompositePrimaryKeyPg, prepareDeleteCompositePrimaryKeyPg, prepareAlterCompositePrimaryKeyPg, prepareAddUniqueConstraintPg, prepareDeleteUniqueConstraintPg, prepareAddCheckConstraint, prepareDeleteCheckConstraint, prepareAddCompositePrimaryKeyMySql, prepareDeleteCompositePrimaryKeyMySql, prepareAlterCompositePrimaryKeyMySql, preparePgCreateViewJson, prepareMySqlCreateViewJson, prepareSqliteCreateViewJson, prepareDropViewJson, prepareRenameViewJson, preparePgAlterViewAlterSchemaJson, preparePgAlterViewAddWithOptionJson, preparePgAlterViewDropWithOptionJson, preparePgAlterViewAlterTablespaceJson, preparePgAlterViewAlterUsingJson, prepareMySqlAlterView;
|
14423
|
+
var preparePgCreateTableJson, prepareMySqlCreateTableJson, prepareSQLiteCreateTable, prepareDropTableJson, prepareRenameTableJson, prepareCreateEnumJson, prepareAddValuesToEnumJson, prepareDropEnumValues, prepareDropEnumJson, prepareMoveEnumJson, prepareRenameEnumJson, prepareCreateSequenceJson, prepareAlterSequenceJson, prepareDropSequenceJson, prepareMoveSequenceJson, prepareRenameSequenceJson, prepareCreateRoleJson, prepareAlterRoleJson, prepareDropRoleJson, prepareRenameRoleJson, prepareCreateSchemasJson, prepareRenameSchemasJson, prepareDeleteSchemasJson, prepareRenameColumns, _prepareDropColumns, _prepareAddColumns, _prepareSqliteAddColumns, prepareAlterColumnsMysql, preparePgAlterColumns, prepareSqliteAlterColumns, prepareRenamePolicyJsons, prepareCreatePolicyJsons, prepareDropPolicyJsons, prepareAlterPolicyJson, preparePgCreateIndexesJson, prepareCreateIndexesJson, prepareCreateReferencesJson, prepareLibSQLCreateReferencesJson, prepareDropReferencesJson, prepareLibSQLDropReferencesJson, prepareAlterReferencesJson, prepareDropIndexesJson, prepareAddCompositePrimaryKeySqlite, prepareDeleteCompositePrimaryKeySqlite, prepareAlterCompositePrimaryKeySqlite, prepareAddCompositePrimaryKeyPg, prepareDeleteCompositePrimaryKeyPg, prepareAlterCompositePrimaryKeyPg, prepareAddUniqueConstraintPg, prepareDeleteUniqueConstraintPg, prepareAddCheckConstraint, prepareDeleteCheckConstraint, prepareAddCompositePrimaryKeyMySql, prepareDeleteCompositePrimaryKeyMySql, prepareAlterCompositePrimaryKeyMySql, preparePgCreateViewJson, prepareMySqlCreateViewJson, prepareSqliteCreateViewJson, prepareDropViewJson, prepareRenameViewJson, preparePgAlterViewAlterSchemaJson, preparePgAlterViewAddWithOptionJson, preparePgAlterViewDropWithOptionJson, preparePgAlterViewAlterTablespaceJson, preparePgAlterViewAlterUsingJson, prepareMySqlAlterView;
|
14155
14424
|
var init_jsonStatements = __esm({
|
14156
14425
|
"src/jsonStatements.ts"() {
|
14157
14426
|
"use strict";
|
@@ -14162,7 +14431,7 @@ var init_jsonStatements = __esm({
|
|
14162
14431
|
init_pgSchema();
|
14163
14432
|
init_sqliteSchema();
|
14164
14433
|
preparePgCreateTableJson = (table4, json22) => {
|
14165
|
-
const { name: name2, schema: schema4, columns, compositePrimaryKeys, uniqueConstraints, checkConstraints } = table4;
|
14434
|
+
const { name: name2, schema: schema4, columns, compositePrimaryKeys, uniqueConstraints, checkConstraints, policies, isRLSEnabled } = table4;
|
14166
14435
|
const tableKey2 = `${schema4 || "public"}.${name2}`;
|
14167
14436
|
const compositePkName = Object.values(compositePrimaryKeys).length > 0 ? json22.tables[tableKey2].compositePrimaryKeys[`${PgSquasher.unsquashPK(Object.values(compositePrimaryKeys)[0]).name}`].name : "";
|
14168
14437
|
return {
|
@@ -14173,7 +14442,9 @@ var init_jsonStatements = __esm({
|
|
14173
14442
|
compositePKs: Object.values(compositePrimaryKeys),
|
14174
14443
|
compositePkName,
|
14175
14444
|
uniqueConstraints: Object.values(uniqueConstraints),
|
14176
|
-
|
14445
|
+
policies: Object.values(policies),
|
14446
|
+
checkConstraints: Object.values(checkConstraints),
|
14447
|
+
isRLSEnabled: isRLSEnabled ?? false
|
14177
14448
|
};
|
14178
14449
|
};
|
14179
14450
|
prepareMySqlCreateTableJson = (table4, json22, internals) => {
|
@@ -14213,7 +14484,8 @@ var init_jsonStatements = __esm({
|
|
14213
14484
|
return {
|
14214
14485
|
type: "drop_table",
|
14215
14486
|
tableName: table4.name,
|
14216
|
-
schema: table4.schema
|
14487
|
+
schema: table4.schema,
|
14488
|
+
policies: table4.policies ? Object.values(table4.policies) : []
|
14217
14489
|
};
|
14218
14490
|
};
|
14219
14491
|
prepareRenameTableJson = (tableFrom, tableTo) => {
|
@@ -14331,6 +14603,41 @@ var init_jsonStatements = __esm({
|
|
14331
14603
|
schema: schema4
|
14332
14604
|
};
|
14333
14605
|
};
|
14606
|
+
prepareCreateRoleJson = (role) => {
|
14607
|
+
return {
|
14608
|
+
type: "create_role",
|
14609
|
+
name: role.name,
|
14610
|
+
values: {
|
14611
|
+
createDb: role.createDb,
|
14612
|
+
createRole: role.createRole,
|
14613
|
+
inherit: role.inherit
|
14614
|
+
}
|
14615
|
+
};
|
14616
|
+
};
|
14617
|
+
prepareAlterRoleJson = (role) => {
|
14618
|
+
return {
|
14619
|
+
type: "alter_role",
|
14620
|
+
name: role.name,
|
14621
|
+
values: {
|
14622
|
+
createDb: role.createDb,
|
14623
|
+
createRole: role.createRole,
|
14624
|
+
inherit: role.inherit
|
14625
|
+
}
|
14626
|
+
};
|
14627
|
+
};
|
14628
|
+
prepareDropRoleJson = (name2) => {
|
14629
|
+
return {
|
14630
|
+
type: "drop_role",
|
14631
|
+
name: name2
|
14632
|
+
};
|
14633
|
+
};
|
14634
|
+
prepareRenameRoleJson = (nameFrom, nameTo) => {
|
14635
|
+
return {
|
14636
|
+
type: "rename_role",
|
14637
|
+
nameFrom,
|
14638
|
+
nameTo
|
14639
|
+
};
|
14640
|
+
};
|
14334
14641
|
prepareCreateSchemasJson = (values) => {
|
14335
14642
|
return values.map((it) => {
|
14336
14643
|
return {
|
@@ -15227,6 +15534,46 @@ var init_jsonStatements = __esm({
|
|
15227
15534
|
}
|
15228
15535
|
return [...dropPkStatements, ...setPkStatements, ...statements];
|
15229
15536
|
};
|
15537
|
+
prepareRenamePolicyJsons = (tableName, schema4, renames) => {
|
15538
|
+
return renames.map((it) => {
|
15539
|
+
return {
|
15540
|
+
type: "rename_policy",
|
15541
|
+
tableName,
|
15542
|
+
oldName: it.from.name,
|
15543
|
+
newName: it.to.name,
|
15544
|
+
schema: schema4
|
15545
|
+
};
|
15546
|
+
});
|
15547
|
+
};
|
15548
|
+
prepareCreatePolicyJsons = (tableName, schema4, policies) => {
|
15549
|
+
return policies.map((it) => {
|
15550
|
+
return {
|
15551
|
+
type: "create_policy",
|
15552
|
+
tableName,
|
15553
|
+
data: it,
|
15554
|
+
schema: schema4
|
15555
|
+
};
|
15556
|
+
});
|
15557
|
+
};
|
15558
|
+
prepareDropPolicyJsons = (tableName, schema4, policies) => {
|
15559
|
+
return policies.map((it) => {
|
15560
|
+
return {
|
15561
|
+
type: "drop_policy",
|
15562
|
+
tableName,
|
15563
|
+
data: it,
|
15564
|
+
schema: schema4
|
15565
|
+
};
|
15566
|
+
});
|
15567
|
+
};
|
15568
|
+
prepareAlterPolicyJson = (tableName, schema4, oldPolicy, newPolicy) => {
|
15569
|
+
return {
|
15570
|
+
type: "alter_policy",
|
15571
|
+
tableName,
|
15572
|
+
oldData: oldPolicy,
|
15573
|
+
newData: newPolicy,
|
15574
|
+
schema: schema4
|
15575
|
+
};
|
15576
|
+
};
|
15230
15577
|
preparePgCreateIndexesJson = (tableName, schema4, indexes, fullSchema, action) => {
|
15231
15578
|
if (action === "push") {
|
15232
15579
|
return Object.values(indexes).map((indexData) => {
|
@@ -16053,7 +16400,9 @@ var init_snapshotsDiffer = __esm({
|
|
16053
16400
|
foreignKeys: recordType(stringType(), stringType()),
|
16054
16401
|
compositePrimaryKeys: recordType(stringType(), stringType()).default({}),
|
16055
16402
|
uniqueConstraints: recordType(stringType(), stringType()).default({}),
|
16056
|
-
|
16403
|
+
policies: recordType(stringType(), stringType()).default({}),
|
16404
|
+
checkConstraints: recordType(stringType(), stringType()).default({}),
|
16405
|
+
isRLSEnabled: booleanType().default(false)
|
16057
16406
|
}).strict();
|
16058
16407
|
alteredTableScheme = objectType({
|
16059
16408
|
name: stringType(),
|
@@ -16095,6 +16444,15 @@ var init_snapshotsDiffer = __esm({
|
|
16095
16444
|
__old: stringType()
|
16096
16445
|
})
|
16097
16446
|
),
|
16447
|
+
addedPolicies: recordType(stringType(), stringType()),
|
16448
|
+
deletedPolicies: recordType(stringType(), stringType()),
|
16449
|
+
alteredPolicies: recordType(
|
16450
|
+
stringType(),
|
16451
|
+
objectType({
|
16452
|
+
__new: stringType(),
|
16453
|
+
__old: stringType()
|
16454
|
+
})
|
16455
|
+
),
|
16098
16456
|
addedCheckConstraints: recordType(
|
16099
16457
|
stringType(),
|
16100
16458
|
stringType()
|
@@ -16156,6 +16514,7 @@ var init_snapshotsDiffer = __esm({
|
|
16156
16514
|
alteredTablesWithColumns: alteredTableScheme.array(),
|
16157
16515
|
alteredEnums: changedEnumSchema.array(),
|
16158
16516
|
alteredSequences: sequenceSquashed.array(),
|
16517
|
+
alteredRoles: roleSchema.array(),
|
16159
16518
|
alteredViews: alteredPgViewSchema.array()
|
16160
16519
|
}).strict();
|
16161
16520
|
diffResultSchemeMysql = objectType({
|
@@ -16213,7 +16572,7 @@ var init_snapshotsDiffer = __esm({
|
|
16213
16572
|
}
|
16214
16573
|
return column4;
|
16215
16574
|
};
|
16216
|
-
applyPgSnapshotsDiff = async (json1, json22, schemasResolver2, enumsResolver2, sequencesResolver2, tablesResolver2, columnsResolver2, viewsResolver2, prevFull, curFull, action) => {
|
16575
|
+
applyPgSnapshotsDiff = async (json1, json22, schemasResolver2, enumsResolver2, sequencesResolver2, policyResolver2, roleResolver2, tablesResolver2, columnsResolver2, viewsResolver2, prevFull, curFull, action) => {
|
16217
16576
|
const schemasDiff = diffSchemasOrTables(json1.schemas, json22.schemas);
|
16218
16577
|
const {
|
16219
16578
|
created: createdSchemas,
|
@@ -16363,6 +16722,47 @@ var init_snapshotsDiffer = __esm({
|
|
16363
16722
|
return [tableKey2, tableValue];
|
16364
16723
|
}
|
16365
16724
|
);
|
16725
|
+
const rolesDiff = diffSchemasOrTables(
|
16726
|
+
schemasPatchedSnap1.roles,
|
16727
|
+
json22.roles
|
16728
|
+
);
|
16729
|
+
const {
|
16730
|
+
created: createdRoles,
|
16731
|
+
deleted: deletedRoles,
|
16732
|
+
renamed: renamedRoles
|
16733
|
+
} = await roleResolver2({
|
16734
|
+
created: rolesDiff.added,
|
16735
|
+
deleted: rolesDiff.deleted
|
16736
|
+
});
|
16737
|
+
schemasPatchedSnap1.roles = mapEntries(
|
16738
|
+
schemasPatchedSnap1.roles,
|
16739
|
+
(_2, it) => {
|
16740
|
+
const { name: name2 } = nameChangeFor(it, renamedRoles);
|
16741
|
+
it.name = name2;
|
16742
|
+
return [name2, it];
|
16743
|
+
}
|
16744
|
+
);
|
16745
|
+
const rolesChangeMap = renamedRoles.reduce(
|
16746
|
+
(acc, it) => {
|
16747
|
+
acc[it.from.name] = {
|
16748
|
+
nameFrom: it.from.name,
|
16749
|
+
nameTo: it.to.name
|
16750
|
+
};
|
16751
|
+
return acc;
|
16752
|
+
},
|
16753
|
+
{}
|
16754
|
+
);
|
16755
|
+
schemasPatchedSnap1.roles = mapEntries(
|
16756
|
+
schemasPatchedSnap1.roles,
|
16757
|
+
(roleKey, roleValue) => {
|
16758
|
+
const key = roleKey;
|
16759
|
+
const change = rolesChangeMap[key];
|
16760
|
+
if (change) {
|
16761
|
+
roleValue.name = change.nameTo;
|
16762
|
+
}
|
16763
|
+
return [roleKey, roleValue];
|
16764
|
+
}
|
16765
|
+
);
|
16366
16766
|
const tablesDiff = diffSchemasOrTables(
|
16367
16767
|
schemasPatchedSnap1.tables,
|
16368
16768
|
json22.tables
|
@@ -16441,7 +16841,66 @@ var init_snapshotsDiffer = __esm({
|
|
16441
16841
|
return [tableKey2, tableValue];
|
16442
16842
|
}
|
16443
16843
|
);
|
16444
|
-
const
|
16844
|
+
const policyRes = diffPolicies(tablesPatchedSnap1.tables, json22.tables);
|
16845
|
+
const policyRenames = [];
|
16846
|
+
const policyCreates = [];
|
16847
|
+
const policyDeletes = [];
|
16848
|
+
for (let entry of Object.values(policyRes)) {
|
16849
|
+
const { renamed, created, deleted } = await policyResolver2({
|
16850
|
+
tableName: entry.name,
|
16851
|
+
schema: entry.schema,
|
16852
|
+
deleted: entry.policies.deleted.map(PgSquasher.unsquashPolicy),
|
16853
|
+
created: entry.policies.added.map(PgSquasher.unsquashPolicy)
|
16854
|
+
});
|
16855
|
+
if (created.length > 0) {
|
16856
|
+
policyCreates.push({
|
16857
|
+
table: entry.name,
|
16858
|
+
schema: entry.schema,
|
16859
|
+
columns: created
|
16860
|
+
});
|
16861
|
+
}
|
16862
|
+
if (deleted.length > 0) {
|
16863
|
+
policyDeletes.push({
|
16864
|
+
table: entry.name,
|
16865
|
+
schema: entry.schema,
|
16866
|
+
columns: deleted
|
16867
|
+
});
|
16868
|
+
}
|
16869
|
+
if (renamed.length > 0) {
|
16870
|
+
policyRenames.push({
|
16871
|
+
table: entry.name,
|
16872
|
+
schema: entry.schema,
|
16873
|
+
renames: renamed
|
16874
|
+
});
|
16875
|
+
}
|
16876
|
+
}
|
16877
|
+
const policyRenamesDict = columnRenames.reduce(
|
16878
|
+
(acc, it) => {
|
16879
|
+
acc[`${it.schema || "public"}.${it.table}`] = it.renames;
|
16880
|
+
return acc;
|
16881
|
+
},
|
16882
|
+
{}
|
16883
|
+
);
|
16884
|
+
const policyPatchedSnap1 = copy(tablesPatchedSnap1);
|
16885
|
+
policyPatchedSnap1.tables = mapEntries(
|
16886
|
+
policyPatchedSnap1.tables,
|
16887
|
+
(tableKey2, tableValue) => {
|
16888
|
+
const patchedPolicies = mapKeys(
|
16889
|
+
tableValue.policies,
|
16890
|
+
(policyKey, policy2) => {
|
16891
|
+
const rens = policyRenamesDict[`${tableValue.schema || "public"}.${tableValue.name}`] || [];
|
16892
|
+
const newName = columnChangeFor(policyKey, rens);
|
16893
|
+
const unsquashedPolicy = PgSquasher.unsquashPolicy(policy2);
|
16894
|
+
unsquashedPolicy.name = newName;
|
16895
|
+
policy2 = PgSquasher.squashPolicy(unsquashedPolicy);
|
16896
|
+
return newName;
|
16897
|
+
}
|
16898
|
+
);
|
16899
|
+
tableValue.policies = patchedPolicies;
|
16900
|
+
return [tableKey2, tableValue];
|
16901
|
+
}
|
16902
|
+
);
|
16903
|
+
const viewsDiff = diffSchemasOrTables(policyPatchedSnap1.views, json22.views);
|
16445
16904
|
const {
|
16446
16905
|
created: createdViews,
|
16447
16906
|
deleted: deletedViews,
|
@@ -16459,7 +16918,7 @@ var init_snapshotsDiffer = __esm({
|
|
16459
16918
|
movedViews.forEach((it) => {
|
16460
16919
|
movedViewDic[`${it.schemaFrom}.${it.name}`] = { to: it.schemaTo, from: it.schemaFrom };
|
16461
16920
|
});
|
16462
|
-
const viewsPatchedSnap1 = copy(
|
16921
|
+
const viewsPatchedSnap1 = copy(policyPatchedSnap1);
|
16463
16922
|
viewsPatchedSnap1.views = mapEntries(
|
16464
16923
|
viewsPatchedSnap1.views,
|
16465
16924
|
(viewKey, viewValue) => {
|
@@ -16517,13 +16976,15 @@ var init_snapshotsDiffer = __esm({
|
|
16517
16976
|
const jsonDeletedUniqueConstraints = [];
|
16518
16977
|
const jsonAlteredUniqueConstraints = [];
|
16519
16978
|
const jsonSetTableSchemas = [];
|
16520
|
-
|
16521
|
-
|
16522
|
-
|
16523
|
-
|
16524
|
-
|
16525
|
-
|
16526
|
-
|
16979
|
+
if (movedTables) {
|
16980
|
+
for (let it of movedTables) {
|
16981
|
+
jsonSetTableSchemas.push({
|
16982
|
+
type: "alter_table_set_schema",
|
16983
|
+
tableName: it.name,
|
16984
|
+
schemaFrom: it.schemaFrom || "public",
|
16985
|
+
schemaTo: it.schemaTo || "public"
|
16986
|
+
});
|
16987
|
+
}
|
16527
16988
|
}
|
16528
16989
|
const jsonDeletedCheckConstraints = [];
|
16529
16990
|
const jsonCreatedCheckConstraints = [];
|
@@ -16650,7 +17111,106 @@ var init_snapshotsDiffer = __esm({
|
|
16650
17111
|
it.deletedIndexes || {}
|
16651
17112
|
);
|
16652
17113
|
}).flat();
|
17114
|
+
const jsonCreatePoliciesStatements = [];
|
17115
|
+
const jsonDropPoliciesStatements = [];
|
17116
|
+
const jsonAlterPoliciesStatements = [];
|
17117
|
+
const jsonRenamePoliciesStatements = [];
|
17118
|
+
const jsonEnableRLSStatements = [];
|
17119
|
+
const jsonDisableRLSStatements = [];
|
17120
|
+
for (let it of policyRenames) {
|
17121
|
+
jsonRenamePoliciesStatements.push(
|
17122
|
+
...prepareRenamePolicyJsons(it.table, it.schema, it.renames)
|
17123
|
+
);
|
17124
|
+
}
|
17125
|
+
for (const it of policyCreates) {
|
17126
|
+
jsonCreatePoliciesStatements.push(
|
17127
|
+
...prepareCreatePolicyJsons(
|
17128
|
+
it.table,
|
17129
|
+
it.schema,
|
17130
|
+
it.columns
|
17131
|
+
)
|
17132
|
+
);
|
17133
|
+
}
|
17134
|
+
for (const it of policyDeletes) {
|
17135
|
+
jsonDropPoliciesStatements.push(
|
17136
|
+
...prepareDropPolicyJsons(
|
17137
|
+
it.table,
|
17138
|
+
it.schema,
|
17139
|
+
it.columns
|
17140
|
+
)
|
17141
|
+
);
|
17142
|
+
}
|
16653
17143
|
alteredTables.forEach((it) => {
|
17144
|
+
Object.keys(it.alteredPolicies).forEach((policyName) => {
|
17145
|
+
const newPolicy = PgSquasher.unsquashPolicy(it.alteredPolicies[policyName].__new);
|
17146
|
+
const oldPolicy = PgSquasher.unsquashPolicy(it.alteredPolicies[policyName].__old);
|
17147
|
+
if (newPolicy.as !== oldPolicy.as) {
|
17148
|
+
jsonDropPoliciesStatements.push(
|
17149
|
+
...prepareDropPolicyJsons(
|
17150
|
+
it.name,
|
17151
|
+
it.schema,
|
17152
|
+
[oldPolicy]
|
17153
|
+
)
|
17154
|
+
);
|
17155
|
+
jsonCreatePoliciesStatements.push(
|
17156
|
+
...prepareCreatePolicyJsons(
|
17157
|
+
it.name,
|
17158
|
+
it.schema,
|
17159
|
+
[newPolicy]
|
17160
|
+
)
|
17161
|
+
);
|
17162
|
+
return;
|
17163
|
+
}
|
17164
|
+
if (newPolicy.for !== oldPolicy.for) {
|
17165
|
+
jsonDropPoliciesStatements.push(
|
17166
|
+
...prepareDropPolicyJsons(
|
17167
|
+
it.name,
|
17168
|
+
it.schema,
|
17169
|
+
[oldPolicy]
|
17170
|
+
)
|
17171
|
+
);
|
17172
|
+
jsonCreatePoliciesStatements.push(
|
17173
|
+
...prepareCreatePolicyJsons(
|
17174
|
+
it.name,
|
17175
|
+
it.schema,
|
17176
|
+
[newPolicy]
|
17177
|
+
)
|
17178
|
+
);
|
17179
|
+
return;
|
17180
|
+
}
|
17181
|
+
jsonAlterPoliciesStatements.push(
|
17182
|
+
prepareAlterPolicyJson(
|
17183
|
+
it.name,
|
17184
|
+
it.schema,
|
17185
|
+
it.alteredPolicies[policyName].__old,
|
17186
|
+
it.alteredPolicies[policyName].__new
|
17187
|
+
)
|
17188
|
+
);
|
17189
|
+
});
|
17190
|
+
for (const table4 of Object.values(json22.tables)) {
|
17191
|
+
const policiesInCurrentState = Object.keys(table4.policies);
|
17192
|
+
const tableInPreviousState = columnsPatchedSnap1.tables[`${table4.schema === "" ? "public" : table4.schema}.${table4.name}`];
|
17193
|
+
const policiesInPreviousState = tableInPreviousState ? Object.keys(tableInPreviousState.policies) : [];
|
17194
|
+
if (policiesInPreviousState.length === 0 && policiesInCurrentState.length > 0 && !table4.isRLSEnabled) {
|
17195
|
+
jsonEnableRLSStatements.push({ type: "enable_rls", tableName: table4.name, schema: table4.schema });
|
17196
|
+
}
|
17197
|
+
if (policiesInPreviousState.length > 0 && policiesInCurrentState.length === 0 && !table4.isRLSEnabled) {
|
17198
|
+
jsonDisableRLSStatements.push({ type: "disable_rls", tableName: table4.name, schema: table4.schema });
|
17199
|
+
}
|
17200
|
+
if (table4.isRLSEnabled !== tableInPreviousState.isRLSEnabled) {
|
17201
|
+
if (table4.isRLSEnabled) {
|
17202
|
+
jsonEnableRLSStatements.push({ type: "enable_rls", tableName: table4.name, schema: table4.schema });
|
17203
|
+
} else if (!table4.isRLSEnabled && policiesInCurrentState.length === 0) {
|
17204
|
+
jsonDisableRLSStatements.push({ type: "disable_rls", tableName: table4.name, schema: table4.schema });
|
17205
|
+
}
|
17206
|
+
}
|
17207
|
+
}
|
17208
|
+
for (const table4 of Object.values(columnsPatchedSnap1.tables)) {
|
17209
|
+
const tableInCurrentState = json22.tables[`${table4.schema === "" ? "public" : table4.schema}.${table4.name}`];
|
17210
|
+
if (tableInCurrentState === void 0 && !table4.isRLSEnabled) {
|
17211
|
+
jsonDisableRLSStatements.push({ type: "disable_rls", tableName: table4.name, schema: table4.schema });
|
17212
|
+
}
|
17213
|
+
}
|
16654
17214
|
const droppedIndexes = Object.keys(it.alteredIndexes).reduce(
|
16655
17215
|
(current, item) => {
|
16656
17216
|
current[item] = it.alteredIndexes[item].__old;
|
@@ -16738,6 +17298,18 @@ var init_snapshotsDiffer = __esm({
|
|
16738
17298
|
const jsonAlterSequences = typedResult.alteredSequences.map((it) => {
|
16739
17299
|
return prepareAlterSequenceJson(it);
|
16740
17300
|
}).flat() ?? [];
|
17301
|
+
const createRoles = createdRoles.map((it) => {
|
17302
|
+
return prepareCreateRoleJson(it);
|
17303
|
+
}) ?? [];
|
17304
|
+
const dropRoles = deletedRoles.map((it) => {
|
17305
|
+
return prepareDropRoleJson(it.name);
|
17306
|
+
});
|
17307
|
+
const renameRoles = renamedRoles.map((it) => {
|
17308
|
+
return prepareRenameRoleJson(it.from.name, it.to.name);
|
17309
|
+
});
|
17310
|
+
const jsonAlterRoles = typedResult.alteredRoles.map((it) => {
|
17311
|
+
return prepareAlterRoleJson(it);
|
17312
|
+
}).flat() ?? [];
|
16741
17313
|
const createSchemas = prepareCreateSchemasJson(
|
16742
17314
|
createdSchemas.map((it) => it.name)
|
16743
17315
|
);
|
@@ -16750,6 +17322,11 @@ var init_snapshotsDiffer = __esm({
|
|
16750
17322
|
const createTables = createdTables.map((it) => {
|
16751
17323
|
return preparePgCreateTableJson(it, curFull);
|
16752
17324
|
});
|
17325
|
+
jsonCreatePoliciesStatements.push(...[].concat(
|
17326
|
+
...createdTables.map(
|
17327
|
+
(it) => prepareCreatePolicyJsons(it.name, it.schema, Object.values(it.policies).map(PgSquasher.unsquashPolicy))
|
17328
|
+
)
|
17329
|
+
));
|
16753
17330
|
const createViews = [];
|
16754
17331
|
const dropViews = [];
|
16755
17332
|
const renameViews = [];
|
@@ -16891,7 +17468,13 @@ var init_snapshotsDiffer = __esm({
|
|
16891
17468
|
jsonStatements.push(...moveSequences);
|
16892
17469
|
jsonStatements.push(...renameSequences);
|
16893
17470
|
jsonStatements.push(...jsonAlterSequences);
|
17471
|
+
jsonStatements.push(...renameRoles);
|
17472
|
+
jsonStatements.push(...dropRoles);
|
17473
|
+
jsonStatements.push(...createRoles);
|
17474
|
+
jsonStatements.push(...jsonAlterRoles);
|
16894
17475
|
jsonStatements.push(...createTables);
|
17476
|
+
jsonStatements.push(...jsonEnableRLSStatements);
|
17477
|
+
jsonStatements.push(...jsonDisableRLSStatements);
|
16895
17478
|
jsonStatements.push(...dropViews);
|
16896
17479
|
jsonStatements.push(...renameViews);
|
16897
17480
|
jsonStatements.push(...alterViews);
|
@@ -16917,6 +17500,10 @@ var init_snapshotsDiffer = __esm({
|
|
16917
17500
|
jsonStatements.push(...jsonCreatedCheckConstraints);
|
16918
17501
|
jsonStatements.push(...jsonAlteredUniqueConstraints);
|
16919
17502
|
jsonStatements.push(...jsonAlterEnumsWithDroppedValues);
|
17503
|
+
jsonStatements.push(...jsonRenamePoliciesStatements);
|
17504
|
+
jsonStatements.push(...jsonDropPoliciesStatements);
|
17505
|
+
jsonStatements.push(...jsonCreatePoliciesStatements);
|
17506
|
+
jsonStatements.push(...jsonAlterPoliciesStatements);
|
16920
17507
|
jsonStatements.push(...createViews);
|
16921
17508
|
jsonStatements.push(...dropEnums);
|
16922
17509
|
jsonStatements.push(...dropSequences);
|
@@ -18309,7 +18896,7 @@ var init_outputs = __esm({
|
|
18309
18896
|
});
|
18310
18897
|
|
18311
18898
|
// src/cli/commands/migrate.ts
|
18312
|
-
var import_hanji2, schemasResolver, tablesResolver, viewsResolver, mySqlViewsResolver, sqliteViewsResolver, sequencesResolver, enumsResolver, columnsResolver, promptColumnsConflicts, promptNamedWithSchemasConflict, promptSchemasConflict, BREAKPOINT;
|
18899
|
+
var import_hanji2, schemasResolver, tablesResolver, viewsResolver, mySqlViewsResolver, sqliteViewsResolver, sequencesResolver, roleResolver, policyResolver, enumsResolver, columnsResolver, promptColumnsConflicts, promptNamedConflict, promptNamedWithSchemasConflict, promptSchemasConflict, BREAKPOINT;
|
18313
18900
|
var init_migrate = __esm({
|
18314
18901
|
"src/cli/commands/migrate.ts"() {
|
18315
18902
|
"use strict";
|
@@ -18426,6 +19013,32 @@ var init_migrate = __esm({
|
|
18426
19013
|
throw e;
|
18427
19014
|
}
|
18428
19015
|
};
|
19016
|
+
roleResolver = async (input) => {
|
19017
|
+
const result = await promptNamedConflict(
|
19018
|
+
input.created,
|
19019
|
+
input.deleted,
|
19020
|
+
"role"
|
19021
|
+
);
|
19022
|
+
return {
|
19023
|
+
created: result.created,
|
19024
|
+
deleted: result.deleted,
|
19025
|
+
renamed: result.renamed
|
19026
|
+
};
|
19027
|
+
};
|
19028
|
+
policyResolver = async (input) => {
|
19029
|
+
const result = await promptColumnsConflicts(
|
19030
|
+
input.tableName,
|
19031
|
+
input.created,
|
19032
|
+
input.deleted
|
19033
|
+
);
|
19034
|
+
return {
|
19035
|
+
tableName: input.tableName,
|
19036
|
+
schema: input.schema,
|
19037
|
+
created: result.created,
|
19038
|
+
deleted: result.deleted,
|
19039
|
+
renamed: result.renamed
|
19040
|
+
};
|
19041
|
+
};
|
18429
19042
|
enumsResolver = async (input) => {
|
18430
19043
|
try {
|
18431
19044
|
const { created, deleted, moved, renamed } = await promptNamedWithSchemasConflict(
|
@@ -18508,6 +19121,56 @@ var init_migrate = __esm({
|
|
18508
19121
|
result.deleted.push(...leftMissing);
|
18509
19122
|
return result;
|
18510
19123
|
};
|
19124
|
+
promptNamedConflict = async (newItems, missingItems, entity) => {
|
19125
|
+
if (missingItems.length === 0 || newItems.length === 0) {
|
19126
|
+
return {
|
19127
|
+
created: newItems,
|
19128
|
+
renamed: [],
|
19129
|
+
deleted: missingItems
|
19130
|
+
};
|
19131
|
+
}
|
19132
|
+
const result = { created: [], renamed: [], deleted: [] };
|
19133
|
+
let index4 = 0;
|
19134
|
+
let leftMissing = [...missingItems];
|
19135
|
+
do {
|
19136
|
+
const created = newItems[index4];
|
19137
|
+
const renames = leftMissing.map((it) => {
|
19138
|
+
return { from: it, to: created };
|
19139
|
+
});
|
19140
|
+
const promptData = [created, ...renames];
|
19141
|
+
const { status, data } = await (0, import_hanji2.render)(
|
19142
|
+
new ResolveSelectNamed(created, promptData, entity)
|
19143
|
+
);
|
19144
|
+
if (status === "aborted") {
|
19145
|
+
console.error("ERROR");
|
19146
|
+
process.exit(1);
|
19147
|
+
}
|
19148
|
+
if (isRenamePromptItem(data)) {
|
19149
|
+
console.log(
|
19150
|
+
`${source_default.yellow("~")} ${data.from.name} \u203A ${data.to.name} ${source_default.gray(
|
19151
|
+
`${entity} will be renamed/moved`
|
19152
|
+
)}`
|
19153
|
+
);
|
19154
|
+
if (data.from.name !== data.to.name) {
|
19155
|
+
result.renamed.push(data);
|
19156
|
+
}
|
19157
|
+
delete leftMissing[leftMissing.indexOf(data.from)];
|
19158
|
+
leftMissing = leftMissing.filter(Boolean);
|
19159
|
+
} else {
|
19160
|
+
console.log(
|
19161
|
+
`${source_default.green("+")} ${data.name} ${source_default.gray(
|
19162
|
+
`${entity} will be created`
|
19163
|
+
)}`
|
19164
|
+
);
|
19165
|
+
result.created.push(created);
|
19166
|
+
}
|
19167
|
+
index4 += 1;
|
19168
|
+
} while (index4 < newItems.length);
|
19169
|
+
console.log(source_default.gray(`--- all ${entity} conflicts resolved ---
|
19170
|
+
`));
|
19171
|
+
result.deleted.push(...leftMissing);
|
19172
|
+
return result;
|
19173
|
+
};
|
18511
19174
|
promptNamedWithSchemasConflict = async (newItems, missingItems, entity) => {
|
18512
19175
|
if (missingItems.length === 0 || newItems.length === 0) {
|
18513
19176
|
return {
|
@@ -20064,8 +20727,8 @@ function parsePgArray(arrayString) {
|
|
20064
20727
|
const [result] = parsePgNestedArray(arrayString, 1);
|
20065
20728
|
return result;
|
20066
20729
|
}
|
20067
|
-
function makePgArray(
|
20068
|
-
return `{${
|
20730
|
+
function makePgArray(array2) {
|
20731
|
+
return `{${array2.map((item) => {
|
20069
20732
|
if (Array.isArray(item)) {
|
20070
20733
|
return makePgArray(item);
|
20071
20734
|
}
|
@@ -20372,7 +21035,7 @@ var version;
|
|
20372
21035
|
var init_version = __esm({
|
20373
21036
|
"../drizzle-orm/dist/version.js"() {
|
20374
21037
|
"use strict";
|
20375
|
-
version = "0.35.
|
21038
|
+
version = "0.35.3";
|
20376
21039
|
}
|
20377
21040
|
});
|
20378
21041
|
|
@@ -20773,8 +21436,8 @@ var init_sql = __esm({
|
|
20773
21436
|
sql2.param = param2;
|
20774
21437
|
})(sql || (sql = {}));
|
20775
21438
|
((SQL2) => {
|
20776
|
-
var
|
20777
|
-
|
21439
|
+
var _a326;
|
21440
|
+
_a326 = entityKind;
|
20778
21441
|
const _Aliased = class _Aliased {
|
20779
21442
|
constructor(sql2, fieldAlias) {
|
20780
21443
|
/** @internal */
|
@@ -20790,7 +21453,7 @@ var init_sql = __esm({
|
|
20790
21453
|
return new _Aliased(this.sql, this.fieldAlias);
|
20791
21454
|
}
|
20792
21455
|
};
|
20793
|
-
__publicField(_Aliased,
|
21456
|
+
__publicField(_Aliased, _a326, "SQL.Aliased");
|
20794
21457
|
let Aliased = _Aliased;
|
20795
21458
|
SQL2.Aliased = Aliased;
|
20796
21459
|
})(SQL || (SQL = {}));
|
@@ -21073,8 +21736,8 @@ function arrayContains(column4, values) {
|
|
21073
21736
|
if (values.length === 0) {
|
21074
21737
|
throw new Error("arrayContains requires at least one value");
|
21075
21738
|
}
|
21076
|
-
const
|
21077
|
-
return sql`${column4} @> ${
|
21739
|
+
const array2 = sql`${bindIfParam(values, column4)}`;
|
21740
|
+
return sql`${column4} @> ${array2}`;
|
21078
21741
|
}
|
21079
21742
|
return sql`${column4} @> ${bindIfParam(values, column4)}`;
|
21080
21743
|
}
|
@@ -21083,8 +21746,8 @@ function arrayContained(column4, values) {
|
|
21083
21746
|
if (values.length === 0) {
|
21084
21747
|
throw new Error("arrayContained requires at least one value");
|
21085
21748
|
}
|
21086
|
-
const
|
21087
|
-
return sql`${column4} <@ ${
|
21749
|
+
const array2 = sql`${bindIfParam(values, column4)}`;
|
21750
|
+
return sql`${column4} <@ ${array2}`;
|
21088
21751
|
}
|
21089
21752
|
return sql`${column4} <@ ${bindIfParam(values, column4)}`;
|
21090
21753
|
}
|
@@ -21093,8 +21756,8 @@ function arrayOverlaps(column4, values) {
|
|
21093
21756
|
if (values.length === 0) {
|
21094
21757
|
throw new Error("arrayOverlaps requires at least one value");
|
21095
21758
|
}
|
21096
|
-
const
|
21097
|
-
return sql`${column4} && ${
|
21759
|
+
const array2 = sql`${bindIfParam(values, column4)}`;
|
21760
|
+
return sql`${column4} && ${array2}`;
|
21098
21761
|
}
|
21099
21762
|
return sql`${column4} && ${bindIfParam(values, column4)}`;
|
21100
21763
|
}
|
@@ -21353,6 +22016,50 @@ function getColumnNameAndConfig(a, b) {
|
|
21353
22016
|
config: typeof a === "object" ? a : b
|
21354
22017
|
};
|
21355
22018
|
}
|
22019
|
+
function isConfig(data) {
|
22020
|
+
if (typeof data !== "object" || data === null)
|
22021
|
+
return false;
|
22022
|
+
if (data.constructor.name !== "Object")
|
22023
|
+
return false;
|
22024
|
+
if ("logger" in data) {
|
22025
|
+
const type = typeof data["logger"];
|
22026
|
+
if (type !== "boolean" && (type !== "object" || typeof data["logger"]["logQuery"] !== "function") && type !== "undefined")
|
22027
|
+
return false;
|
22028
|
+
return true;
|
22029
|
+
}
|
22030
|
+
if ("schema" in data) {
|
22031
|
+
const type = typeof data["logger"];
|
22032
|
+
if (type !== "object" && type !== "undefined")
|
22033
|
+
return false;
|
22034
|
+
return true;
|
22035
|
+
}
|
22036
|
+
if ("casing" in data) {
|
22037
|
+
const type = typeof data["logger"];
|
22038
|
+
if (type !== "string" && type !== "undefined")
|
22039
|
+
return false;
|
22040
|
+
return true;
|
22041
|
+
}
|
22042
|
+
if ("mode" in data) {
|
22043
|
+
if (data["mode"] !== "default" || data["mode"] !== "planetscale" || data["mode"] !== void 0)
|
22044
|
+
return false;
|
22045
|
+
return true;
|
22046
|
+
}
|
22047
|
+
if ("connection" in data) {
|
22048
|
+
const type = typeof data["connection"];
|
22049
|
+
if (type !== "string" && type !== "object" && type !== "undefined")
|
22050
|
+
return false;
|
22051
|
+
return true;
|
22052
|
+
}
|
22053
|
+
if ("client" in data) {
|
22054
|
+
const type = typeof data["client"];
|
22055
|
+
if (type !== "object" && type !== "undefined")
|
22056
|
+
return false;
|
22057
|
+
return true;
|
22058
|
+
}
|
22059
|
+
if (Object.keys(data).length === 0)
|
22060
|
+
return true;
|
22061
|
+
return false;
|
22062
|
+
}
|
21356
22063
|
var init_utils2 = __esm({
|
21357
22064
|
"../drizzle-orm/dist/utils.js"() {
|
21358
22065
|
"use strict";
|
@@ -23011,9 +23718,14 @@ function pgTableWithSchema(name2, columns, extraConfig, schema4, baseName = name
|
|
23011
23718
|
if (extraConfig) {
|
23012
23719
|
table4[PgTable.Symbol.ExtraConfigBuilder] = extraConfig;
|
23013
23720
|
}
|
23014
|
-
return table4
|
23721
|
+
return Object.assign(table4, {
|
23722
|
+
enableRLS: () => {
|
23723
|
+
table4[PgTable.Symbol.EnableRLS] = true;
|
23724
|
+
return table4;
|
23725
|
+
}
|
23726
|
+
});
|
23015
23727
|
}
|
23016
|
-
var InlineForeignKeys, _a116, _b94, _c2, _d2, PgTable, pgTable;
|
23728
|
+
var InlineForeignKeys, EnableRLS, _a116, _b94, _c2, _d2, _e2, PgTable, pgTable;
|
23017
23729
|
var init_table2 = __esm({
|
23018
23730
|
"../drizzle-orm/dist/pg-core/table.js"() {
|
23019
23731
|
"use strict";
|
@@ -23021,19 +23733,23 @@ var init_table2 = __esm({
|
|
23021
23733
|
init_table();
|
23022
23734
|
init_all();
|
23023
23735
|
InlineForeignKeys = Symbol.for("drizzle:PgInlineForeignKeys");
|
23024
|
-
|
23736
|
+
EnableRLS = Symbol.for("drizzle:EnableRLS");
|
23737
|
+
PgTable = class extends (_e2 = Table, _d2 = entityKind, _c2 = InlineForeignKeys, _b94 = EnableRLS, _a116 = Table.Symbol.ExtraConfigBuilder, _e2) {
|
23025
23738
|
constructor() {
|
23026
23739
|
super(...arguments);
|
23027
23740
|
/**@internal */
|
23028
|
-
__publicField(this,
|
23741
|
+
__publicField(this, _c2, []);
|
23742
|
+
/** @internal */
|
23743
|
+
__publicField(this, _b94, false);
|
23029
23744
|
/** @internal */
|
23030
23745
|
__publicField(this, _a116);
|
23031
23746
|
}
|
23032
23747
|
};
|
23033
|
-
__publicField(PgTable,
|
23748
|
+
__publicField(PgTable, _d2, "PgTable");
|
23034
23749
|
/** @internal */
|
23035
23750
|
__publicField(PgTable, "Symbol", Object.assign({}, Table.Symbol, {
|
23036
|
-
InlineForeignKeys
|
23751
|
+
InlineForeignKeys,
|
23752
|
+
EnableRLS
|
23037
23753
|
}));
|
23038
23754
|
pgTable = (name2, columns, extraConfig) => {
|
23039
23755
|
return pgTableWithSchema(name2, columns, extraConfig, void 0);
|
@@ -23546,6 +24262,7 @@ __export(dist_exports, {
|
|
23546
24262
|
inArray: () => inArray,
|
23547
24263
|
innerProduct: () => innerProduct,
|
23548
24264
|
is: () => is,
|
24265
|
+
isConfig: () => isConfig,
|
23549
24266
|
isDriverValueEncoder: () => isDriverValueEncoder,
|
23550
24267
|
isNotNull: () => isNotNull,
|
23551
24268
|
isNull: () => isNull,
|
@@ -26760,6 +27477,67 @@ var init_indexes = __esm({
|
|
26760
27477
|
}
|
26761
27478
|
});
|
26762
27479
|
|
27480
|
+
// ../drizzle-orm/dist/pg-core/policies.js
|
27481
|
+
var _a147, PgPolicy;
|
27482
|
+
var init_policies = __esm({
|
27483
|
+
"../drizzle-orm/dist/pg-core/policies.js"() {
|
27484
|
+
"use strict";
|
27485
|
+
init_entity();
|
27486
|
+
_a147 = entityKind;
|
27487
|
+
PgPolicy = class {
|
27488
|
+
constructor(name2, config) {
|
27489
|
+
__publicField(this, "as");
|
27490
|
+
__publicField(this, "for");
|
27491
|
+
__publicField(this, "to");
|
27492
|
+
__publicField(this, "using");
|
27493
|
+
__publicField(this, "withCheck");
|
27494
|
+
this.name = name2;
|
27495
|
+
if (config) {
|
27496
|
+
this.as = config.as;
|
27497
|
+
this.for = config.for;
|
27498
|
+
this.to = config.to;
|
27499
|
+
this.using = config.using;
|
27500
|
+
this.withCheck = config.withCheck;
|
27501
|
+
}
|
27502
|
+
}
|
27503
|
+
};
|
27504
|
+
__publicField(PgPolicy, _a147, "PgPolicy");
|
27505
|
+
}
|
27506
|
+
});
|
27507
|
+
|
27508
|
+
// ../drizzle-orm/dist/pg-core/roles.js
|
27509
|
+
var _a148, PgRole;
|
27510
|
+
var init_roles = __esm({
|
27511
|
+
"../drizzle-orm/dist/pg-core/roles.js"() {
|
27512
|
+
"use strict";
|
27513
|
+
init_entity();
|
27514
|
+
_a148 = entityKind;
|
27515
|
+
PgRole = class {
|
27516
|
+
constructor(name2, config) {
|
27517
|
+
/** @internal */
|
27518
|
+
__publicField(this, "_existing");
|
27519
|
+
/** @internal */
|
27520
|
+
__publicField(this, "createDb");
|
27521
|
+
/** @internal */
|
27522
|
+
__publicField(this, "createRole");
|
27523
|
+
/** @internal */
|
27524
|
+
__publicField(this, "inherit");
|
27525
|
+
this.name = name2;
|
27526
|
+
if (config) {
|
27527
|
+
this.createDb = config.createDb;
|
27528
|
+
this.createRole = config.createRole;
|
27529
|
+
this.inherit = config.inherit;
|
27530
|
+
}
|
27531
|
+
}
|
27532
|
+
existing() {
|
27533
|
+
this._existing = true;
|
27534
|
+
return this;
|
27535
|
+
}
|
27536
|
+
};
|
27537
|
+
__publicField(PgRole, _a148, "PgRole");
|
27538
|
+
}
|
27539
|
+
});
|
27540
|
+
|
26763
27541
|
// ../drizzle-orm/dist/pg-core/sequence.js
|
26764
27542
|
function pgSequenceWithSchema(name2, options, schema4) {
|
26765
27543
|
return new PgSequence(name2, options, schema4);
|
@@ -26767,12 +27545,12 @@ function pgSequenceWithSchema(name2, options, schema4) {
|
|
26767
27545
|
function isPgSequence(obj) {
|
26768
27546
|
return is(obj, PgSequence);
|
26769
27547
|
}
|
26770
|
-
var
|
27548
|
+
var _a149, PgSequence;
|
26771
27549
|
var init_sequence = __esm({
|
26772
27550
|
"../drizzle-orm/dist/pg-core/sequence.js"() {
|
26773
27551
|
"use strict";
|
26774
27552
|
init_entity();
|
26775
|
-
|
27553
|
+
_a149 = entityKind;
|
26776
27554
|
PgSequence = class {
|
26777
27555
|
constructor(seqName, seqOptions, schema4) {
|
26778
27556
|
this.seqName = seqName;
|
@@ -26780,7 +27558,7 @@ var init_sequence = __esm({
|
|
26780
27558
|
this.schema = schema4;
|
26781
27559
|
}
|
26782
27560
|
};
|
26783
|
-
__publicField(PgSequence,
|
27561
|
+
__publicField(PgSequence, _a149, "PgSequence");
|
26784
27562
|
}
|
26785
27563
|
});
|
26786
27564
|
|
@@ -26812,7 +27590,7 @@ function isPgView(obj) {
|
|
26812
27590
|
function isPgMaterializedView(obj) {
|
26813
27591
|
return is(obj, PgMaterializedView);
|
26814
27592
|
}
|
26815
|
-
var
|
27593
|
+
var _a150, DefaultViewBuilderCore, _a151, _b107, ViewBuilder, _a152, _b108, ManualViewBuilder, _a153, MaterializedViewBuilderCore, _a154, _b109, MaterializedViewBuilder, _a155, _b110, ManualMaterializedViewBuilder, _a156, _b111, _c4, PgView2, PgMaterializedViewConfig, _a157, _b112, _c5, PgMaterializedView;
|
26816
27594
|
var init_view = __esm({
|
26817
27595
|
"../drizzle-orm/dist/pg-core/view.js"() {
|
26818
27596
|
"use strict";
|
@@ -26823,7 +27601,7 @@ var init_view = __esm({
|
|
26823
27601
|
init_table2();
|
26824
27602
|
init_view_base();
|
26825
27603
|
init_view_common2();
|
26826
|
-
|
27604
|
+
_a150 = entityKind;
|
26827
27605
|
DefaultViewBuilderCore = class {
|
26828
27606
|
constructor(name2, schema4) {
|
26829
27607
|
__publicField(this, "config", {});
|
@@ -26835,8 +27613,8 @@ var init_view = __esm({
|
|
26835
27613
|
return this;
|
26836
27614
|
}
|
26837
27615
|
};
|
26838
|
-
__publicField(DefaultViewBuilderCore,
|
26839
|
-
ViewBuilder = class extends (_b107 = DefaultViewBuilderCore,
|
27616
|
+
__publicField(DefaultViewBuilderCore, _a150, "PgDefaultViewBuilderCore");
|
27617
|
+
ViewBuilder = class extends (_b107 = DefaultViewBuilderCore, _a151 = entityKind, _b107) {
|
26840
27618
|
as(qb) {
|
26841
27619
|
if (typeof qb === "function") {
|
26842
27620
|
qb = qb(new QueryBuilder());
|
@@ -26862,8 +27640,8 @@ var init_view = __esm({
|
|
26862
27640
|
);
|
26863
27641
|
}
|
26864
27642
|
};
|
26865
|
-
__publicField(ViewBuilder,
|
26866
|
-
ManualViewBuilder = class extends (_b108 = DefaultViewBuilderCore,
|
27643
|
+
__publicField(ViewBuilder, _a151, "PgViewBuilder");
|
27644
|
+
ManualViewBuilder = class extends (_b108 = DefaultViewBuilderCore, _a152 = entityKind, _b108) {
|
26867
27645
|
constructor(name2, columns, schema4) {
|
26868
27646
|
super(name2, schema4);
|
26869
27647
|
__publicField(this, "columns");
|
@@ -26908,8 +27686,8 @@ var init_view = __esm({
|
|
26908
27686
|
);
|
26909
27687
|
}
|
26910
27688
|
};
|
26911
|
-
__publicField(ManualViewBuilder,
|
26912
|
-
|
27689
|
+
__publicField(ManualViewBuilder, _a152, "PgManualViewBuilder");
|
27690
|
+
_a153 = entityKind;
|
26913
27691
|
MaterializedViewBuilderCore = class {
|
26914
27692
|
constructor(name2, schema4) {
|
26915
27693
|
__publicField(this, "config", {});
|
@@ -26933,8 +27711,8 @@ var init_view = __esm({
|
|
26933
27711
|
return this;
|
26934
27712
|
}
|
26935
27713
|
};
|
26936
|
-
__publicField(MaterializedViewBuilderCore,
|
26937
|
-
MaterializedViewBuilder = class extends (_b109 = MaterializedViewBuilderCore,
|
27714
|
+
__publicField(MaterializedViewBuilderCore, _a153, "PgMaterializedViewBuilderCore");
|
27715
|
+
MaterializedViewBuilder = class extends (_b109 = MaterializedViewBuilderCore, _a154 = entityKind, _b109) {
|
26938
27716
|
as(qb) {
|
26939
27717
|
if (typeof qb === "function") {
|
26940
27718
|
qb = qb(new QueryBuilder());
|
@@ -26965,8 +27743,8 @@ var init_view = __esm({
|
|
26965
27743
|
);
|
26966
27744
|
}
|
26967
27745
|
};
|
26968
|
-
__publicField(MaterializedViewBuilder,
|
26969
|
-
ManualMaterializedViewBuilder = class extends (_b110 = MaterializedViewBuilderCore,
|
27746
|
+
__publicField(MaterializedViewBuilder, _a154, "PgMaterializedViewBuilder");
|
27747
|
+
ManualMaterializedViewBuilder = class extends (_b110 = MaterializedViewBuilderCore, _a155 = entityKind, _b110) {
|
26970
27748
|
constructor(name2, columns, schema4) {
|
26971
27749
|
super(name2, schema4);
|
26972
27750
|
__publicField(this, "columns");
|
@@ -27021,11 +27799,11 @@ var init_view = __esm({
|
|
27021
27799
|
);
|
27022
27800
|
}
|
27023
27801
|
};
|
27024
|
-
__publicField(ManualMaterializedViewBuilder,
|
27025
|
-
PgView2 = class extends (_c4 = PgViewBase, _b111 = entityKind,
|
27802
|
+
__publicField(ManualMaterializedViewBuilder, _a155, "PgManualMaterializedViewBuilder");
|
27803
|
+
PgView2 = class extends (_c4 = PgViewBase, _b111 = entityKind, _a156 = PgViewConfig, _c4) {
|
27026
27804
|
constructor({ pgConfig, config }) {
|
27027
27805
|
super(config);
|
27028
|
-
__publicField(this,
|
27806
|
+
__publicField(this, _a156);
|
27029
27807
|
if (pgConfig) {
|
27030
27808
|
this[PgViewConfig] = {
|
27031
27809
|
with: pgConfig.with
|
@@ -27035,10 +27813,10 @@ var init_view = __esm({
|
|
27035
27813
|
};
|
27036
27814
|
__publicField(PgView2, _b111, "PgView");
|
27037
27815
|
PgMaterializedViewConfig = Symbol.for("drizzle:PgMaterializedViewConfig");
|
27038
|
-
PgMaterializedView = class extends (_c5 = PgViewBase, _b112 = entityKind,
|
27816
|
+
PgMaterializedView = class extends (_c5 = PgViewBase, _b112 = entityKind, _a157 = PgMaterializedViewConfig, _c5) {
|
27039
27817
|
constructor({ pgConfig, config }) {
|
27040
27818
|
super(config);
|
27041
|
-
__publicField(this,
|
27819
|
+
__publicField(this, _a157);
|
27042
27820
|
this[PgMaterializedViewConfig] = {
|
27043
27821
|
with: pgConfig?.with,
|
27044
27822
|
using: pgConfig?.using,
|
@@ -27052,7 +27830,7 @@ var init_view = __esm({
|
|
27052
27830
|
});
|
27053
27831
|
|
27054
27832
|
// ../drizzle-orm/dist/pg-core/schema.js
|
27055
|
-
var
|
27833
|
+
var _a158, PgSchema5;
|
27056
27834
|
var init_schema = __esm({
|
27057
27835
|
"../drizzle-orm/dist/pg-core/schema.js"() {
|
27058
27836
|
"use strict";
|
@@ -27062,7 +27840,7 @@ var init_schema = __esm({
|
|
27062
27840
|
init_sequence();
|
27063
27841
|
init_table2();
|
27064
27842
|
init_view();
|
27065
|
-
|
27843
|
+
_a158 = entityKind;
|
27066
27844
|
PgSchema5 = class {
|
27067
27845
|
constructor(schemaName) {
|
27068
27846
|
__publicField(this, "table", (name2, columns, extraConfig) => {
|
@@ -27089,12 +27867,12 @@ var init_schema = __esm({
|
|
27089
27867
|
return true;
|
27090
27868
|
}
|
27091
27869
|
};
|
27092
|
-
__publicField(PgSchema5,
|
27870
|
+
__publicField(PgSchema5, _a158, "PgSchema");
|
27093
27871
|
}
|
27094
27872
|
});
|
27095
27873
|
|
27096
27874
|
// ../drizzle-orm/dist/pg-core/session.js
|
27097
|
-
var
|
27875
|
+
var _a159, PgPreparedQuery, _a160, PgSession, _a161, _b113, PgTransaction;
|
27098
27876
|
var init_session = __esm({
|
27099
27877
|
"../drizzle-orm/dist/pg-core/session.js"() {
|
27100
27878
|
"use strict";
|
@@ -27103,7 +27881,7 @@ var init_session = __esm({
|
|
27103
27881
|
init_sql2();
|
27104
27882
|
init_tracing();
|
27105
27883
|
init_db();
|
27106
|
-
|
27884
|
+
_a159 = entityKind;
|
27107
27885
|
PgPreparedQuery = class {
|
27108
27886
|
constructor(query) {
|
27109
27887
|
/** @internal */
|
@@ -27117,8 +27895,8 @@ var init_session = __esm({
|
|
27117
27895
|
return response;
|
27118
27896
|
}
|
27119
27897
|
};
|
27120
|
-
__publicField(PgPreparedQuery,
|
27121
|
-
|
27898
|
+
__publicField(PgPreparedQuery, _a159, "PgPreparedQuery");
|
27899
|
+
_a160 = entityKind;
|
27122
27900
|
PgSession = class {
|
27123
27901
|
constructor(dialect4) {
|
27124
27902
|
this.dialect = dialect4;
|
@@ -27151,8 +27929,8 @@ var init_session = __esm({
|
|
27151
27929
|
);
|
27152
27930
|
}
|
27153
27931
|
};
|
27154
|
-
__publicField(PgSession,
|
27155
|
-
PgTransaction = class extends (_b113 = PgDatabase,
|
27932
|
+
__publicField(PgSession, _a160, "PgSession");
|
27933
|
+
PgTransaction = class extends (_b113 = PgDatabase, _a161 = entityKind, _b113) {
|
27156
27934
|
constructor(dialect4, session, schema4, nestedIndex = 0) {
|
27157
27935
|
super(dialect4, session, schema4);
|
27158
27936
|
this.schema = schema4;
|
@@ -27179,7 +27957,7 @@ var init_session = __esm({
|
|
27179
27957
|
return this.session.execute(sql`set transaction ${this.getTransactionConfigSQL(config)}`);
|
27180
27958
|
}
|
27181
27959
|
};
|
27182
|
-
__publicField(PgTransaction,
|
27960
|
+
__publicField(PgTransaction, _a161, "PgTransaction");
|
27183
27961
|
}
|
27184
27962
|
});
|
27185
27963
|
|
@@ -27200,10 +27978,13 @@ function getTableConfig(table4) {
|
|
27200
27978
|
const uniqueConstraints = [];
|
27201
27979
|
const name2 = table4[Table.Symbol.Name];
|
27202
27980
|
const schema4 = table4[Table.Symbol.Schema];
|
27981
|
+
const policies = [];
|
27982
|
+
const enableRLS = table4[PgTable.Symbol.EnableRLS];
|
27203
27983
|
const extraConfigBuilder = table4[PgTable.Symbol.ExtraConfigBuilder];
|
27204
27984
|
if (extraConfigBuilder !== void 0) {
|
27205
27985
|
const extraConfig = extraConfigBuilder(table4[Table.Symbol.ExtraConfigColumns]);
|
27206
|
-
|
27986
|
+
const extraValues = Array.isArray(extraConfig) ? extraConfig.flat(1) : Object.values(extraConfig);
|
27987
|
+
for (const builder of extraValues) {
|
27207
27988
|
if (is(builder, IndexBuilder)) {
|
27208
27989
|
indexes.push(builder.build(table4));
|
27209
27990
|
} else if (is(builder, CheckBuilder)) {
|
@@ -27214,6 +27995,8 @@ function getTableConfig(table4) {
|
|
27214
27995
|
primaryKeys.push(builder.build(table4));
|
27215
27996
|
} else if (is(builder, ForeignKeyBuilder)) {
|
27216
27997
|
foreignKeys.push(builder.build(table4));
|
27998
|
+
} else if (is(builder, PgPolicy)) {
|
27999
|
+
policies.push(builder);
|
27217
28000
|
}
|
27218
28001
|
}
|
27219
28002
|
}
|
@@ -27225,7 +28008,9 @@ function getTableConfig(table4) {
|
|
27225
28008
|
primaryKeys,
|
27226
28009
|
uniqueConstraints,
|
27227
28010
|
name: name2,
|
27228
|
-
schema: schema4
|
28011
|
+
schema: schema4,
|
28012
|
+
policies,
|
28013
|
+
enableRLS
|
27229
28014
|
};
|
27230
28015
|
}
|
27231
28016
|
function getViewConfig(view4) {
|
@@ -27250,6 +28035,7 @@ var init_utils4 = __esm({
|
|
27250
28035
|
init_checks();
|
27251
28036
|
init_foreign_keys();
|
27252
28037
|
init_indexes();
|
28038
|
+
init_policies();
|
27253
28039
|
init_primary_keys();
|
27254
28040
|
init_unique_constraint();
|
27255
28041
|
init_view_common2();
|
@@ -27276,8 +28062,10 @@ var init_pg_core = __esm({
|
|
27276
28062
|
init_dialect();
|
27277
28063
|
init_foreign_keys();
|
27278
28064
|
init_indexes();
|
28065
|
+
init_policies();
|
27279
28066
|
init_primary_keys();
|
27280
28067
|
init_query_builders();
|
28068
|
+
init_roles();
|
27281
28069
|
init_schema();
|
27282
28070
|
init_sequence();
|
27283
28071
|
init_session();
|
@@ -27299,14 +28087,14 @@ function maxRangeForIdentityBasedOn(columnType) {
|
|
27299
28087
|
return columnType === "integer" ? "2147483647" : columnType === "bigint" ? "9223372036854775807" : "32767";
|
27300
28088
|
}
|
27301
28089
|
function minRangeForIdentityBasedOn(columnType) {
|
27302
|
-
return columnType === "integer" ? "-2147483648" : columnType === "
|
28090
|
+
return columnType === "integer" ? "-2147483648" : columnType === "bigint" ? "-9223372036854775808" : "-32768";
|
27303
28091
|
}
|
27304
28092
|
function stringFromDatabaseIdentityProperty(field) {
|
27305
28093
|
return typeof field === "string" ? field : typeof field === "undefined" ? void 0 : typeof field === "bigint" ? field.toString() : String(field);
|
27306
28094
|
}
|
27307
|
-
function buildArrayString(
|
28095
|
+
function buildArrayString(array2, sqlType) {
|
27308
28096
|
sqlType = sqlType.split("[")[0];
|
27309
|
-
const values =
|
28097
|
+
const values = array2.map((value) => {
|
27310
28098
|
if (typeof value === "number" || typeof value === "bigint") {
|
27311
28099
|
return value.toString();
|
27312
28100
|
} else if (typeof value === "boolean") {
|
@@ -27328,6 +28116,40 @@ function buildArrayString(array, sqlType) {
|
|
27328
28116
|
}).join(",");
|
27329
28117
|
return `{${values}}`;
|
27330
28118
|
}
|
28119
|
+
function prepareRoles(entities) {
|
28120
|
+
let useRoles = false;
|
28121
|
+
const includeRoles = [];
|
28122
|
+
const excludeRoles = [];
|
28123
|
+
if (entities && entities.roles) {
|
28124
|
+
if (typeof entities.roles === "object") {
|
28125
|
+
if (entities.roles.provider) {
|
28126
|
+
if (entities.roles.provider === "supabase") {
|
28127
|
+
excludeRoles.push(...[
|
28128
|
+
"anon",
|
28129
|
+
"authenticator",
|
28130
|
+
"authenticated",
|
28131
|
+
"service_role",
|
28132
|
+
"supabase_auth_admin",
|
28133
|
+
"supabase_storage_admin",
|
28134
|
+
"dashboard_user",
|
28135
|
+
"supabase_admin"
|
28136
|
+
]);
|
28137
|
+
} else if (entities.roles.provider === "neon") {
|
28138
|
+
excludeRoles.push(...["authenticated", "anonymous"]);
|
28139
|
+
}
|
28140
|
+
}
|
28141
|
+
if (entities.roles.include) {
|
28142
|
+
includeRoles.push(...entities.roles.include);
|
28143
|
+
}
|
28144
|
+
if (entities.roles.exclude) {
|
28145
|
+
excludeRoles.push(...entities.roles.exclude);
|
28146
|
+
}
|
28147
|
+
} else {
|
28148
|
+
useRoles = entities.roles;
|
28149
|
+
}
|
28150
|
+
}
|
28151
|
+
return { useRoles, includeRoles, excludeRoles };
|
28152
|
+
}
|
27331
28153
|
var indexName, generatePgSnapshot, trimChar, fromDatabase, defaultForColumn, getColumnsInfoQuery;
|
27332
28154
|
var init_pgSerializer = __esm({
|
27333
28155
|
"src/serializer/pgSerializer.ts"() {
|
@@ -27343,15 +28165,27 @@ var init_pgSerializer = __esm({
|
|
27343
28165
|
indexName = (tableName, columns) => {
|
27344
28166
|
return `${tableName}_${columns.join("_")}_index`;
|
27345
28167
|
};
|
27346
|
-
generatePgSnapshot = (tables, enums, schemas, sequences, views, matViews, casing2, schemaFilter) => {
|
28168
|
+
generatePgSnapshot = (tables, enums, schemas, sequences, roles, views, matViews, casing2, schemaFilter) => {
|
27347
28169
|
const dialect4 = new PgDialect({ casing: casing2 });
|
27348
28170
|
const result = {};
|
27349
28171
|
const resultViews = {};
|
27350
28172
|
const sequencesToReturn = {};
|
28173
|
+
const rolesToReturn = {};
|
27351
28174
|
const indexesInSchema = {};
|
27352
28175
|
for (const table4 of tables) {
|
27353
28176
|
const checksInTable = {};
|
27354
|
-
const {
|
28177
|
+
const {
|
28178
|
+
name: tableName,
|
28179
|
+
columns,
|
28180
|
+
indexes,
|
28181
|
+
foreignKeys,
|
28182
|
+
checks,
|
28183
|
+
schema: schema4,
|
28184
|
+
primaryKeys,
|
28185
|
+
uniqueConstraints,
|
28186
|
+
policies,
|
28187
|
+
enableRLS
|
28188
|
+
} = getTableConfig(table4);
|
27355
28189
|
if (schemaFilter && !schemaFilter.includes(schema4 ?? "public")) {
|
27356
28190
|
continue;
|
27357
28191
|
}
|
@@ -27361,6 +28195,7 @@ var init_pgSerializer = __esm({
|
|
27361
28195
|
const foreignKeysObject = {};
|
27362
28196
|
const primaryKeysObject = {};
|
27363
28197
|
const uniqueConstraintObject = {};
|
28198
|
+
const policiesObject = {};
|
27364
28199
|
columns.forEach((column4) => {
|
27365
28200
|
const name2 = getColumnCasing(column4, casing2);
|
27366
28201
|
const notNull = column4.notNull;
|
@@ -27608,6 +28443,34 @@ ${withStyle.errorWarning(
|
|
27608
28443
|
with: value.config.with ?? {}
|
27609
28444
|
};
|
27610
28445
|
});
|
28446
|
+
policies.forEach((policy2) => {
|
28447
|
+
const mappedTo = [];
|
28448
|
+
if (!policy2.to) {
|
28449
|
+
mappedTo.push("public");
|
28450
|
+
} else {
|
28451
|
+
if (policy2.to && typeof policy2.to === "string") {
|
28452
|
+
mappedTo.push(policy2.to);
|
28453
|
+
} else if (policy2.to && is(policy2.to, PgRole)) {
|
28454
|
+
mappedTo.push(policy2.to.name);
|
28455
|
+
} else if (policy2.to && Array.isArray(policy2.to)) {
|
28456
|
+
policy2.to.forEach((it) => {
|
28457
|
+
if (typeof it === "string") {
|
28458
|
+
mappedTo.push(it);
|
28459
|
+
} else if (is(it, PgRole)) {
|
28460
|
+
mappedTo.push(it.name);
|
28461
|
+
}
|
28462
|
+
});
|
28463
|
+
}
|
28464
|
+
}
|
28465
|
+
policiesObject[policy2.name] = {
|
28466
|
+
name: policy2.name,
|
28467
|
+
as: policy2.as?.toUpperCase() ?? "PERMISSIVE",
|
28468
|
+
for: policy2.for?.toUpperCase() ?? "ALL",
|
28469
|
+
to: mappedTo.sort(),
|
28470
|
+
using: is(policy2.using, SQL) ? dialect4.sqlToQuery(policy2.using).sql : void 0,
|
28471
|
+
withCheck: is(policy2.withCheck, SQL) ? dialect4.sqlToQuery(policy2.withCheck).sql : void 0
|
28472
|
+
};
|
28473
|
+
});
|
27611
28474
|
checks.forEach((check) => {
|
27612
28475
|
const checkName = check.name;
|
27613
28476
|
if (typeof checksInTable[`"${schema4 ?? "public"}"."${tableName}"`] !== "undefined") {
|
@@ -27644,7 +28507,9 @@ ${withStyle.errorWarning(
|
|
27644
28507
|
foreignKeys: foreignKeysObject,
|
27645
28508
|
compositePrimaryKeys: primaryKeysObject,
|
27646
28509
|
uniqueConstraints: uniqueConstraintObject,
|
27647
|
-
|
28510
|
+
policies: policiesObject,
|
28511
|
+
checkConstraints: checksObject,
|
28512
|
+
isRLSEnabled: enableRLS
|
27648
28513
|
};
|
27649
28514
|
}
|
27650
28515
|
for (const sequence of sequences) {
|
@@ -27668,6 +28533,16 @@ ${withStyle.errorWarning(
|
|
27668
28533
|
} else {
|
27669
28534
|
}
|
27670
28535
|
}
|
28536
|
+
for (const role of roles) {
|
28537
|
+
if (!role._existing) {
|
28538
|
+
rolesToReturn[role.name] = {
|
28539
|
+
name: role.name,
|
28540
|
+
createDb: role.createDb === void 0 ? false : role.createDb,
|
28541
|
+
createRole: role.createRole === void 0 ? false : role.createRole,
|
28542
|
+
inherit: role.inherit === void 0 ? true : role.inherit
|
28543
|
+
};
|
28544
|
+
}
|
28545
|
+
}
|
27671
28546
|
const combinedViews = [...views, ...matViews];
|
27672
28547
|
for (const view4 of combinedViews) {
|
27673
28548
|
let viewName;
|
@@ -27824,6 +28699,7 @@ ${withStyle.errorWarning(
|
|
27824
28699
|
enums: enumsToReturn,
|
27825
28700
|
schemas: schemasObject,
|
27826
28701
|
sequences: sequencesToReturn,
|
28702
|
+
roles: rolesToReturn,
|
27827
28703
|
views: resultViews,
|
27828
28704
|
_meta: {
|
27829
28705
|
schemas: {},
|
@@ -27839,7 +28715,7 @@ ${withStyle.errorWarning(
|
|
27839
28715
|
while (end > start && str[end - 1] === char3) --end;
|
27840
28716
|
return start > 0 || end < str.length ? str.substring(start, end) : str.toString();
|
27841
28717
|
};
|
27842
|
-
fromDatabase = async (db, tablesFilter = () => true, schemaFilters, progressCallback) => {
|
28718
|
+
fromDatabase = async (db, tablesFilter = () => true, schemaFilters, entities, progressCallback) => {
|
27843
28719
|
const result = {};
|
27844
28720
|
const views = {};
|
27845
28721
|
const internals = { tables: {} };
|
@@ -27852,7 +28728,8 @@ ${withStyle.errorWarning(
|
|
27852
28728
|
WHEN c.relkind = 'r' THEN 'table'
|
27853
28729
|
WHEN c.relkind = 'v' THEN 'view'
|
27854
28730
|
WHEN c.relkind = 'm' THEN 'materialized_view'
|
27855
|
-
END AS type
|
28731
|
+
END AS type,
|
28732
|
+
c.relrowsecurity AS rls_enabled
|
27856
28733
|
FROM
|
27857
28734
|
pg_catalog.pg_class c
|
27858
28735
|
JOIN
|
@@ -27938,6 +28815,60 @@ WHERE
|
|
27938
28815
|
if (progressCallback) {
|
27939
28816
|
progressCallback("enums", Object.keys(enumsToReturn).length, "done");
|
27940
28817
|
}
|
28818
|
+
const allRoles = await db.query(
|
28819
|
+
`SELECT rolname, rolinherit, rolcreatedb, rolcreaterole FROM pg_roles;`
|
28820
|
+
);
|
28821
|
+
const rolesToReturn = {};
|
28822
|
+
const preparedRoles = prepareRoles(entities);
|
28823
|
+
if (preparedRoles.useRoles || !(preparedRoles.includeRoles.length === 0 && preparedRoles.excludeRoles.length === 0)) {
|
28824
|
+
for (const dbRole of allRoles) {
|
28825
|
+
if (preparedRoles.useRoles) {
|
28826
|
+
rolesToReturn[dbRole.rolname] = {
|
28827
|
+
createDb: dbRole.rolcreatedb,
|
28828
|
+
createRole: dbRole.rolcreatedb,
|
28829
|
+
inherit: dbRole.rolinherit,
|
28830
|
+
name: dbRole.rolname
|
28831
|
+
};
|
28832
|
+
} else {
|
28833
|
+
if (preparedRoles.includeRoles.length === 0 && preparedRoles.excludeRoles.length === 0) continue;
|
28834
|
+
if (preparedRoles.includeRoles.includes(dbRole.rolname) && preparedRoles.excludeRoles.includes(dbRole.rolname)) continue;
|
28835
|
+
if (preparedRoles.excludeRoles.includes(dbRole.rolname)) continue;
|
28836
|
+
if (!preparedRoles.includeRoles.includes(dbRole.rolname)) continue;
|
28837
|
+
rolesToReturn[dbRole.rolname] = {
|
28838
|
+
createDb: dbRole.rolcreatedb,
|
28839
|
+
createRole: dbRole.rolcreaterole,
|
28840
|
+
inherit: dbRole.rolinherit,
|
28841
|
+
name: dbRole.rolname
|
28842
|
+
};
|
28843
|
+
}
|
28844
|
+
}
|
28845
|
+
}
|
28846
|
+
const wherePolicies = schemaFilters.map((t) => `schemaname = '${t}'`).join(" or ");
|
28847
|
+
const policiesByTable = {};
|
28848
|
+
const allPolicies = await db.query(`SELECT schemaname, tablename, policyname as name, permissive as "as", roles as to, cmd as for, qual as using, with_check as "withCheck" FROM pg_policies${wherePolicies === "" ? "" : ` WHERE ${wherePolicies}`};`);
|
28849
|
+
for (const dbPolicy of allPolicies) {
|
28850
|
+
const { tablename, schemaname, to, withCheck, using, ...rest } = dbPolicy;
|
28851
|
+
const tableForPolicy = policiesByTable[`${schemaname}.${tablename}`];
|
28852
|
+
const parsedTo = to;
|
28853
|
+
const parsedWithCheck = withCheck === null ? void 0 : withCheck;
|
28854
|
+
const parsedUsing = using === null ? void 0 : using;
|
28855
|
+
if (tableForPolicy) {
|
28856
|
+
tableForPolicy[dbPolicy.name] = { ...rest, to: parsedTo };
|
28857
|
+
} else {
|
28858
|
+
policiesByTable[`${schemaname}.${tablename}`] = {
|
28859
|
+
[dbPolicy.name]: { ...rest, to: parsedTo, withCheck: parsedWithCheck, using: parsedUsing }
|
28860
|
+
};
|
28861
|
+
}
|
28862
|
+
}
|
28863
|
+
if (progressCallback) {
|
28864
|
+
progressCallback(
|
28865
|
+
"policies",
|
28866
|
+
Object.values(policiesByTable).reduce((total, innerRecord) => {
|
28867
|
+
return total + Object.keys(innerRecord).length;
|
28868
|
+
}, 0),
|
28869
|
+
"done"
|
28870
|
+
);
|
28871
|
+
}
|
27941
28872
|
const sequencesInColumns = [];
|
27942
28873
|
const all = allTables.filter((it) => it.type === "table").map((row) => {
|
27943
28874
|
return new Promise(async (res, rej) => {
|
@@ -28299,7 +29230,7 @@ WHERE
|
|
28299
29230
|
}
|
28300
29231
|
],
|
28301
29232
|
isUnique: indexIsUnique,
|
28302
|
-
// should not be a part of diff
|
29233
|
+
// should not be a part of diff detects
|
28303
29234
|
concurrently: false,
|
28304
29235
|
method: indexMethod,
|
28305
29236
|
where: indexWhere === null ? void 0 : indexWhere,
|
@@ -28319,7 +29250,9 @@ WHERE
|
|
28319
29250
|
foreignKeys: foreignKeysToReturn,
|
28320
29251
|
compositePrimaryKeys: primaryKeys,
|
28321
29252
|
uniqueConstraints: uniqueConstrains,
|
28322
|
-
checkConstraints
|
29253
|
+
checkConstraints,
|
29254
|
+
policies: policiesByTable[`${tableSchema}.${tableName}`] ?? {},
|
29255
|
+
isRLSEnabled: row.rls_enabled
|
28323
29256
|
};
|
28324
29257
|
} catch (e) {
|
28325
29258
|
rej(e);
|
@@ -28517,6 +29450,7 @@ WHERE
|
|
28517
29450
|
enums: enumsToReturn,
|
28518
29451
|
schemas: schemasObject,
|
28519
29452
|
sequences: sequencesToReturn,
|
29453
|
+
roles: rolesToReturn,
|
28520
29454
|
views,
|
28521
29455
|
_meta: {
|
28522
29456
|
schemas: {},
|
@@ -28711,12 +29645,12 @@ var init_alias3 = __esm({
|
|
28711
29645
|
});
|
28712
29646
|
|
28713
29647
|
// ../drizzle-orm/dist/sqlite-core/checks.js
|
28714
|
-
var
|
29648
|
+
var _a162, CheckBuilder2, _a163, Check2;
|
28715
29649
|
var init_checks2 = __esm({
|
28716
29650
|
"../drizzle-orm/dist/sqlite-core/checks.js"() {
|
28717
29651
|
"use strict";
|
28718
29652
|
init_entity();
|
28719
|
-
|
29653
|
+
_a162 = entityKind;
|
28720
29654
|
CheckBuilder2 = class {
|
28721
29655
|
constructor(name2, value) {
|
28722
29656
|
__publicField(this, "brand");
|
@@ -28727,8 +29661,8 @@ var init_checks2 = __esm({
|
|
28727
29661
|
return new Check2(table4, this);
|
28728
29662
|
}
|
28729
29663
|
};
|
28730
|
-
__publicField(CheckBuilder2,
|
28731
|
-
|
29664
|
+
__publicField(CheckBuilder2, _a162, "SQLiteCheckBuilder");
|
29665
|
+
_a163 = entityKind;
|
28732
29666
|
Check2 = class {
|
28733
29667
|
constructor(table4, builder) {
|
28734
29668
|
__publicField(this, "name");
|
@@ -28738,18 +29672,18 @@ var init_checks2 = __esm({
|
|
28738
29672
|
this.value = builder.value;
|
28739
29673
|
}
|
28740
29674
|
};
|
28741
|
-
__publicField(Check2,
|
29675
|
+
__publicField(Check2, _a163, "SQLiteCheck");
|
28742
29676
|
}
|
28743
29677
|
});
|
28744
29678
|
|
28745
29679
|
// ../drizzle-orm/dist/sqlite-core/foreign-keys.js
|
28746
|
-
var
|
29680
|
+
var _a164, ForeignKeyBuilder2, _a165, ForeignKey2;
|
28747
29681
|
var init_foreign_keys2 = __esm({
|
28748
29682
|
"../drizzle-orm/dist/sqlite-core/foreign-keys.js"() {
|
28749
29683
|
"use strict";
|
28750
29684
|
init_entity();
|
28751
29685
|
init_table_utils();
|
28752
|
-
|
29686
|
+
_a164 = entityKind;
|
28753
29687
|
ForeignKeyBuilder2 = class {
|
28754
29688
|
constructor(config, actions) {
|
28755
29689
|
/** @internal */
|
@@ -28780,8 +29714,8 @@ var init_foreign_keys2 = __esm({
|
|
28780
29714
|
return new ForeignKey2(table4, this);
|
28781
29715
|
}
|
28782
29716
|
};
|
28783
|
-
__publicField(ForeignKeyBuilder2,
|
28784
|
-
|
29717
|
+
__publicField(ForeignKeyBuilder2, _a164, "SQLiteForeignKeyBuilder");
|
29718
|
+
_a165 = entityKind;
|
28785
29719
|
ForeignKey2 = class {
|
28786
29720
|
constructor(table4, builder) {
|
28787
29721
|
__publicField(this, "reference");
|
@@ -28805,7 +29739,7 @@ var init_foreign_keys2 = __esm({
|
|
28805
29739
|
return name2 ?? `${chunks.join("_")}_fk`;
|
28806
29740
|
}
|
28807
29741
|
};
|
28808
|
-
__publicField(ForeignKey2,
|
29742
|
+
__publicField(ForeignKey2, _a165, "SQLiteForeignKey");
|
28809
29743
|
}
|
28810
29744
|
});
|
28811
29745
|
|
@@ -28813,13 +29747,13 @@ var init_foreign_keys2 = __esm({
|
|
28813
29747
|
function uniqueKeyName2(table4, columns) {
|
28814
29748
|
return `${table4[TableName]}_${columns.join("_")}_unique`;
|
28815
29749
|
}
|
28816
|
-
var
|
29750
|
+
var _a166, UniqueConstraintBuilder2, _a167, UniqueOnConstraintBuilder2, _a168, UniqueConstraint2;
|
28817
29751
|
var init_unique_constraint2 = __esm({
|
28818
29752
|
"../drizzle-orm/dist/sqlite-core/unique-constraint.js"() {
|
28819
29753
|
"use strict";
|
28820
29754
|
init_entity();
|
28821
29755
|
init_table_utils();
|
28822
|
-
|
29756
|
+
_a166 = entityKind;
|
28823
29757
|
UniqueConstraintBuilder2 = class {
|
28824
29758
|
constructor(columns, name2) {
|
28825
29759
|
/** @internal */
|
@@ -28832,8 +29766,8 @@ var init_unique_constraint2 = __esm({
|
|
28832
29766
|
return new UniqueConstraint2(table4, this.columns, this.name);
|
28833
29767
|
}
|
28834
29768
|
};
|
28835
|
-
__publicField(UniqueConstraintBuilder2,
|
28836
|
-
|
29769
|
+
__publicField(UniqueConstraintBuilder2, _a166, "SQLiteUniqueConstraintBuilder");
|
29770
|
+
_a167 = entityKind;
|
28837
29771
|
UniqueOnConstraintBuilder2 = class {
|
28838
29772
|
constructor(name2) {
|
28839
29773
|
/** @internal */
|
@@ -28844,8 +29778,8 @@ var init_unique_constraint2 = __esm({
|
|
28844
29778
|
return new UniqueConstraintBuilder2(columns, this.name);
|
28845
29779
|
}
|
28846
29780
|
};
|
28847
|
-
__publicField(UniqueOnConstraintBuilder2,
|
28848
|
-
|
29781
|
+
__publicField(UniqueOnConstraintBuilder2, _a167, "SQLiteUniqueOnConstraintBuilder");
|
29782
|
+
_a168 = entityKind;
|
28849
29783
|
UniqueConstraint2 = class {
|
28850
29784
|
constructor(table4, columns, name2) {
|
28851
29785
|
__publicField(this, "columns");
|
@@ -28858,12 +29792,12 @@ var init_unique_constraint2 = __esm({
|
|
28858
29792
|
return this.name;
|
28859
29793
|
}
|
28860
29794
|
};
|
28861
|
-
__publicField(UniqueConstraint2,
|
29795
|
+
__publicField(UniqueConstraint2, _a168, "SQLiteUniqueConstraint");
|
28862
29796
|
}
|
28863
29797
|
});
|
28864
29798
|
|
28865
29799
|
// ../drizzle-orm/dist/sqlite-core/columns/common.js
|
28866
|
-
var
|
29800
|
+
var _a169, _b114, SQLiteColumnBuilder, _a170, _b115, SQLiteColumn;
|
28867
29801
|
var init_common3 = __esm({
|
28868
29802
|
"../drizzle-orm/dist/sqlite-core/columns/common.js"() {
|
28869
29803
|
"use strict";
|
@@ -28872,7 +29806,7 @@ var init_common3 = __esm({
|
|
28872
29806
|
init_entity();
|
28873
29807
|
init_foreign_keys2();
|
28874
29808
|
init_unique_constraint2();
|
28875
|
-
SQLiteColumnBuilder = class extends (_b114 = ColumnBuilder,
|
29809
|
+
SQLiteColumnBuilder = class extends (_b114 = ColumnBuilder, _a169 = entityKind, _b114) {
|
28876
29810
|
constructor() {
|
28877
29811
|
super(...arguments);
|
28878
29812
|
__publicField(this, "foreignKeyConfigs", []);
|
@@ -28913,8 +29847,8 @@ var init_common3 = __esm({
|
|
28913
29847
|
});
|
28914
29848
|
}
|
28915
29849
|
};
|
28916
|
-
__publicField(SQLiteColumnBuilder,
|
28917
|
-
SQLiteColumn = class extends (_b115 = Column2,
|
29850
|
+
__publicField(SQLiteColumnBuilder, _a169, "SQLiteColumnBuilder");
|
29851
|
+
SQLiteColumn = class extends (_b115 = Column2, _a170 = entityKind, _b115) {
|
28918
29852
|
constructor(table4, config) {
|
28919
29853
|
if (!config.uniqueName) {
|
28920
29854
|
config.uniqueName = uniqueKeyName2(table4, [config.name]);
|
@@ -28923,7 +29857,7 @@ var init_common3 = __esm({
|
|
28923
29857
|
this.table = table4;
|
28924
29858
|
}
|
28925
29859
|
};
|
28926
|
-
__publicField(SQLiteColumn,
|
29860
|
+
__publicField(SQLiteColumn, _a170, "SQLiteColumn");
|
28927
29861
|
}
|
28928
29862
|
});
|
28929
29863
|
|
@@ -28938,14 +29872,14 @@ function blob(a, b) {
|
|
28938
29872
|
}
|
28939
29873
|
return new SQLiteBlobBufferBuilder(name2);
|
28940
29874
|
}
|
28941
|
-
var
|
29875
|
+
var _a171, _b116, SQLiteBigIntBuilder, _a172, _b117, SQLiteBigInt, _a173, _b118, SQLiteBlobJsonBuilder, _a174, _b119, SQLiteBlobJson, _a175, _b120, SQLiteBlobBufferBuilder, _a176, _b121, SQLiteBlobBuffer;
|
28942
29876
|
var init_blob = __esm({
|
28943
29877
|
"../drizzle-orm/dist/sqlite-core/columns/blob.js"() {
|
28944
29878
|
"use strict";
|
28945
29879
|
init_entity();
|
28946
29880
|
init_utils2();
|
28947
29881
|
init_common3();
|
28948
|
-
SQLiteBigIntBuilder = class extends (_b116 = SQLiteColumnBuilder,
|
29882
|
+
SQLiteBigIntBuilder = class extends (_b116 = SQLiteColumnBuilder, _a171 = entityKind, _b116) {
|
28949
29883
|
constructor(name2) {
|
28950
29884
|
super(name2, "bigint", "SQLiteBigInt");
|
28951
29885
|
}
|
@@ -28954,8 +29888,8 @@ var init_blob = __esm({
|
|
28954
29888
|
return new SQLiteBigInt(table4, this.config);
|
28955
29889
|
}
|
28956
29890
|
};
|
28957
|
-
__publicField(SQLiteBigIntBuilder,
|
28958
|
-
SQLiteBigInt = class extends (_b117 = SQLiteColumn,
|
29891
|
+
__publicField(SQLiteBigIntBuilder, _a171, "SQLiteBigIntBuilder");
|
29892
|
+
SQLiteBigInt = class extends (_b117 = SQLiteColumn, _a172 = entityKind, _b117) {
|
28959
29893
|
getSQLType() {
|
28960
29894
|
return "blob";
|
28961
29895
|
}
|
@@ -28966,8 +29900,8 @@ var init_blob = __esm({
|
|
28966
29900
|
return Buffer.from(value.toString());
|
28967
29901
|
}
|
28968
29902
|
};
|
28969
|
-
__publicField(SQLiteBigInt,
|
28970
|
-
SQLiteBlobJsonBuilder = class extends (_b118 = SQLiteColumnBuilder,
|
29903
|
+
__publicField(SQLiteBigInt, _a172, "SQLiteBigInt");
|
29904
|
+
SQLiteBlobJsonBuilder = class extends (_b118 = SQLiteColumnBuilder, _a173 = entityKind, _b118) {
|
28971
29905
|
constructor(name2) {
|
28972
29906
|
super(name2, "json", "SQLiteBlobJson");
|
28973
29907
|
}
|
@@ -28979,8 +29913,8 @@ var init_blob = __esm({
|
|
28979
29913
|
);
|
28980
29914
|
}
|
28981
29915
|
};
|
28982
|
-
__publicField(SQLiteBlobJsonBuilder,
|
28983
|
-
SQLiteBlobJson = class extends (_b119 = SQLiteColumn,
|
29916
|
+
__publicField(SQLiteBlobJsonBuilder, _a173, "SQLiteBlobJsonBuilder");
|
29917
|
+
SQLiteBlobJson = class extends (_b119 = SQLiteColumn, _a174 = entityKind, _b119) {
|
28984
29918
|
getSQLType() {
|
28985
29919
|
return "blob";
|
28986
29920
|
}
|
@@ -28991,8 +29925,8 @@ var init_blob = __esm({
|
|
28991
29925
|
return Buffer.from(JSON.stringify(value));
|
28992
29926
|
}
|
28993
29927
|
};
|
28994
|
-
__publicField(SQLiteBlobJson,
|
28995
|
-
SQLiteBlobBufferBuilder = class extends (_b120 = SQLiteColumnBuilder,
|
29928
|
+
__publicField(SQLiteBlobJson, _a174, "SQLiteBlobJson");
|
29929
|
+
SQLiteBlobBufferBuilder = class extends (_b120 = SQLiteColumnBuilder, _a175 = entityKind, _b120) {
|
28996
29930
|
constructor(name2) {
|
28997
29931
|
super(name2, "buffer", "SQLiteBlobBuffer");
|
28998
29932
|
}
|
@@ -29001,13 +29935,13 @@ var init_blob = __esm({
|
|
29001
29935
|
return new SQLiteBlobBuffer(table4, this.config);
|
29002
29936
|
}
|
29003
29937
|
};
|
29004
|
-
__publicField(SQLiteBlobBufferBuilder,
|
29005
|
-
SQLiteBlobBuffer = class extends (_b121 = SQLiteColumn,
|
29938
|
+
__publicField(SQLiteBlobBufferBuilder, _a175, "SQLiteBlobBufferBuilder");
|
29939
|
+
SQLiteBlobBuffer = class extends (_b121 = SQLiteColumn, _a176 = entityKind, _b121) {
|
29006
29940
|
getSQLType() {
|
29007
29941
|
return "blob";
|
29008
29942
|
}
|
29009
29943
|
};
|
29010
|
-
__publicField(SQLiteBlobBuffer,
|
29944
|
+
__publicField(SQLiteBlobBuffer, _a176, "SQLiteBlobBuffer");
|
29011
29945
|
}
|
29012
29946
|
});
|
29013
29947
|
|
@@ -29022,14 +29956,14 @@ function customType2(customTypeParams) {
|
|
29022
29956
|
);
|
29023
29957
|
};
|
29024
29958
|
}
|
29025
|
-
var
|
29959
|
+
var _a177, _b122, SQLiteCustomColumnBuilder, _a178, _b123, SQLiteCustomColumn;
|
29026
29960
|
var init_custom2 = __esm({
|
29027
29961
|
"../drizzle-orm/dist/sqlite-core/columns/custom.js"() {
|
29028
29962
|
"use strict";
|
29029
29963
|
init_entity();
|
29030
29964
|
init_utils2();
|
29031
29965
|
init_common3();
|
29032
|
-
SQLiteCustomColumnBuilder = class extends (_b122 = SQLiteColumnBuilder,
|
29966
|
+
SQLiteCustomColumnBuilder = class extends (_b122 = SQLiteColumnBuilder, _a177 = entityKind, _b122) {
|
29033
29967
|
constructor(name2, fieldConfig, customTypeParams) {
|
29034
29968
|
super(name2, "custom", "SQLiteCustomColumn");
|
29035
29969
|
this.config.fieldConfig = fieldConfig;
|
@@ -29043,8 +29977,8 @@ var init_custom2 = __esm({
|
|
29043
29977
|
);
|
29044
29978
|
}
|
29045
29979
|
};
|
29046
|
-
__publicField(SQLiteCustomColumnBuilder,
|
29047
|
-
SQLiteCustomColumn = class extends (_b123 = SQLiteColumn,
|
29980
|
+
__publicField(SQLiteCustomColumnBuilder, _a177, "SQLiteCustomColumnBuilder");
|
29981
|
+
SQLiteCustomColumn = class extends (_b123 = SQLiteColumn, _a178 = entityKind, _b123) {
|
29048
29982
|
constructor(table4, config) {
|
29049
29983
|
super(table4, config);
|
29050
29984
|
__publicField(this, "sqlName");
|
@@ -29064,7 +29998,7 @@ var init_custom2 = __esm({
|
|
29064
29998
|
return typeof this.mapTo === "function" ? this.mapTo(value) : value;
|
29065
29999
|
}
|
29066
30000
|
};
|
29067
|
-
__publicField(SQLiteCustomColumn,
|
30001
|
+
__publicField(SQLiteCustomColumn, _a178, "SQLiteCustomColumn");
|
29068
30002
|
}
|
29069
30003
|
});
|
29070
30004
|
|
@@ -29079,7 +30013,7 @@ function integer2(a, b) {
|
|
29079
30013
|
}
|
29080
30014
|
return new SQLiteIntegerBuilder(name2);
|
29081
30015
|
}
|
29082
|
-
var
|
30016
|
+
var _a179, _b124, SQLiteBaseIntegerBuilder, _a180, _b125, SQLiteBaseInteger, _a181, _b126, SQLiteIntegerBuilder, _a182, _b127, SQLiteInteger, _a183, _b128, SQLiteTimestampBuilder, _a184, _b129, SQLiteTimestamp, _a185, _b130, SQLiteBooleanBuilder, _a186, _b131, SQLiteBoolean;
|
29083
30017
|
var init_integer2 = __esm({
|
29084
30018
|
"../drizzle-orm/dist/sqlite-core/columns/integer.js"() {
|
29085
30019
|
"use strict";
|
@@ -29087,7 +30021,7 @@ var init_integer2 = __esm({
|
|
29087
30021
|
init_sql();
|
29088
30022
|
init_utils2();
|
29089
30023
|
init_common3();
|
29090
|
-
SQLiteBaseIntegerBuilder = class extends (_b124 = SQLiteColumnBuilder,
|
30024
|
+
SQLiteBaseIntegerBuilder = class extends (_b124 = SQLiteColumnBuilder, _a179 = entityKind, _b124) {
|
29091
30025
|
constructor(name2, dataType, columnType) {
|
29092
30026
|
super(name2, dataType, columnType);
|
29093
30027
|
this.config.autoIncrement = false;
|
@@ -29100,8 +30034,8 @@ var init_integer2 = __esm({
|
|
29100
30034
|
return super.primaryKey();
|
29101
30035
|
}
|
29102
30036
|
};
|
29103
|
-
__publicField(SQLiteBaseIntegerBuilder,
|
29104
|
-
SQLiteBaseInteger = class extends (_b125 = SQLiteColumn,
|
30037
|
+
__publicField(SQLiteBaseIntegerBuilder, _a179, "SQLiteBaseIntegerBuilder");
|
30038
|
+
SQLiteBaseInteger = class extends (_b125 = SQLiteColumn, _a180 = entityKind, _b125) {
|
29105
30039
|
constructor() {
|
29106
30040
|
super(...arguments);
|
29107
30041
|
__publicField(this, "autoIncrement", this.config.autoIncrement);
|
@@ -29110,8 +30044,8 @@ var init_integer2 = __esm({
|
|
29110
30044
|
return "integer";
|
29111
30045
|
}
|
29112
30046
|
};
|
29113
|
-
__publicField(SQLiteBaseInteger,
|
29114
|
-
SQLiteIntegerBuilder = class extends (_b126 = SQLiteBaseIntegerBuilder,
|
30047
|
+
__publicField(SQLiteBaseInteger, _a180, "SQLiteBaseInteger");
|
30048
|
+
SQLiteIntegerBuilder = class extends (_b126 = SQLiteBaseIntegerBuilder, _a181 = entityKind, _b126) {
|
29115
30049
|
constructor(name2) {
|
29116
30050
|
super(name2, "number", "SQLiteInteger");
|
29117
30051
|
}
|
@@ -29122,11 +30056,11 @@ var init_integer2 = __esm({
|
|
29122
30056
|
);
|
29123
30057
|
}
|
29124
30058
|
};
|
29125
|
-
__publicField(SQLiteIntegerBuilder,
|
29126
|
-
SQLiteInteger = class extends (_b127 = SQLiteBaseInteger,
|
30059
|
+
__publicField(SQLiteIntegerBuilder, _a181, "SQLiteIntegerBuilder");
|
30060
|
+
SQLiteInteger = class extends (_b127 = SQLiteBaseInteger, _a182 = entityKind, _b127) {
|
29127
30061
|
};
|
29128
|
-
__publicField(SQLiteInteger,
|
29129
|
-
SQLiteTimestampBuilder = class extends (_b128 = SQLiteBaseIntegerBuilder,
|
30062
|
+
__publicField(SQLiteInteger, _a182, "SQLiteInteger");
|
30063
|
+
SQLiteTimestampBuilder = class extends (_b128 = SQLiteBaseIntegerBuilder, _a183 = entityKind, _b128) {
|
29130
30064
|
constructor(name2, mode) {
|
29131
30065
|
super(name2, "date", "SQLiteTimestamp");
|
29132
30066
|
this.config.mode = mode;
|
@@ -29146,8 +30080,8 @@ var init_integer2 = __esm({
|
|
29146
30080
|
);
|
29147
30081
|
}
|
29148
30082
|
};
|
29149
|
-
__publicField(SQLiteTimestampBuilder,
|
29150
|
-
SQLiteTimestamp = class extends (_b129 = SQLiteBaseInteger,
|
30083
|
+
__publicField(SQLiteTimestampBuilder, _a183, "SQLiteTimestampBuilder");
|
30084
|
+
SQLiteTimestamp = class extends (_b129 = SQLiteBaseInteger, _a184 = entityKind, _b129) {
|
29151
30085
|
constructor() {
|
29152
30086
|
super(...arguments);
|
29153
30087
|
__publicField(this, "mode", this.config.mode);
|
@@ -29166,8 +30100,8 @@ var init_integer2 = __esm({
|
|
29166
30100
|
return unix;
|
29167
30101
|
}
|
29168
30102
|
};
|
29169
|
-
__publicField(SQLiteTimestamp,
|
29170
|
-
SQLiteBooleanBuilder = class extends (_b130 = SQLiteBaseIntegerBuilder,
|
30103
|
+
__publicField(SQLiteTimestamp, _a184, "SQLiteTimestamp");
|
30104
|
+
SQLiteBooleanBuilder = class extends (_b130 = SQLiteBaseIntegerBuilder, _a185 = entityKind, _b130) {
|
29171
30105
|
constructor(name2, mode) {
|
29172
30106
|
super(name2, "boolean", "SQLiteBoolean");
|
29173
30107
|
this.config.mode = mode;
|
@@ -29179,8 +30113,8 @@ var init_integer2 = __esm({
|
|
29179
30113
|
);
|
29180
30114
|
}
|
29181
30115
|
};
|
29182
|
-
__publicField(SQLiteBooleanBuilder,
|
29183
|
-
SQLiteBoolean = class extends (_b131 = SQLiteBaseInteger,
|
30116
|
+
__publicField(SQLiteBooleanBuilder, _a185, "SQLiteBooleanBuilder");
|
30117
|
+
SQLiteBoolean = class extends (_b131 = SQLiteBaseInteger, _a186 = entityKind, _b131) {
|
29184
30118
|
constructor() {
|
29185
30119
|
super(...arguments);
|
29186
30120
|
__publicField(this, "mode", this.config.mode);
|
@@ -29192,7 +30126,7 @@ var init_integer2 = __esm({
|
|
29192
30126
|
return value ? 1 : 0;
|
29193
30127
|
}
|
29194
30128
|
};
|
29195
|
-
__publicField(SQLiteBoolean,
|
30129
|
+
__publicField(SQLiteBoolean, _a186, "SQLiteBoolean");
|
29196
30130
|
}
|
29197
30131
|
});
|
29198
30132
|
|
@@ -29200,13 +30134,13 @@ var init_integer2 = __esm({
|
|
29200
30134
|
function numeric2(name2) {
|
29201
30135
|
return new SQLiteNumericBuilder(name2 ?? "");
|
29202
30136
|
}
|
29203
|
-
var
|
30137
|
+
var _a187, _b132, SQLiteNumericBuilder, _a188, _b133, SQLiteNumeric;
|
29204
30138
|
var init_numeric2 = __esm({
|
29205
30139
|
"../drizzle-orm/dist/sqlite-core/columns/numeric.js"() {
|
29206
30140
|
"use strict";
|
29207
30141
|
init_entity();
|
29208
30142
|
init_common3();
|
29209
|
-
SQLiteNumericBuilder = class extends (_b132 = SQLiteColumnBuilder,
|
30143
|
+
SQLiteNumericBuilder = class extends (_b132 = SQLiteColumnBuilder, _a187 = entityKind, _b132) {
|
29210
30144
|
constructor(name2) {
|
29211
30145
|
super(name2, "string", "SQLiteNumeric");
|
29212
30146
|
}
|
@@ -29218,13 +30152,13 @@ var init_numeric2 = __esm({
|
|
29218
30152
|
);
|
29219
30153
|
}
|
29220
30154
|
};
|
29221
|
-
__publicField(SQLiteNumericBuilder,
|
29222
|
-
SQLiteNumeric = class extends (_b133 = SQLiteColumn,
|
30155
|
+
__publicField(SQLiteNumericBuilder, _a187, "SQLiteNumericBuilder");
|
30156
|
+
SQLiteNumeric = class extends (_b133 = SQLiteColumn, _a188 = entityKind, _b133) {
|
29223
30157
|
getSQLType() {
|
29224
30158
|
return "numeric";
|
29225
30159
|
}
|
29226
30160
|
};
|
29227
|
-
__publicField(SQLiteNumeric,
|
30161
|
+
__publicField(SQLiteNumeric, _a188, "SQLiteNumeric");
|
29228
30162
|
}
|
29229
30163
|
});
|
29230
30164
|
|
@@ -29232,13 +30166,13 @@ var init_numeric2 = __esm({
|
|
29232
30166
|
function real2(name2) {
|
29233
30167
|
return new SQLiteRealBuilder(name2 ?? "");
|
29234
30168
|
}
|
29235
|
-
var
|
30169
|
+
var _a189, _b134, SQLiteRealBuilder, _a190, _b135, SQLiteReal;
|
29236
30170
|
var init_real2 = __esm({
|
29237
30171
|
"../drizzle-orm/dist/sqlite-core/columns/real.js"() {
|
29238
30172
|
"use strict";
|
29239
30173
|
init_entity();
|
29240
30174
|
init_common3();
|
29241
|
-
SQLiteRealBuilder = class extends (_b134 = SQLiteColumnBuilder,
|
30175
|
+
SQLiteRealBuilder = class extends (_b134 = SQLiteColumnBuilder, _a189 = entityKind, _b134) {
|
29242
30176
|
constructor(name2) {
|
29243
30177
|
super(name2, "number", "SQLiteReal");
|
29244
30178
|
}
|
@@ -29247,13 +30181,13 @@ var init_real2 = __esm({
|
|
29247
30181
|
return new SQLiteReal(table4, this.config);
|
29248
30182
|
}
|
29249
30183
|
};
|
29250
|
-
__publicField(SQLiteRealBuilder,
|
29251
|
-
SQLiteReal = class extends (_b135 = SQLiteColumn,
|
30184
|
+
__publicField(SQLiteRealBuilder, _a189, "SQLiteRealBuilder");
|
30185
|
+
SQLiteReal = class extends (_b135 = SQLiteColumn, _a190 = entityKind, _b135) {
|
29252
30186
|
getSQLType() {
|
29253
30187
|
return "real";
|
29254
30188
|
}
|
29255
30189
|
};
|
29256
|
-
__publicField(SQLiteReal,
|
30190
|
+
__publicField(SQLiteReal, _a190, "SQLiteReal");
|
29257
30191
|
}
|
29258
30192
|
});
|
29259
30193
|
|
@@ -29265,14 +30199,14 @@ function text2(a, b = {}) {
|
|
29265
30199
|
}
|
29266
30200
|
return new SQLiteTextBuilder(name2, config);
|
29267
30201
|
}
|
29268
|
-
var
|
30202
|
+
var _a191, _b136, SQLiteTextBuilder, _a192, _b137, SQLiteText, _a193, _b138, SQLiteTextJsonBuilder, _a194, _b139, SQLiteTextJson;
|
29269
30203
|
var init_text2 = __esm({
|
29270
30204
|
"../drizzle-orm/dist/sqlite-core/columns/text.js"() {
|
29271
30205
|
"use strict";
|
29272
30206
|
init_entity();
|
29273
30207
|
init_utils2();
|
29274
30208
|
init_common3();
|
29275
|
-
SQLiteTextBuilder = class extends (_b136 = SQLiteColumnBuilder,
|
30209
|
+
SQLiteTextBuilder = class extends (_b136 = SQLiteColumnBuilder, _a191 = entityKind, _b136) {
|
29276
30210
|
constructor(name2, config) {
|
29277
30211
|
super(name2, "string", "SQLiteText");
|
29278
30212
|
this.config.enumValues = config.enum;
|
@@ -29283,8 +30217,8 @@ var init_text2 = __esm({
|
|
29283
30217
|
return new SQLiteText(table4, this.config);
|
29284
30218
|
}
|
29285
30219
|
};
|
29286
|
-
__publicField(SQLiteTextBuilder,
|
29287
|
-
SQLiteText = class extends (_b137 = SQLiteColumn,
|
30220
|
+
__publicField(SQLiteTextBuilder, _a191, "SQLiteTextBuilder");
|
30221
|
+
SQLiteText = class extends (_b137 = SQLiteColumn, _a192 = entityKind, _b137) {
|
29288
30222
|
constructor(table4, config) {
|
29289
30223
|
super(table4, config);
|
29290
30224
|
__publicField(this, "enumValues", this.config.enumValues);
|
@@ -29294,8 +30228,8 @@ var init_text2 = __esm({
|
|
29294
30228
|
return `text${this.config.length ? `(${this.config.length})` : ""}`;
|
29295
30229
|
}
|
29296
30230
|
};
|
29297
|
-
__publicField(SQLiteText,
|
29298
|
-
SQLiteTextJsonBuilder = class extends (_b138 = SQLiteColumnBuilder,
|
30231
|
+
__publicField(SQLiteText, _a192, "SQLiteText");
|
30232
|
+
SQLiteTextJsonBuilder = class extends (_b138 = SQLiteColumnBuilder, _a193 = entityKind, _b138) {
|
29299
30233
|
constructor(name2) {
|
29300
30234
|
super(name2, "json", "SQLiteTextJson");
|
29301
30235
|
}
|
@@ -29307,8 +30241,8 @@ var init_text2 = __esm({
|
|
29307
30241
|
);
|
29308
30242
|
}
|
29309
30243
|
};
|
29310
|
-
__publicField(SQLiteTextJsonBuilder,
|
29311
|
-
SQLiteTextJson = class extends (_b139 = SQLiteColumn,
|
30244
|
+
__publicField(SQLiteTextJsonBuilder, _a193, "SQLiteTextJsonBuilder");
|
30245
|
+
SQLiteTextJson = class extends (_b139 = SQLiteColumn, _a194 = entityKind, _b139) {
|
29312
30246
|
getSQLType() {
|
29313
30247
|
return "text";
|
29314
30248
|
}
|
@@ -29319,7 +30253,7 @@ var init_text2 = __esm({
|
|
29319
30253
|
return JSON.stringify(value);
|
29320
30254
|
}
|
29321
30255
|
};
|
29322
|
-
__publicField(SQLiteTextJson,
|
30256
|
+
__publicField(SQLiteTextJson, _a194, "SQLiteTextJson");
|
29323
30257
|
}
|
29324
30258
|
});
|
29325
30259
|
|
@@ -29381,7 +30315,7 @@ function sqliteTableBase(name2, columns, extraConfig, schema4, baseName = name2)
|
|
29381
30315
|
}
|
29382
30316
|
return table4;
|
29383
30317
|
}
|
29384
|
-
var InlineForeignKeys2,
|
30318
|
+
var InlineForeignKeys2, _a195, _b140, _c6, _d3, _e3, SQLiteTable, sqliteTable;
|
29385
30319
|
var init_table3 = __esm({
|
29386
30320
|
"../drizzle-orm/dist/sqlite-core/table.js"() {
|
29387
30321
|
"use strict";
|
@@ -29389,7 +30323,7 @@ var init_table3 = __esm({
|
|
29389
30323
|
init_table();
|
29390
30324
|
init_all2();
|
29391
30325
|
InlineForeignKeys2 = Symbol.for("drizzle:SQLiteInlineForeignKeys");
|
29392
|
-
SQLiteTable = class extends (
|
30326
|
+
SQLiteTable = class extends (_e3 = Table, _d3 = entityKind, _c6 = Table.Symbol.Columns, _b140 = InlineForeignKeys2, _a195 = Table.Symbol.ExtraConfigBuilder, _e3) {
|
29393
30327
|
constructor() {
|
29394
30328
|
super(...arguments);
|
29395
30329
|
/** @internal */
|
@@ -29397,7 +30331,7 @@ var init_table3 = __esm({
|
|
29397
30331
|
/** @internal */
|
29398
30332
|
__publicField(this, _b140, []);
|
29399
30333
|
/** @internal */
|
29400
|
-
__publicField(this,
|
30334
|
+
__publicField(this, _a195);
|
29401
30335
|
}
|
29402
30336
|
};
|
29403
30337
|
__publicField(SQLiteTable, _d3, "SQLiteTable");
|
@@ -29412,7 +30346,7 @@ var init_table3 = __esm({
|
|
29412
30346
|
});
|
29413
30347
|
|
29414
30348
|
// ../drizzle-orm/dist/sqlite-core/query-builders/delete.js
|
29415
|
-
var
|
30349
|
+
var _a196, _b141, SQLiteDeleteBase;
|
29416
30350
|
var init_delete2 = __esm({
|
29417
30351
|
"../drizzle-orm/dist/sqlite-core/query-builders/delete.js"() {
|
29418
30352
|
"use strict";
|
@@ -29422,7 +30356,7 @@ var init_delete2 = __esm({
|
|
29422
30356
|
init_table3();
|
29423
30357
|
init_table();
|
29424
30358
|
init_utils2();
|
29425
|
-
SQLiteDeleteBase = class extends (_b141 = QueryPromise,
|
30359
|
+
SQLiteDeleteBase = class extends (_b141 = QueryPromise, _a196 = entityKind, _b141) {
|
29426
30360
|
constructor(table4, session, dialect4, withList) {
|
29427
30361
|
super();
|
29428
30362
|
/** @internal */
|
@@ -29528,12 +30462,12 @@ var init_delete2 = __esm({
|
|
29528
30462
|
return this;
|
29529
30463
|
}
|
29530
30464
|
};
|
29531
|
-
__publicField(SQLiteDeleteBase,
|
30465
|
+
__publicField(SQLiteDeleteBase, _a196, "SQLiteDelete");
|
29532
30466
|
}
|
29533
30467
|
});
|
29534
30468
|
|
29535
30469
|
// ../drizzle-orm/dist/sqlite-core/query-builders/insert.js
|
29536
|
-
var
|
30470
|
+
var _a197, SQLiteInsertBuilder, _a198, _b142, SQLiteInsertBase;
|
29537
30471
|
var init_insert2 = __esm({
|
29538
30472
|
"../drizzle-orm/dist/sqlite-core/query-builders/insert.js"() {
|
29539
30473
|
"use strict";
|
@@ -29543,7 +30477,7 @@ var init_insert2 = __esm({
|
|
29543
30477
|
init_table3();
|
29544
30478
|
init_table();
|
29545
30479
|
init_utils2();
|
29546
|
-
|
30480
|
+
_a197 = entityKind;
|
29547
30481
|
SQLiteInsertBuilder = class {
|
29548
30482
|
constructor(table4, session, dialect4, withList) {
|
29549
30483
|
this.table = table4;
|
@@ -29568,8 +30502,8 @@ var init_insert2 = __esm({
|
|
29568
30502
|
return new SQLiteInsertBase(this.table, mappedValues, this.session, this.dialect, this.withList);
|
29569
30503
|
}
|
29570
30504
|
};
|
29571
|
-
__publicField(SQLiteInsertBuilder,
|
29572
|
-
SQLiteInsertBase = class extends (_b142 = QueryPromise,
|
30505
|
+
__publicField(SQLiteInsertBuilder, _a197, "SQLiteInsertBuilder");
|
30506
|
+
SQLiteInsertBase = class extends (_b142 = QueryPromise, _a198 = entityKind, _b142) {
|
29573
30507
|
constructor(table4, values, session, dialect4, withList) {
|
29574
30508
|
super();
|
29575
30509
|
/** @internal */
|
@@ -29696,25 +30630,25 @@ var init_insert2 = __esm({
|
|
29696
30630
|
return this;
|
29697
30631
|
}
|
29698
30632
|
};
|
29699
|
-
__publicField(SQLiteInsertBase,
|
30633
|
+
__publicField(SQLiteInsertBase, _a198, "SQLiteInsert");
|
29700
30634
|
}
|
29701
30635
|
});
|
29702
30636
|
|
29703
30637
|
// ../drizzle-orm/dist/sqlite-core/view-base.js
|
29704
|
-
var
|
30638
|
+
var _a199, _b143, SQLiteViewBase;
|
29705
30639
|
var init_view_base2 = __esm({
|
29706
30640
|
"../drizzle-orm/dist/sqlite-core/view-base.js"() {
|
29707
30641
|
"use strict";
|
29708
30642
|
init_entity();
|
29709
30643
|
init_sql();
|
29710
|
-
SQLiteViewBase = class extends (_b143 = View3,
|
30644
|
+
SQLiteViewBase = class extends (_b143 = View3, _a199 = entityKind, _b143) {
|
29711
30645
|
};
|
29712
|
-
__publicField(SQLiteViewBase,
|
30646
|
+
__publicField(SQLiteViewBase, _a199, "SQLiteViewBase");
|
29713
30647
|
}
|
29714
30648
|
});
|
29715
30649
|
|
29716
30650
|
// ../drizzle-orm/dist/sqlite-core/dialect.js
|
29717
|
-
var
|
30651
|
+
var _a200, SQLiteDialect, _a201, _b144, SQLiteSyncDialect, _a202, _b145, SQLiteAsyncDialect;
|
29718
30652
|
var init_dialect2 = __esm({
|
29719
30653
|
"../drizzle-orm/dist/sqlite-core/dialect.js"() {
|
29720
30654
|
"use strict";
|
@@ -29733,7 +30667,7 @@ var init_dialect2 = __esm({
|
|
29733
30667
|
init_utils2();
|
29734
30668
|
init_view_common();
|
29735
30669
|
init_view_base2();
|
29736
|
-
|
30670
|
+
_a200 = entityKind;
|
29737
30671
|
SQLiteDialect = class {
|
29738
30672
|
constructor(config) {
|
29739
30673
|
/** @internal */
|
@@ -30255,8 +31189,8 @@ var init_dialect2 = __esm({
|
|
30255
31189
|
};
|
30256
31190
|
}
|
30257
31191
|
};
|
30258
|
-
__publicField(SQLiteDialect,
|
30259
|
-
SQLiteSyncDialect = class extends (_b144 = SQLiteDialect,
|
31192
|
+
__publicField(SQLiteDialect, _a200, "SQLiteDialect");
|
31193
|
+
SQLiteSyncDialect = class extends (_b144 = SQLiteDialect, _a201 = entityKind, _b144) {
|
30260
31194
|
migrate(migrations, session, config) {
|
30261
31195
|
const migrationsTable = config === void 0 ? "__drizzle_migrations" : typeof config === "string" ? "__drizzle_migrations" : config.migrationsTable ?? "__drizzle_migrations";
|
30262
31196
|
const migrationTableCreate = sql`
|
@@ -30290,8 +31224,8 @@ var init_dialect2 = __esm({
|
|
30290
31224
|
}
|
30291
31225
|
}
|
30292
31226
|
};
|
30293
|
-
__publicField(SQLiteSyncDialect,
|
30294
|
-
SQLiteAsyncDialect = class extends (_b145 = SQLiteDialect,
|
31227
|
+
__publicField(SQLiteSyncDialect, _a201, "SQLiteSyncDialect");
|
31228
|
+
SQLiteAsyncDialect = class extends (_b145 = SQLiteDialect, _a202 = entityKind, _b145) {
|
30295
31229
|
async migrate(migrations, session, config) {
|
30296
31230
|
const migrationsTable = config === void 0 ? "__drizzle_migrations" : typeof config === "string" ? "__drizzle_migrations" : config.migrationsTable ?? "__drizzle_migrations";
|
30297
31231
|
const migrationTableCreate = sql`
|
@@ -30320,7 +31254,7 @@ var init_dialect2 = __esm({
|
|
30320
31254
|
});
|
30321
31255
|
}
|
30322
31256
|
};
|
30323
|
-
__publicField(SQLiteAsyncDialect,
|
31257
|
+
__publicField(SQLiteAsyncDialect, _a202, "SQLiteAsyncDialect");
|
30324
31258
|
}
|
30325
31259
|
});
|
30326
31260
|
|
@@ -30342,7 +31276,7 @@ function createSetOperator2(type, isAll) {
|
|
30342
31276
|
return leftSelect.addSetOperators(setOperators);
|
30343
31277
|
};
|
30344
31278
|
}
|
30345
|
-
var
|
31279
|
+
var _a203, SQLiteSelectBuilder, _a204, _b146, SQLiteSelectQueryBuilderBase, _a205, _b147, SQLiteSelectBase, getSQLiteSetOperators, union2, unionAll2, intersect2, except2;
|
30346
31280
|
var init_select3 = __esm({
|
30347
31281
|
"../drizzle-orm/dist/sqlite-core/query-builders/select.js"() {
|
30348
31282
|
"use strict";
|
@@ -30356,7 +31290,7 @@ var init_select3 = __esm({
|
|
30356
31290
|
init_utils2();
|
30357
31291
|
init_view_common();
|
30358
31292
|
init_view_base2();
|
30359
|
-
|
31293
|
+
_a203 = entityKind;
|
30360
31294
|
SQLiteSelectBuilder = class {
|
30361
31295
|
constructor(config) {
|
30362
31296
|
__publicField(this, "fields");
|
@@ -30397,8 +31331,8 @@ var init_select3 = __esm({
|
|
30397
31331
|
});
|
30398
31332
|
}
|
30399
31333
|
};
|
30400
|
-
__publicField(SQLiteSelectBuilder,
|
30401
|
-
SQLiteSelectQueryBuilderBase = class extends (_b146 = TypedQueryBuilder,
|
31334
|
+
__publicField(SQLiteSelectBuilder, _a203, "SQLiteSelectBuilder");
|
31335
|
+
SQLiteSelectQueryBuilderBase = class extends (_b146 = TypedQueryBuilder, _a204 = entityKind, _b146) {
|
30402
31336
|
constructor({ table: table4, fields, isPartialSelect, session, dialect: dialect4, withList, distinct }) {
|
30403
31337
|
super();
|
30404
31338
|
__publicField(this, "_");
|
@@ -30903,8 +31837,8 @@ var init_select3 = __esm({
|
|
30903
31837
|
return this;
|
30904
31838
|
}
|
30905
31839
|
};
|
30906
|
-
__publicField(SQLiteSelectQueryBuilderBase,
|
30907
|
-
SQLiteSelectBase = class extends (_b147 = SQLiteSelectQueryBuilderBase,
|
31840
|
+
__publicField(SQLiteSelectQueryBuilderBase, _a204, "SQLiteSelectQueryBuilder");
|
31841
|
+
SQLiteSelectBase = class extends (_b147 = SQLiteSelectQueryBuilderBase, _a205 = entityKind, _b147) {
|
30908
31842
|
constructor() {
|
30909
31843
|
super(...arguments);
|
30910
31844
|
__publicField(this, "run", (placeholderValues) => {
|
@@ -30942,7 +31876,7 @@ var init_select3 = __esm({
|
|
30942
31876
|
return this.all();
|
30943
31877
|
}
|
30944
31878
|
};
|
30945
|
-
__publicField(SQLiteSelectBase,
|
31879
|
+
__publicField(SQLiteSelectBase, _a205, "SQLiteSelect");
|
30946
31880
|
applyMixins(SQLiteSelectBase, [QueryPromise]);
|
30947
31881
|
getSQLiteSetOperators = () => ({
|
30948
31882
|
union: union2,
|
@@ -30958,7 +31892,7 @@ var init_select3 = __esm({
|
|
30958
31892
|
});
|
30959
31893
|
|
30960
31894
|
// ../drizzle-orm/dist/sqlite-core/query-builders/query-builder.js
|
30961
|
-
var
|
31895
|
+
var _a206, QueryBuilder2;
|
30962
31896
|
var init_query_builder3 = __esm({
|
30963
31897
|
"../drizzle-orm/dist/sqlite-core/query-builders/query-builder.js"() {
|
30964
31898
|
"use strict";
|
@@ -30967,7 +31901,7 @@ var init_query_builder3 = __esm({
|
|
30967
31901
|
init_dialect2();
|
30968
31902
|
init_subquery();
|
30969
31903
|
init_select3();
|
30970
|
-
|
31904
|
+
_a206 = entityKind;
|
30971
31905
|
QueryBuilder2 = class {
|
30972
31906
|
constructor(dialect4) {
|
30973
31907
|
__publicField(this, "dialect");
|
@@ -31029,7 +31963,7 @@ var init_query_builder3 = __esm({
|
|
31029
31963
|
return this.dialect;
|
31030
31964
|
}
|
31031
31965
|
};
|
31032
|
-
__publicField(QueryBuilder2,
|
31966
|
+
__publicField(QueryBuilder2, _a206, "SQLiteQueryBuilder");
|
31033
31967
|
}
|
31034
31968
|
});
|
31035
31969
|
|
@@ -31041,7 +31975,7 @@ var init_select_types2 = __esm({
|
|
31041
31975
|
});
|
31042
31976
|
|
31043
31977
|
// ../drizzle-orm/dist/sqlite-core/query-builders/update.js
|
31044
|
-
var
|
31978
|
+
var _a207, SQLiteUpdateBuilder, _a208, _b148, SQLiteUpdateBase;
|
31045
31979
|
var init_update2 = __esm({
|
31046
31980
|
"../drizzle-orm/dist/sqlite-core/query-builders/update.js"() {
|
31047
31981
|
"use strict";
|
@@ -31051,7 +31985,7 @@ var init_update2 = __esm({
|
|
31051
31985
|
init_table3();
|
31052
31986
|
init_table();
|
31053
31987
|
init_utils2();
|
31054
|
-
|
31988
|
+
_a207 = entityKind;
|
31055
31989
|
SQLiteUpdateBuilder = class {
|
31056
31990
|
constructor(table4, session, dialect4, withList) {
|
31057
31991
|
this.table = table4;
|
@@ -31069,8 +32003,8 @@ var init_update2 = __esm({
|
|
31069
32003
|
);
|
31070
32004
|
}
|
31071
32005
|
};
|
31072
|
-
__publicField(SQLiteUpdateBuilder,
|
31073
|
-
SQLiteUpdateBase = class extends (_b148 = QueryPromise,
|
32006
|
+
__publicField(SQLiteUpdateBuilder, _a207, "SQLiteUpdateBuilder");
|
32007
|
+
SQLiteUpdateBase = class extends (_b148 = QueryPromise, _a208 = entityKind, _b148) {
|
31074
32008
|
constructor(table4, set, session, dialect4, withList) {
|
31075
32009
|
super();
|
31076
32010
|
/** @internal */
|
@@ -31179,7 +32113,7 @@ var init_update2 = __esm({
|
|
31179
32113
|
return this;
|
31180
32114
|
}
|
31181
32115
|
};
|
31182
|
-
__publicField(SQLiteUpdateBase,
|
32116
|
+
__publicField(SQLiteUpdateBase, _a208, "SQLiteUpdate");
|
31183
32117
|
}
|
31184
32118
|
});
|
31185
32119
|
|
@@ -31197,17 +32131,17 @@ var init_query_builders2 = __esm({
|
|
31197
32131
|
});
|
31198
32132
|
|
31199
32133
|
// ../drizzle-orm/dist/sqlite-core/query-builders/count.js
|
31200
|
-
var
|
32134
|
+
var _a209, _b149, _c7, _SQLiteCountBuilder, SQLiteCountBuilder;
|
31201
32135
|
var init_count2 = __esm({
|
31202
32136
|
"../drizzle-orm/dist/sqlite-core/query-builders/count.js"() {
|
31203
32137
|
"use strict";
|
31204
32138
|
init_entity();
|
31205
32139
|
init_sql();
|
31206
|
-
_SQLiteCountBuilder = class _SQLiteCountBuilder extends (_c7 = SQL, _b149 = entityKind,
|
32140
|
+
_SQLiteCountBuilder = class _SQLiteCountBuilder extends (_c7 = SQL, _b149 = entityKind, _a209 = Symbol.toStringTag, _c7) {
|
31207
32141
|
constructor(params) {
|
31208
32142
|
super(_SQLiteCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
|
31209
32143
|
__publicField(this, "sql");
|
31210
|
-
__publicField(this,
|
32144
|
+
__publicField(this, _a209, "SQLiteCountBuilderAsync");
|
31211
32145
|
__publicField(this, "session");
|
31212
32146
|
this.params = params;
|
31213
32147
|
this.session = params.session;
|
@@ -31250,14 +32184,14 @@ var init_count2 = __esm({
|
|
31250
32184
|
});
|
31251
32185
|
|
31252
32186
|
// ../drizzle-orm/dist/sqlite-core/query-builders/query.js
|
31253
|
-
var
|
32187
|
+
var _a210, RelationalQueryBuilder2, _a211, _b150, SQLiteRelationalQuery, _a212, _b151, SQLiteSyncRelationalQuery;
|
31254
32188
|
var init_query2 = __esm({
|
31255
32189
|
"../drizzle-orm/dist/sqlite-core/query-builders/query.js"() {
|
31256
32190
|
"use strict";
|
31257
32191
|
init_entity();
|
31258
32192
|
init_query_promise();
|
31259
32193
|
init_relations();
|
31260
|
-
|
32194
|
+
_a210 = entityKind;
|
31261
32195
|
RelationalQueryBuilder2 = class {
|
31262
32196
|
constructor(mode, fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session) {
|
31263
32197
|
this.mode = mode;
|
@@ -31316,8 +32250,8 @@ var init_query2 = __esm({
|
|
31316
32250
|
);
|
31317
32251
|
}
|
31318
32252
|
};
|
31319
|
-
__publicField(RelationalQueryBuilder2,
|
31320
|
-
SQLiteRelationalQuery = class extends (_b150 = QueryPromise,
|
32253
|
+
__publicField(RelationalQueryBuilder2, _a210, "SQLiteAsyncRelationalQueryBuilder");
|
32254
|
+
SQLiteRelationalQuery = class extends (_b150 = QueryPromise, _a211 = entityKind, _b150) {
|
31321
32255
|
constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, config, mode) {
|
31322
32256
|
super();
|
31323
32257
|
/** @internal */
|
@@ -31393,24 +32327,24 @@ var init_query2 = __esm({
|
|
31393
32327
|
return this.executeRaw();
|
31394
32328
|
}
|
31395
32329
|
};
|
31396
|
-
__publicField(SQLiteRelationalQuery,
|
31397
|
-
SQLiteSyncRelationalQuery = class extends (_b151 = SQLiteRelationalQuery,
|
32330
|
+
__publicField(SQLiteRelationalQuery, _a211, "SQLiteAsyncRelationalQuery");
|
32331
|
+
SQLiteSyncRelationalQuery = class extends (_b151 = SQLiteRelationalQuery, _a212 = entityKind, _b151) {
|
31398
32332
|
sync() {
|
31399
32333
|
return this.executeRaw();
|
31400
32334
|
}
|
31401
32335
|
};
|
31402
|
-
__publicField(SQLiteSyncRelationalQuery,
|
32336
|
+
__publicField(SQLiteSyncRelationalQuery, _a212, "SQLiteSyncRelationalQuery");
|
31403
32337
|
}
|
31404
32338
|
});
|
31405
32339
|
|
31406
32340
|
// ../drizzle-orm/dist/sqlite-core/query-builders/raw.js
|
31407
|
-
var
|
32341
|
+
var _a213, _b152, SQLiteRaw;
|
31408
32342
|
var init_raw2 = __esm({
|
31409
32343
|
"../drizzle-orm/dist/sqlite-core/query-builders/raw.js"() {
|
31410
32344
|
"use strict";
|
31411
32345
|
init_entity();
|
31412
32346
|
init_query_promise();
|
31413
|
-
SQLiteRaw = class extends (_b152 = QueryPromise,
|
32347
|
+
SQLiteRaw = class extends (_b152 = QueryPromise, _a213 = entityKind, _b152) {
|
31414
32348
|
constructor(execute, getSQL, action, dialect4, mapBatchResult) {
|
31415
32349
|
super();
|
31416
32350
|
/** @internal */
|
@@ -31435,12 +32369,12 @@ var init_raw2 = __esm({
|
|
31435
32369
|
return false;
|
31436
32370
|
}
|
31437
32371
|
};
|
31438
|
-
__publicField(SQLiteRaw,
|
32372
|
+
__publicField(SQLiteRaw, _a213, "SQLiteRaw");
|
31439
32373
|
}
|
31440
32374
|
});
|
31441
32375
|
|
31442
32376
|
// ../drizzle-orm/dist/sqlite-core/db.js
|
31443
|
-
var
|
32377
|
+
var _a214, BaseSQLiteDatabase;
|
31444
32378
|
var init_db2 = __esm({
|
31445
32379
|
"../drizzle-orm/dist/sqlite-core/db.js"() {
|
31446
32380
|
"use strict";
|
@@ -31452,7 +32386,7 @@ var init_db2 = __esm({
|
|
31452
32386
|
init_count2();
|
31453
32387
|
init_query2();
|
31454
32388
|
init_raw2();
|
31455
|
-
|
32389
|
+
_a214 = entityKind;
|
31456
32390
|
BaseSQLiteDatabase = class {
|
31457
32391
|
constructor(resultKind, dialect4, session, schema4) {
|
31458
32392
|
__publicField(this, "query");
|
@@ -31734,17 +32668,17 @@ var init_db2 = __esm({
|
|
31734
32668
|
return this.session.transaction(transaction, config);
|
31735
32669
|
}
|
31736
32670
|
};
|
31737
|
-
__publicField(BaseSQLiteDatabase,
|
32671
|
+
__publicField(BaseSQLiteDatabase, _a214, "BaseSQLiteDatabase");
|
31738
32672
|
}
|
31739
32673
|
});
|
31740
32674
|
|
31741
32675
|
// ../drizzle-orm/dist/sqlite-core/indexes.js
|
31742
|
-
var
|
32676
|
+
var _a215, IndexBuilderOn2, _a216, IndexBuilder2, _a217, Index4;
|
31743
32677
|
var init_indexes2 = __esm({
|
31744
32678
|
"../drizzle-orm/dist/sqlite-core/indexes.js"() {
|
31745
32679
|
"use strict";
|
31746
32680
|
init_entity();
|
31747
|
-
|
32681
|
+
_a215 = entityKind;
|
31748
32682
|
IndexBuilderOn2 = class {
|
31749
32683
|
constructor(name2, unique) {
|
31750
32684
|
this.name = name2;
|
@@ -31754,8 +32688,8 @@ var init_indexes2 = __esm({
|
|
31754
32688
|
return new IndexBuilder2(this.name, columns, this.unique);
|
31755
32689
|
}
|
31756
32690
|
};
|
31757
|
-
__publicField(IndexBuilderOn2,
|
31758
|
-
|
32691
|
+
__publicField(IndexBuilderOn2, _a215, "SQLiteIndexBuilderOn");
|
32692
|
+
_a216 = entityKind;
|
31759
32693
|
IndexBuilder2 = class {
|
31760
32694
|
constructor(name2, columns, unique) {
|
31761
32695
|
/** @internal */
|
@@ -31779,26 +32713,26 @@ var init_indexes2 = __esm({
|
|
31779
32713
|
return new Index4(this.config, table4);
|
31780
32714
|
}
|
31781
32715
|
};
|
31782
|
-
__publicField(IndexBuilder2,
|
31783
|
-
|
32716
|
+
__publicField(IndexBuilder2, _a216, "SQLiteIndexBuilder");
|
32717
|
+
_a217 = entityKind;
|
31784
32718
|
Index4 = class {
|
31785
32719
|
constructor(config, table4) {
|
31786
32720
|
__publicField(this, "config");
|
31787
32721
|
this.config = { ...config, table: table4 };
|
31788
32722
|
}
|
31789
32723
|
};
|
31790
|
-
__publicField(Index4,
|
32724
|
+
__publicField(Index4, _a217, "SQLiteIndex");
|
31791
32725
|
}
|
31792
32726
|
});
|
31793
32727
|
|
31794
32728
|
// ../drizzle-orm/dist/sqlite-core/primary-keys.js
|
31795
|
-
var
|
32729
|
+
var _a218, PrimaryKeyBuilder2, _a219, PrimaryKey2;
|
31796
32730
|
var init_primary_keys2 = __esm({
|
31797
32731
|
"../drizzle-orm/dist/sqlite-core/primary-keys.js"() {
|
31798
32732
|
"use strict";
|
31799
32733
|
init_entity();
|
31800
32734
|
init_table3();
|
31801
|
-
|
32735
|
+
_a218 = entityKind;
|
31802
32736
|
PrimaryKeyBuilder2 = class {
|
31803
32737
|
constructor(columns, name2) {
|
31804
32738
|
/** @internal */
|
@@ -31813,8 +32747,8 @@ var init_primary_keys2 = __esm({
|
|
31813
32747
|
return new PrimaryKey2(table4, this.columns, this.name);
|
31814
32748
|
}
|
31815
32749
|
};
|
31816
|
-
__publicField(PrimaryKeyBuilder2,
|
31817
|
-
|
32750
|
+
__publicField(PrimaryKeyBuilder2, _a218, "SQLitePrimaryKeyBuilder");
|
32751
|
+
_a219 = entityKind;
|
31818
32752
|
PrimaryKey2 = class {
|
31819
32753
|
constructor(table4, columns, name2) {
|
31820
32754
|
__publicField(this, "columns");
|
@@ -31827,12 +32761,12 @@ var init_primary_keys2 = __esm({
|
|
31827
32761
|
return this.name ?? `${this.table[SQLiteTable.Symbol.Name]}_${this.columns.map((column4) => column4.name).join("_")}_pk`;
|
31828
32762
|
}
|
31829
32763
|
};
|
31830
|
-
__publicField(PrimaryKey2,
|
32764
|
+
__publicField(PrimaryKey2, _a219, "SQLitePrimaryKey");
|
31831
32765
|
}
|
31832
32766
|
});
|
31833
32767
|
|
31834
32768
|
// ../drizzle-orm/dist/sqlite-core/session.js
|
31835
|
-
var
|
32769
|
+
var _a220, _b153, ExecuteResultSync, _a221, SQLitePreparedQuery, _a222, SQLiteSession, _a223, _b154, SQLiteTransaction;
|
31836
32770
|
var init_session2 = __esm({
|
31837
32771
|
"../drizzle-orm/dist/sqlite-core/session.js"() {
|
31838
32772
|
"use strict";
|
@@ -31840,7 +32774,7 @@ var init_session2 = __esm({
|
|
31840
32774
|
init_errors();
|
31841
32775
|
init_query_promise();
|
31842
32776
|
init_db2();
|
31843
|
-
ExecuteResultSync = class extends (_b153 = QueryPromise,
|
32777
|
+
ExecuteResultSync = class extends (_b153 = QueryPromise, _a220 = entityKind, _b153) {
|
31844
32778
|
constructor(resultCb) {
|
31845
32779
|
super();
|
31846
32780
|
this.resultCb = resultCb;
|
@@ -31852,8 +32786,8 @@ var init_session2 = __esm({
|
|
31852
32786
|
return this.resultCb();
|
31853
32787
|
}
|
31854
32788
|
};
|
31855
|
-
__publicField(ExecuteResultSync,
|
31856
|
-
|
32789
|
+
__publicField(ExecuteResultSync, _a220, "ExecuteResultSync");
|
32790
|
+
_a221 = entityKind;
|
31857
32791
|
SQLitePreparedQuery = class {
|
31858
32792
|
constructor(mode, executeMethod, query) {
|
31859
32793
|
/** @internal */
|
@@ -31894,8 +32828,8 @@ var init_session2 = __esm({
|
|
31894
32828
|
}
|
31895
32829
|
}
|
31896
32830
|
};
|
31897
|
-
__publicField(SQLitePreparedQuery,
|
31898
|
-
|
32831
|
+
__publicField(SQLitePreparedQuery, _a221, "PreparedQuery");
|
32832
|
+
_a222 = entityKind;
|
31899
32833
|
SQLiteSession = class {
|
31900
32834
|
constructor(dialect4) {
|
31901
32835
|
this.dialect = dialect4;
|
@@ -31941,8 +32875,8 @@ var init_session2 = __esm({
|
|
31941
32875
|
throw new Error("Not implemented");
|
31942
32876
|
}
|
31943
32877
|
};
|
31944
|
-
__publicField(SQLiteSession,
|
31945
|
-
SQLiteTransaction = class extends (_b154 = BaseSQLiteDatabase,
|
32878
|
+
__publicField(SQLiteSession, _a222, "SQLiteSession");
|
32879
|
+
SQLiteTransaction = class extends (_b154 = BaseSQLiteDatabase, _a223 = entityKind, _b154) {
|
31946
32880
|
constructor(resultType, dialect4, session, schema4, nestedIndex = 0) {
|
31947
32881
|
super(resultType, dialect4, session, schema4);
|
31948
32882
|
this.schema = schema4;
|
@@ -31952,7 +32886,7 @@ var init_session2 = __esm({
|
|
31952
32886
|
throw new TransactionRollbackError();
|
31953
32887
|
}
|
31954
32888
|
};
|
31955
|
-
__publicField(SQLiteTransaction,
|
32889
|
+
__publicField(SQLiteTransaction, _a223, "SQLiteTransaction");
|
31956
32890
|
}
|
31957
32891
|
});
|
31958
32892
|
|
@@ -32021,7 +32955,7 @@ var init_utils6 = __esm({
|
|
32021
32955
|
});
|
32022
32956
|
|
32023
32957
|
// ../drizzle-orm/dist/sqlite-core/view.js
|
32024
|
-
var
|
32958
|
+
var _a224, ViewBuilderCore, _a225, _b155, ViewBuilder2, _a226, _b156, ManualViewBuilder2, _a227, _b157, SQLiteView2;
|
32025
32959
|
var init_view2 = __esm({
|
32026
32960
|
"../drizzle-orm/dist/sqlite-core/view.js"() {
|
32027
32961
|
"use strict";
|
@@ -32031,15 +32965,15 @@ var init_view2 = __esm({
|
|
32031
32965
|
init_query_builder3();
|
32032
32966
|
init_table3();
|
32033
32967
|
init_view_base2();
|
32034
|
-
|
32968
|
+
_a224 = entityKind;
|
32035
32969
|
ViewBuilderCore = class {
|
32036
32970
|
constructor(name2) {
|
32037
32971
|
__publicField(this, "config", {});
|
32038
32972
|
this.name = name2;
|
32039
32973
|
}
|
32040
32974
|
};
|
32041
|
-
__publicField(ViewBuilderCore,
|
32042
|
-
ViewBuilder2 = class extends (_b155 = ViewBuilderCore,
|
32975
|
+
__publicField(ViewBuilderCore, _a224, "SQLiteViewBuilderCore");
|
32976
|
+
ViewBuilder2 = class extends (_b155 = ViewBuilderCore, _a225 = entityKind, _b155) {
|
32043
32977
|
as(qb) {
|
32044
32978
|
if (typeof qb === "function") {
|
32045
32979
|
qb = qb(new QueryBuilder2());
|
@@ -32065,8 +32999,8 @@ var init_view2 = __esm({
|
|
32065
32999
|
);
|
32066
33000
|
}
|
32067
33001
|
};
|
32068
|
-
__publicField(ViewBuilder2,
|
32069
|
-
ManualViewBuilder2 = class extends (_b156 = ViewBuilderCore,
|
33002
|
+
__publicField(ViewBuilder2, _a225, "SQLiteViewBuilder");
|
33003
|
+
ManualViewBuilder2 = class extends (_b156 = ViewBuilderCore, _a226 = entityKind, _b156) {
|
32070
33004
|
constructor(name2, columns) {
|
32071
33005
|
super(name2);
|
32072
33006
|
__publicField(this, "columns");
|
@@ -32109,13 +33043,13 @@ var init_view2 = __esm({
|
|
32109
33043
|
);
|
32110
33044
|
}
|
32111
33045
|
};
|
32112
|
-
__publicField(ManualViewBuilder2,
|
32113
|
-
SQLiteView2 = class extends (_b157 = SQLiteViewBase,
|
33046
|
+
__publicField(ManualViewBuilder2, _a226, "SQLiteManualViewBuilder");
|
33047
|
+
SQLiteView2 = class extends (_b157 = SQLiteViewBase, _a227 = entityKind, _b157) {
|
32114
33048
|
constructor({ config }) {
|
32115
33049
|
super(config);
|
32116
33050
|
}
|
32117
33051
|
};
|
32118
|
-
__publicField(SQLiteView2,
|
33052
|
+
__publicField(SQLiteView2, _a227, "SQLiteView");
|
32119
33053
|
}
|
32120
33054
|
});
|
32121
33055
|
|
@@ -32814,12 +33748,12 @@ var init_alias4 = __esm({
|
|
32814
33748
|
});
|
32815
33749
|
|
32816
33750
|
// ../drizzle-orm/dist/mysql-core/checks.js
|
32817
|
-
var
|
33751
|
+
var _a228, CheckBuilder3, _a229, Check3;
|
32818
33752
|
var init_checks3 = __esm({
|
32819
33753
|
"../drizzle-orm/dist/mysql-core/checks.js"() {
|
32820
33754
|
"use strict";
|
32821
33755
|
init_entity();
|
32822
|
-
|
33756
|
+
_a228 = entityKind;
|
32823
33757
|
CheckBuilder3 = class {
|
32824
33758
|
constructor(name2, value) {
|
32825
33759
|
__publicField(this, "brand");
|
@@ -32831,8 +33765,8 @@ var init_checks3 = __esm({
|
|
32831
33765
|
return new Check3(table4, this);
|
32832
33766
|
}
|
32833
33767
|
};
|
32834
|
-
__publicField(CheckBuilder3,
|
32835
|
-
|
33768
|
+
__publicField(CheckBuilder3, _a228, "MySqlCheckBuilder");
|
33769
|
+
_a229 = entityKind;
|
32836
33770
|
Check3 = class {
|
32837
33771
|
constructor(table4, builder) {
|
32838
33772
|
__publicField(this, "name");
|
@@ -32842,18 +33776,18 @@ var init_checks3 = __esm({
|
|
32842
33776
|
this.value = builder.value;
|
32843
33777
|
}
|
32844
33778
|
};
|
32845
|
-
__publicField(Check3,
|
33779
|
+
__publicField(Check3, _a229, "MySqlCheck");
|
32846
33780
|
}
|
32847
33781
|
});
|
32848
33782
|
|
32849
33783
|
// ../drizzle-orm/dist/mysql-core/foreign-keys.js
|
32850
|
-
var
|
33784
|
+
var _a230, ForeignKeyBuilder3, _a231, ForeignKey3;
|
32851
33785
|
var init_foreign_keys3 = __esm({
|
32852
33786
|
"../drizzle-orm/dist/mysql-core/foreign-keys.js"() {
|
32853
33787
|
"use strict";
|
32854
33788
|
init_entity();
|
32855
33789
|
init_table_utils();
|
32856
|
-
|
33790
|
+
_a230 = entityKind;
|
32857
33791
|
ForeignKeyBuilder3 = class {
|
32858
33792
|
constructor(config, actions) {
|
32859
33793
|
/** @internal */
|
@@ -32884,8 +33818,8 @@ var init_foreign_keys3 = __esm({
|
|
32884
33818
|
return new ForeignKey3(table4, this);
|
32885
33819
|
}
|
32886
33820
|
};
|
32887
|
-
__publicField(ForeignKeyBuilder3,
|
32888
|
-
|
33821
|
+
__publicField(ForeignKeyBuilder3, _a230, "MySqlForeignKeyBuilder");
|
33822
|
+
_a231 = entityKind;
|
32889
33823
|
ForeignKey3 = class {
|
32890
33824
|
constructor(table4, builder) {
|
32891
33825
|
__publicField(this, "reference");
|
@@ -32909,7 +33843,7 @@ var init_foreign_keys3 = __esm({
|
|
32909
33843
|
return name2 ?? `${chunks.join("_")}_fk`;
|
32910
33844
|
}
|
32911
33845
|
};
|
32912
|
-
__publicField(ForeignKey3,
|
33846
|
+
__publicField(ForeignKey3, _a231, "MySqlForeignKey");
|
32913
33847
|
}
|
32914
33848
|
});
|
32915
33849
|
|
@@ -32917,13 +33851,13 @@ var init_foreign_keys3 = __esm({
|
|
32917
33851
|
function uniqueKeyName3(table4, columns) {
|
32918
33852
|
return `${table4[TableName]}_${columns.join("_")}_unique`;
|
32919
33853
|
}
|
32920
|
-
var
|
33854
|
+
var _a232, UniqueConstraintBuilder3, _a233, UniqueOnConstraintBuilder3, _a234, UniqueConstraint3;
|
32921
33855
|
var init_unique_constraint3 = __esm({
|
32922
33856
|
"../drizzle-orm/dist/mysql-core/unique-constraint.js"() {
|
32923
33857
|
"use strict";
|
32924
33858
|
init_entity();
|
32925
33859
|
init_table_utils();
|
32926
|
-
|
33860
|
+
_a232 = entityKind;
|
32927
33861
|
UniqueConstraintBuilder3 = class {
|
32928
33862
|
constructor(columns, name2) {
|
32929
33863
|
/** @internal */
|
@@ -32936,8 +33870,8 @@ var init_unique_constraint3 = __esm({
|
|
32936
33870
|
return new UniqueConstraint3(table4, this.columns, this.name);
|
32937
33871
|
}
|
32938
33872
|
};
|
32939
|
-
__publicField(UniqueConstraintBuilder3,
|
32940
|
-
|
33873
|
+
__publicField(UniqueConstraintBuilder3, _a232, "MySqlUniqueConstraintBuilder");
|
33874
|
+
_a233 = entityKind;
|
32941
33875
|
UniqueOnConstraintBuilder3 = class {
|
32942
33876
|
constructor(name2) {
|
32943
33877
|
/** @internal */
|
@@ -32948,8 +33882,8 @@ var init_unique_constraint3 = __esm({
|
|
32948
33882
|
return new UniqueConstraintBuilder3(columns, this.name);
|
32949
33883
|
}
|
32950
33884
|
};
|
32951
|
-
__publicField(UniqueOnConstraintBuilder3,
|
32952
|
-
|
33885
|
+
__publicField(UniqueOnConstraintBuilder3, _a233, "MySqlUniqueOnConstraintBuilder");
|
33886
|
+
_a234 = entityKind;
|
32953
33887
|
UniqueConstraint3 = class {
|
32954
33888
|
constructor(table4, columns, name2) {
|
32955
33889
|
__publicField(this, "columns");
|
@@ -32963,12 +33897,12 @@ var init_unique_constraint3 = __esm({
|
|
32963
33897
|
return this.name;
|
32964
33898
|
}
|
32965
33899
|
};
|
32966
|
-
__publicField(UniqueConstraint3,
|
33900
|
+
__publicField(UniqueConstraint3, _a234, "MySqlUniqueConstraint");
|
32967
33901
|
}
|
32968
33902
|
});
|
32969
33903
|
|
32970
33904
|
// ../drizzle-orm/dist/mysql-core/columns/common.js
|
32971
|
-
var
|
33905
|
+
var _a235, _b158, MySqlColumnBuilder, _a236, _b159, MySqlColumn, _a237, _b160, MySqlColumnBuilderWithAutoIncrement, _a238, _b161, MySqlColumnWithAutoIncrement;
|
32972
33906
|
var init_common4 = __esm({
|
32973
33907
|
"../drizzle-orm/dist/mysql-core/columns/common.js"() {
|
32974
33908
|
"use strict";
|
@@ -32977,7 +33911,7 @@ var init_common4 = __esm({
|
|
32977
33911
|
init_entity();
|
32978
33912
|
init_foreign_keys3();
|
32979
33913
|
init_unique_constraint3();
|
32980
|
-
MySqlColumnBuilder = class extends (_b158 = ColumnBuilder,
|
33914
|
+
MySqlColumnBuilder = class extends (_b158 = ColumnBuilder, _a235 = entityKind, _b158) {
|
32981
33915
|
constructor() {
|
32982
33916
|
super(...arguments);
|
32983
33917
|
__publicField(this, "foreignKeyConfigs", []);
|
@@ -33018,8 +33952,8 @@ var init_common4 = __esm({
|
|
33018
33952
|
});
|
33019
33953
|
}
|
33020
33954
|
};
|
33021
|
-
__publicField(MySqlColumnBuilder,
|
33022
|
-
MySqlColumn = class extends (_b159 = Column2,
|
33955
|
+
__publicField(MySqlColumnBuilder, _a235, "MySqlColumnBuilder");
|
33956
|
+
MySqlColumn = class extends (_b159 = Column2, _a236 = entityKind, _b159) {
|
33023
33957
|
constructor(table4, config) {
|
33024
33958
|
if (!config.uniqueName) {
|
33025
33959
|
config.uniqueName = uniqueKeyName3(table4, [config.name]);
|
@@ -33028,8 +33962,8 @@ var init_common4 = __esm({
|
|
33028
33962
|
this.table = table4;
|
33029
33963
|
}
|
33030
33964
|
};
|
33031
|
-
__publicField(MySqlColumn,
|
33032
|
-
MySqlColumnBuilderWithAutoIncrement = class extends (_b160 = MySqlColumnBuilder,
|
33965
|
+
__publicField(MySqlColumn, _a236, "MySqlColumn");
|
33966
|
+
MySqlColumnBuilderWithAutoIncrement = class extends (_b160 = MySqlColumnBuilder, _a237 = entityKind, _b160) {
|
33033
33967
|
constructor(name2, dataType, columnType) {
|
33034
33968
|
super(name2, dataType, columnType);
|
33035
33969
|
this.config.autoIncrement = false;
|
@@ -33040,14 +33974,14 @@ var init_common4 = __esm({
|
|
33040
33974
|
return this;
|
33041
33975
|
}
|
33042
33976
|
};
|
33043
|
-
__publicField(MySqlColumnBuilderWithAutoIncrement,
|
33044
|
-
MySqlColumnWithAutoIncrement = class extends (_b161 = MySqlColumn,
|
33977
|
+
__publicField(MySqlColumnBuilderWithAutoIncrement, _a237, "MySqlColumnBuilderWithAutoIncrement");
|
33978
|
+
MySqlColumnWithAutoIncrement = class extends (_b161 = MySqlColumn, _a238 = entityKind, _b161) {
|
33045
33979
|
constructor() {
|
33046
33980
|
super(...arguments);
|
33047
33981
|
__publicField(this, "autoIncrement", this.config.autoIncrement);
|
33048
33982
|
}
|
33049
33983
|
};
|
33050
|
-
__publicField(MySqlColumnWithAutoIncrement,
|
33984
|
+
__publicField(MySqlColumnWithAutoIncrement, _a238, "MySqlColumnWithAutoIncrement");
|
33051
33985
|
}
|
33052
33986
|
});
|
33053
33987
|
|
@@ -33059,14 +33993,14 @@ function bigint2(a, b) {
|
|
33059
33993
|
}
|
33060
33994
|
return new MySqlBigInt64Builder(name2, config.unsigned);
|
33061
33995
|
}
|
33062
|
-
var
|
33996
|
+
var _a239, _b162, MySqlBigInt53Builder, _a240, _b163, MySqlBigInt53, _a241, _b164, MySqlBigInt64Builder, _a242, _b165, MySqlBigInt64;
|
33063
33997
|
var init_bigint2 = __esm({
|
33064
33998
|
"../drizzle-orm/dist/mysql-core/columns/bigint.js"() {
|
33065
33999
|
"use strict";
|
33066
34000
|
init_entity();
|
33067
34001
|
init_utils2();
|
33068
34002
|
init_common4();
|
33069
|
-
MySqlBigInt53Builder = class extends (_b162 = MySqlColumnBuilderWithAutoIncrement,
|
34003
|
+
MySqlBigInt53Builder = class extends (_b162 = MySqlColumnBuilderWithAutoIncrement, _a239 = entityKind, _b162) {
|
33070
34004
|
constructor(name2, unsigned = false) {
|
33071
34005
|
super(name2, "number", "MySqlBigInt53");
|
33072
34006
|
this.config.unsigned = unsigned;
|
@@ -33079,8 +34013,8 @@ var init_bigint2 = __esm({
|
|
33079
34013
|
);
|
33080
34014
|
}
|
33081
34015
|
};
|
33082
|
-
__publicField(MySqlBigInt53Builder,
|
33083
|
-
MySqlBigInt53 = class extends (_b163 = MySqlColumnWithAutoIncrement,
|
34016
|
+
__publicField(MySqlBigInt53Builder, _a239, "MySqlBigInt53Builder");
|
34017
|
+
MySqlBigInt53 = class extends (_b163 = MySqlColumnWithAutoIncrement, _a240 = entityKind, _b163) {
|
33084
34018
|
getSQLType() {
|
33085
34019
|
return `bigint${this.config.unsigned ? " unsigned" : ""}`;
|
33086
34020
|
}
|
@@ -33091,8 +34025,8 @@ var init_bigint2 = __esm({
|
|
33091
34025
|
return Number(value);
|
33092
34026
|
}
|
33093
34027
|
};
|
33094
|
-
__publicField(MySqlBigInt53,
|
33095
|
-
MySqlBigInt64Builder = class extends (_b164 = MySqlColumnBuilderWithAutoIncrement,
|
34028
|
+
__publicField(MySqlBigInt53, _a240, "MySqlBigInt53");
|
34029
|
+
MySqlBigInt64Builder = class extends (_b164 = MySqlColumnBuilderWithAutoIncrement, _a241 = entityKind, _b164) {
|
33096
34030
|
constructor(name2, unsigned = false) {
|
33097
34031
|
super(name2, "bigint", "MySqlBigInt64");
|
33098
34032
|
this.config.unsigned = unsigned;
|
@@ -33105,8 +34039,8 @@ var init_bigint2 = __esm({
|
|
33105
34039
|
);
|
33106
34040
|
}
|
33107
34041
|
};
|
33108
|
-
__publicField(MySqlBigInt64Builder,
|
33109
|
-
MySqlBigInt64 = class extends (_b165 = MySqlColumnWithAutoIncrement,
|
34042
|
+
__publicField(MySqlBigInt64Builder, _a241, "MySqlBigInt64Builder");
|
34043
|
+
MySqlBigInt64 = class extends (_b165 = MySqlColumnWithAutoIncrement, _a242 = entityKind, _b165) {
|
33110
34044
|
getSQLType() {
|
33111
34045
|
return `bigint${this.config.unsigned ? " unsigned" : ""}`;
|
33112
34046
|
}
|
@@ -33115,7 +34049,7 @@ var init_bigint2 = __esm({
|
|
33115
34049
|
return BigInt(value);
|
33116
34050
|
}
|
33117
34051
|
};
|
33118
|
-
__publicField(MySqlBigInt64,
|
34052
|
+
__publicField(MySqlBigInt64, _a242, "MySqlBigInt64");
|
33119
34053
|
}
|
33120
34054
|
});
|
33121
34055
|
|
@@ -33124,14 +34058,14 @@ function binary(a, b = {}) {
|
|
33124
34058
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
33125
34059
|
return new MySqlBinaryBuilder(name2, config.length);
|
33126
34060
|
}
|
33127
|
-
var
|
34061
|
+
var _a243, _b166, MySqlBinaryBuilder, _a244, _b167, MySqlBinary;
|
33128
34062
|
var init_binary = __esm({
|
33129
34063
|
"../drizzle-orm/dist/mysql-core/columns/binary.js"() {
|
33130
34064
|
"use strict";
|
33131
34065
|
init_entity();
|
33132
34066
|
init_utils2();
|
33133
34067
|
init_common4();
|
33134
|
-
MySqlBinaryBuilder = class extends (_b166 = MySqlColumnBuilder,
|
34068
|
+
MySqlBinaryBuilder = class extends (_b166 = MySqlColumnBuilder, _a243 = entityKind, _b166) {
|
33135
34069
|
constructor(name2, length) {
|
33136
34070
|
super(name2, "string", "MySqlBinary");
|
33137
34071
|
this.config.length = length;
|
@@ -33141,8 +34075,8 @@ var init_binary = __esm({
|
|
33141
34075
|
return new MySqlBinary(table4, this.config);
|
33142
34076
|
}
|
33143
34077
|
};
|
33144
|
-
__publicField(MySqlBinaryBuilder,
|
33145
|
-
MySqlBinary = class extends (_b167 = MySqlColumn,
|
34078
|
+
__publicField(MySqlBinaryBuilder, _a243, "MySqlBinaryBuilder");
|
34079
|
+
MySqlBinary = class extends (_b167 = MySqlColumn, _a244 = entityKind, _b167) {
|
33146
34080
|
constructor() {
|
33147
34081
|
super(...arguments);
|
33148
34082
|
__publicField(this, "length", this.config.length);
|
@@ -33151,7 +34085,7 @@ var init_binary = __esm({
|
|
33151
34085
|
return this.length === void 0 ? `binary` : `binary(${this.length})`;
|
33152
34086
|
}
|
33153
34087
|
};
|
33154
|
-
__publicField(MySqlBinary,
|
34088
|
+
__publicField(MySqlBinary, _a244, "MySqlBinary");
|
33155
34089
|
}
|
33156
34090
|
});
|
33157
34091
|
|
@@ -33159,13 +34093,13 @@ var init_binary = __esm({
|
|
33159
34093
|
function boolean2(name2) {
|
33160
34094
|
return new MySqlBooleanBuilder(name2 ?? "");
|
33161
34095
|
}
|
33162
|
-
var
|
34096
|
+
var _a245, _b168, MySqlBooleanBuilder, _a246, _b169, MySqlBoolean;
|
33163
34097
|
var init_boolean2 = __esm({
|
33164
34098
|
"../drizzle-orm/dist/mysql-core/columns/boolean.js"() {
|
33165
34099
|
"use strict";
|
33166
34100
|
init_entity();
|
33167
34101
|
init_common4();
|
33168
|
-
MySqlBooleanBuilder = class extends (_b168 = MySqlColumnBuilder,
|
34102
|
+
MySqlBooleanBuilder = class extends (_b168 = MySqlColumnBuilder, _a245 = entityKind, _b168) {
|
33169
34103
|
constructor(name2) {
|
33170
34104
|
super(name2, "boolean", "MySqlBoolean");
|
33171
34105
|
}
|
@@ -33177,8 +34111,8 @@ var init_boolean2 = __esm({
|
|
33177
34111
|
);
|
33178
34112
|
}
|
33179
34113
|
};
|
33180
|
-
__publicField(MySqlBooleanBuilder,
|
33181
|
-
MySqlBoolean = class extends (_b169 = MySqlColumn,
|
34114
|
+
__publicField(MySqlBooleanBuilder, _a245, "MySqlBooleanBuilder");
|
34115
|
+
MySqlBoolean = class extends (_b169 = MySqlColumn, _a246 = entityKind, _b169) {
|
33182
34116
|
getSQLType() {
|
33183
34117
|
return "boolean";
|
33184
34118
|
}
|
@@ -33189,7 +34123,7 @@ var init_boolean2 = __esm({
|
|
33189
34123
|
return value === 1;
|
33190
34124
|
}
|
33191
34125
|
};
|
33192
|
-
__publicField(MySqlBoolean,
|
34126
|
+
__publicField(MySqlBoolean, _a246, "MySqlBoolean");
|
33193
34127
|
}
|
33194
34128
|
});
|
33195
34129
|
|
@@ -33198,14 +34132,14 @@ function char2(a, b = {}) {
|
|
33198
34132
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
33199
34133
|
return new MySqlCharBuilder(name2, config);
|
33200
34134
|
}
|
33201
|
-
var
|
34135
|
+
var _a247, _b170, MySqlCharBuilder, _a248, _b171, MySqlChar;
|
33202
34136
|
var init_char2 = __esm({
|
33203
34137
|
"../drizzle-orm/dist/mysql-core/columns/char.js"() {
|
33204
34138
|
"use strict";
|
33205
34139
|
init_entity();
|
33206
34140
|
init_utils2();
|
33207
34141
|
init_common4();
|
33208
|
-
MySqlCharBuilder = class extends (_b170 = MySqlColumnBuilder,
|
34142
|
+
MySqlCharBuilder = class extends (_b170 = MySqlColumnBuilder, _a247 = entityKind, _b170) {
|
33209
34143
|
constructor(name2, config) {
|
33210
34144
|
super(name2, "string", "MySqlChar");
|
33211
34145
|
this.config.length = config.length;
|
@@ -33219,8 +34153,8 @@ var init_char2 = __esm({
|
|
33219
34153
|
);
|
33220
34154
|
}
|
33221
34155
|
};
|
33222
|
-
__publicField(MySqlCharBuilder,
|
33223
|
-
MySqlChar = class extends (_b171 = MySqlColumn,
|
34156
|
+
__publicField(MySqlCharBuilder, _a247, "MySqlCharBuilder");
|
34157
|
+
MySqlChar = class extends (_b171 = MySqlColumn, _a248 = entityKind, _b171) {
|
33224
34158
|
constructor() {
|
33225
34159
|
super(...arguments);
|
33226
34160
|
__publicField(this, "length", this.config.length);
|
@@ -33230,7 +34164,7 @@ var init_char2 = __esm({
|
|
33230
34164
|
return this.length === void 0 ? `char` : `char(${this.length})`;
|
33231
34165
|
}
|
33232
34166
|
};
|
33233
|
-
__publicField(MySqlChar,
|
34167
|
+
__publicField(MySqlChar, _a248, "MySqlChar");
|
33234
34168
|
}
|
33235
34169
|
});
|
33236
34170
|
|
@@ -33241,14 +34175,14 @@ function customType3(customTypeParams) {
|
|
33241
34175
|
return new MySqlCustomColumnBuilder(name2, config, customTypeParams);
|
33242
34176
|
};
|
33243
34177
|
}
|
33244
|
-
var
|
34178
|
+
var _a249, _b172, MySqlCustomColumnBuilder, _a250, _b173, MySqlCustomColumn;
|
33245
34179
|
var init_custom3 = __esm({
|
33246
34180
|
"../drizzle-orm/dist/mysql-core/columns/custom.js"() {
|
33247
34181
|
"use strict";
|
33248
34182
|
init_entity();
|
33249
34183
|
init_utils2();
|
33250
34184
|
init_common4();
|
33251
|
-
MySqlCustomColumnBuilder = class extends (_b172 = MySqlColumnBuilder,
|
34185
|
+
MySqlCustomColumnBuilder = class extends (_b172 = MySqlColumnBuilder, _a249 = entityKind, _b172) {
|
33252
34186
|
constructor(name2, fieldConfig, customTypeParams) {
|
33253
34187
|
super(name2, "custom", "MySqlCustomColumn");
|
33254
34188
|
this.config.fieldConfig = fieldConfig;
|
@@ -33262,8 +34196,8 @@ var init_custom3 = __esm({
|
|
33262
34196
|
);
|
33263
34197
|
}
|
33264
34198
|
};
|
33265
|
-
__publicField(MySqlCustomColumnBuilder,
|
33266
|
-
MySqlCustomColumn = class extends (_b173 = MySqlColumn,
|
34199
|
+
__publicField(MySqlCustomColumnBuilder, _a249, "MySqlCustomColumnBuilder");
|
34200
|
+
MySqlCustomColumn = class extends (_b173 = MySqlColumn, _a250 = entityKind, _b173) {
|
33267
34201
|
constructor(table4, config) {
|
33268
34202
|
super(table4, config);
|
33269
34203
|
__publicField(this, "sqlName");
|
@@ -33283,7 +34217,7 @@ var init_custom3 = __esm({
|
|
33283
34217
|
return typeof this.mapTo === "function" ? this.mapTo(value) : value;
|
33284
34218
|
}
|
33285
34219
|
};
|
33286
|
-
__publicField(MySqlCustomColumn,
|
34220
|
+
__publicField(MySqlCustomColumn, _a250, "MySqlCustomColumn");
|
33287
34221
|
}
|
33288
34222
|
});
|
33289
34223
|
|
@@ -33295,14 +34229,14 @@ function date2(a, b) {
|
|
33295
34229
|
}
|
33296
34230
|
return new MySqlDateBuilder(name2);
|
33297
34231
|
}
|
33298
|
-
var
|
34232
|
+
var _a251, _b174, MySqlDateBuilder, _a252, _b175, MySqlDate, _a253, _b176, MySqlDateStringBuilder, _a254, _b177, MySqlDateString;
|
33299
34233
|
var init_date2 = __esm({
|
33300
34234
|
"../drizzle-orm/dist/mysql-core/columns/date.js"() {
|
33301
34235
|
"use strict";
|
33302
34236
|
init_entity();
|
33303
34237
|
init_utils2();
|
33304
34238
|
init_common4();
|
33305
|
-
MySqlDateBuilder = class extends (_b174 = MySqlColumnBuilder,
|
34239
|
+
MySqlDateBuilder = class extends (_b174 = MySqlColumnBuilder, _a251 = entityKind, _b174) {
|
33306
34240
|
constructor(name2) {
|
33307
34241
|
super(name2, "date", "MySqlDate");
|
33308
34242
|
}
|
@@ -33311,8 +34245,8 @@ var init_date2 = __esm({
|
|
33311
34245
|
return new MySqlDate(table4, this.config);
|
33312
34246
|
}
|
33313
34247
|
};
|
33314
|
-
__publicField(MySqlDateBuilder,
|
33315
|
-
MySqlDate = class extends (_b175 = MySqlColumn,
|
34248
|
+
__publicField(MySqlDateBuilder, _a251, "MySqlDateBuilder");
|
34249
|
+
MySqlDate = class extends (_b175 = MySqlColumn, _a252 = entityKind, _b175) {
|
33316
34250
|
constructor(table4, config) {
|
33317
34251
|
super(table4, config);
|
33318
34252
|
}
|
@@ -33323,8 +34257,8 @@ var init_date2 = __esm({
|
|
33323
34257
|
return new Date(value);
|
33324
34258
|
}
|
33325
34259
|
};
|
33326
|
-
__publicField(MySqlDate,
|
33327
|
-
MySqlDateStringBuilder = class extends (_b176 = MySqlColumnBuilder,
|
34260
|
+
__publicField(MySqlDate, _a252, "MySqlDate");
|
34261
|
+
MySqlDateStringBuilder = class extends (_b176 = MySqlColumnBuilder, _a253 = entityKind, _b176) {
|
33328
34262
|
constructor(name2) {
|
33329
34263
|
super(name2, "string", "MySqlDateString");
|
33330
34264
|
}
|
@@ -33336,8 +34270,8 @@ var init_date2 = __esm({
|
|
33336
34270
|
);
|
33337
34271
|
}
|
33338
34272
|
};
|
33339
|
-
__publicField(MySqlDateStringBuilder,
|
33340
|
-
MySqlDateString = class extends (_b177 = MySqlColumn,
|
34273
|
+
__publicField(MySqlDateStringBuilder, _a253, "MySqlDateStringBuilder");
|
34274
|
+
MySqlDateString = class extends (_b177 = MySqlColumn, _a254 = entityKind, _b177) {
|
33341
34275
|
constructor(table4, config) {
|
33342
34276
|
super(table4, config);
|
33343
34277
|
}
|
@@ -33345,7 +34279,7 @@ var init_date2 = __esm({
|
|
33345
34279
|
return `date`;
|
33346
34280
|
}
|
33347
34281
|
};
|
33348
|
-
__publicField(MySqlDateString,
|
34282
|
+
__publicField(MySqlDateString, _a254, "MySqlDateString");
|
33349
34283
|
}
|
33350
34284
|
});
|
33351
34285
|
|
@@ -33357,14 +34291,14 @@ function datetime(a, b) {
|
|
33357
34291
|
}
|
33358
34292
|
return new MySqlDateTimeBuilder(name2, config);
|
33359
34293
|
}
|
33360
|
-
var
|
34294
|
+
var _a255, _b178, MySqlDateTimeBuilder, _a256, _b179, MySqlDateTime, _a257, _b180, MySqlDateTimeStringBuilder, _a258, _b181, MySqlDateTimeString;
|
33361
34295
|
var init_datetime = __esm({
|
33362
34296
|
"../drizzle-orm/dist/mysql-core/columns/datetime.js"() {
|
33363
34297
|
"use strict";
|
33364
34298
|
init_entity();
|
33365
34299
|
init_utils2();
|
33366
34300
|
init_common4();
|
33367
|
-
MySqlDateTimeBuilder = class extends (_b178 = MySqlColumnBuilder,
|
34301
|
+
MySqlDateTimeBuilder = class extends (_b178 = MySqlColumnBuilder, _a255 = entityKind, _b178) {
|
33368
34302
|
constructor(name2, config) {
|
33369
34303
|
super(name2, "date", "MySqlDateTime");
|
33370
34304
|
this.config.fsp = config?.fsp;
|
@@ -33377,8 +34311,8 @@ var init_datetime = __esm({
|
|
33377
34311
|
);
|
33378
34312
|
}
|
33379
34313
|
};
|
33380
|
-
__publicField(MySqlDateTimeBuilder,
|
33381
|
-
MySqlDateTime = class extends (_b179 = MySqlColumn,
|
34314
|
+
__publicField(MySqlDateTimeBuilder, _a255, "MySqlDateTimeBuilder");
|
34315
|
+
MySqlDateTime = class extends (_b179 = MySqlColumn, _a256 = entityKind, _b179) {
|
33382
34316
|
constructor(table4, config) {
|
33383
34317
|
super(table4, config);
|
33384
34318
|
__publicField(this, "fsp");
|
@@ -33395,8 +34329,8 @@ var init_datetime = __esm({
|
|
33395
34329
|
return /* @__PURE__ */ new Date(value.replace(" ", "T") + "Z");
|
33396
34330
|
}
|
33397
34331
|
};
|
33398
|
-
__publicField(MySqlDateTime,
|
33399
|
-
MySqlDateTimeStringBuilder = class extends (_b180 = MySqlColumnBuilder,
|
34332
|
+
__publicField(MySqlDateTime, _a256, "MySqlDateTime");
|
34333
|
+
MySqlDateTimeStringBuilder = class extends (_b180 = MySqlColumnBuilder, _a257 = entityKind, _b180) {
|
33400
34334
|
constructor(name2, config) {
|
33401
34335
|
super(name2, "string", "MySqlDateTimeString");
|
33402
34336
|
this.config.fsp = config?.fsp;
|
@@ -33409,8 +34343,8 @@ var init_datetime = __esm({
|
|
33409
34343
|
);
|
33410
34344
|
}
|
33411
34345
|
};
|
33412
|
-
__publicField(MySqlDateTimeStringBuilder,
|
33413
|
-
MySqlDateTimeString = class extends (_b181 = MySqlColumn,
|
34346
|
+
__publicField(MySqlDateTimeStringBuilder, _a257, "MySqlDateTimeStringBuilder");
|
34347
|
+
MySqlDateTimeString = class extends (_b181 = MySqlColumn, _a258 = entityKind, _b181) {
|
33414
34348
|
constructor(table4, config) {
|
33415
34349
|
super(table4, config);
|
33416
34350
|
__publicField(this, "fsp");
|
@@ -33421,7 +34355,7 @@ var init_datetime = __esm({
|
|
33421
34355
|
return `datetime${precision}`;
|
33422
34356
|
}
|
33423
34357
|
};
|
33424
|
-
__publicField(MySqlDateTimeString,
|
34358
|
+
__publicField(MySqlDateTimeString, _a258, "MySqlDateTimeString");
|
33425
34359
|
}
|
33426
34360
|
});
|
33427
34361
|
|
@@ -33430,14 +34364,14 @@ function decimal(a, b = {}) {
|
|
33430
34364
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
33431
34365
|
return new MySqlDecimalBuilder(name2, config.precision, config.scale);
|
33432
34366
|
}
|
33433
|
-
var
|
34367
|
+
var _a259, _b182, MySqlDecimalBuilder, _a260, _b183, MySqlDecimal;
|
33434
34368
|
var init_decimal = __esm({
|
33435
34369
|
"../drizzle-orm/dist/mysql-core/columns/decimal.js"() {
|
33436
34370
|
"use strict";
|
33437
34371
|
init_entity();
|
33438
34372
|
init_utils2();
|
33439
34373
|
init_common4();
|
33440
|
-
MySqlDecimalBuilder = class extends (_b182 = MySqlColumnBuilderWithAutoIncrement,
|
34374
|
+
MySqlDecimalBuilder = class extends (_b182 = MySqlColumnBuilderWithAutoIncrement, _a259 = entityKind, _b182) {
|
33441
34375
|
constructor(name2, precision, scale) {
|
33442
34376
|
super(name2, "string", "MySqlDecimal");
|
33443
34377
|
this.config.precision = precision;
|
@@ -33451,8 +34385,8 @@ var init_decimal = __esm({
|
|
33451
34385
|
);
|
33452
34386
|
}
|
33453
34387
|
};
|
33454
|
-
__publicField(MySqlDecimalBuilder,
|
33455
|
-
MySqlDecimal = class extends (_b183 = MySqlColumnWithAutoIncrement,
|
34388
|
+
__publicField(MySqlDecimalBuilder, _a259, "MySqlDecimalBuilder");
|
34389
|
+
MySqlDecimal = class extends (_b183 = MySqlColumnWithAutoIncrement, _a260 = entityKind, _b183) {
|
33456
34390
|
constructor() {
|
33457
34391
|
super(...arguments);
|
33458
34392
|
__publicField(this, "precision", this.config.precision);
|
@@ -33468,7 +34402,7 @@ var init_decimal = __esm({
|
|
33468
34402
|
}
|
33469
34403
|
}
|
33470
34404
|
};
|
33471
|
-
__publicField(MySqlDecimal,
|
34405
|
+
__publicField(MySqlDecimal, _a260, "MySqlDecimal");
|
33472
34406
|
}
|
33473
34407
|
});
|
33474
34408
|
|
@@ -33477,14 +34411,14 @@ function double(a, b) {
|
|
33477
34411
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
33478
34412
|
return new MySqlDoubleBuilder(name2, config);
|
33479
34413
|
}
|
33480
|
-
var
|
34414
|
+
var _a261, _b184, MySqlDoubleBuilder, _a262, _b185, MySqlDouble;
|
33481
34415
|
var init_double = __esm({
|
33482
34416
|
"../drizzle-orm/dist/mysql-core/columns/double.js"() {
|
33483
34417
|
"use strict";
|
33484
34418
|
init_entity();
|
33485
34419
|
init_utils2();
|
33486
34420
|
init_common4();
|
33487
|
-
MySqlDoubleBuilder = class extends (_b184 = MySqlColumnBuilderWithAutoIncrement,
|
34421
|
+
MySqlDoubleBuilder = class extends (_b184 = MySqlColumnBuilderWithAutoIncrement, _a261 = entityKind, _b184) {
|
33488
34422
|
constructor(name2, config) {
|
33489
34423
|
super(name2, "number", "MySqlDouble");
|
33490
34424
|
this.config.precision = config?.precision;
|
@@ -33495,8 +34429,8 @@ var init_double = __esm({
|
|
33495
34429
|
return new MySqlDouble(table4, this.config);
|
33496
34430
|
}
|
33497
34431
|
};
|
33498
|
-
__publicField(MySqlDoubleBuilder,
|
33499
|
-
MySqlDouble = class extends (_b185 = MySqlColumnWithAutoIncrement,
|
34432
|
+
__publicField(MySqlDoubleBuilder, _a261, "MySqlDoubleBuilder");
|
34433
|
+
MySqlDouble = class extends (_b185 = MySqlColumnWithAutoIncrement, _a262 = entityKind, _b185) {
|
33500
34434
|
constructor() {
|
33501
34435
|
super(...arguments);
|
33502
34436
|
__publicField(this, "precision", this.config.precision);
|
@@ -33512,7 +34446,7 @@ var init_double = __esm({
|
|
33512
34446
|
}
|
33513
34447
|
}
|
33514
34448
|
};
|
33515
|
-
__publicField(MySqlDouble,
|
34449
|
+
__publicField(MySqlDouble, _a262, "MySqlDouble");
|
33516
34450
|
}
|
33517
34451
|
});
|
33518
34452
|
|
@@ -33524,14 +34458,14 @@ function mysqlEnum(a, b) {
|
|
33524
34458
|
}
|
33525
34459
|
return new MySqlEnumColumnBuilder(name2, values);
|
33526
34460
|
}
|
33527
|
-
var
|
34461
|
+
var _a263, _b186, MySqlEnumColumnBuilder, _a264, _b187, MySqlEnumColumn;
|
33528
34462
|
var init_enum2 = __esm({
|
33529
34463
|
"../drizzle-orm/dist/mysql-core/columns/enum.js"() {
|
33530
34464
|
"use strict";
|
33531
34465
|
init_entity();
|
33532
34466
|
init_utils2();
|
33533
34467
|
init_common4();
|
33534
|
-
MySqlEnumColumnBuilder = class extends (_b186 = MySqlColumnBuilder,
|
34468
|
+
MySqlEnumColumnBuilder = class extends (_b186 = MySqlColumnBuilder, _a263 = entityKind, _b186) {
|
33535
34469
|
constructor(name2, values) {
|
33536
34470
|
super(name2, "string", "MySqlEnumColumn");
|
33537
34471
|
this.config.enumValues = values;
|
@@ -33544,8 +34478,8 @@ var init_enum2 = __esm({
|
|
33544
34478
|
);
|
33545
34479
|
}
|
33546
34480
|
};
|
33547
|
-
__publicField(MySqlEnumColumnBuilder,
|
33548
|
-
MySqlEnumColumn = class extends (_b187 = MySqlColumn,
|
34481
|
+
__publicField(MySqlEnumColumnBuilder, _a263, "MySqlEnumColumnBuilder");
|
34482
|
+
MySqlEnumColumn = class extends (_b187 = MySqlColumn, _a264 = entityKind, _b187) {
|
33549
34483
|
constructor() {
|
33550
34484
|
super(...arguments);
|
33551
34485
|
__publicField(this, "enumValues", this.config.enumValues);
|
@@ -33554,7 +34488,7 @@ var init_enum2 = __esm({
|
|
33554
34488
|
return `enum(${this.enumValues.map((value) => `'${value}'`).join(",")})`;
|
33555
34489
|
}
|
33556
34490
|
};
|
33557
|
-
__publicField(MySqlEnumColumn,
|
34491
|
+
__publicField(MySqlEnumColumn, _a264, "MySqlEnumColumn");
|
33558
34492
|
}
|
33559
34493
|
});
|
33560
34494
|
|
@@ -33562,13 +34496,13 @@ var init_enum2 = __esm({
|
|
33562
34496
|
function float(name2) {
|
33563
34497
|
return new MySqlFloatBuilder(name2 ?? "");
|
33564
34498
|
}
|
33565
|
-
var
|
34499
|
+
var _a265, _b188, MySqlFloatBuilder, _a266, _b189, MySqlFloat;
|
33566
34500
|
var init_float = __esm({
|
33567
34501
|
"../drizzle-orm/dist/mysql-core/columns/float.js"() {
|
33568
34502
|
"use strict";
|
33569
34503
|
init_entity();
|
33570
34504
|
init_common4();
|
33571
|
-
MySqlFloatBuilder = class extends (_b188 = MySqlColumnBuilderWithAutoIncrement,
|
34505
|
+
MySqlFloatBuilder = class extends (_b188 = MySqlColumnBuilderWithAutoIncrement, _a265 = entityKind, _b188) {
|
33572
34506
|
constructor(name2) {
|
33573
34507
|
super(name2, "number", "MySqlFloat");
|
33574
34508
|
}
|
@@ -33577,13 +34511,13 @@ var init_float = __esm({
|
|
33577
34511
|
return new MySqlFloat(table4, this.config);
|
33578
34512
|
}
|
33579
34513
|
};
|
33580
|
-
__publicField(MySqlFloatBuilder,
|
33581
|
-
MySqlFloat = class extends (_b189 = MySqlColumnWithAutoIncrement,
|
34514
|
+
__publicField(MySqlFloatBuilder, _a265, "MySqlFloatBuilder");
|
34515
|
+
MySqlFloat = class extends (_b189 = MySqlColumnWithAutoIncrement, _a266 = entityKind, _b189) {
|
33582
34516
|
getSQLType() {
|
33583
34517
|
return "float";
|
33584
34518
|
}
|
33585
34519
|
};
|
33586
|
-
__publicField(MySqlFloat,
|
34520
|
+
__publicField(MySqlFloat, _a266, "MySqlFloat");
|
33587
34521
|
}
|
33588
34522
|
});
|
33589
34523
|
|
@@ -33592,14 +34526,14 @@ function int(a, b) {
|
|
33592
34526
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
33593
34527
|
return new MySqlIntBuilder(name2, config);
|
33594
34528
|
}
|
33595
|
-
var
|
34529
|
+
var _a267, _b190, MySqlIntBuilder, _a268, _b191, MySqlInt;
|
33596
34530
|
var init_int = __esm({
|
33597
34531
|
"../drizzle-orm/dist/mysql-core/columns/int.js"() {
|
33598
34532
|
"use strict";
|
33599
34533
|
init_entity();
|
33600
34534
|
init_utils2();
|
33601
34535
|
init_common4();
|
33602
|
-
MySqlIntBuilder = class extends (_b190 = MySqlColumnBuilderWithAutoIncrement,
|
34536
|
+
MySqlIntBuilder = class extends (_b190 = MySqlColumnBuilderWithAutoIncrement, _a267 = entityKind, _b190) {
|
33603
34537
|
constructor(name2, config) {
|
33604
34538
|
super(name2, "number", "MySqlInt");
|
33605
34539
|
this.config.unsigned = config ? config.unsigned : false;
|
@@ -33609,8 +34543,8 @@ var init_int = __esm({
|
|
33609
34543
|
return new MySqlInt(table4, this.config);
|
33610
34544
|
}
|
33611
34545
|
};
|
33612
|
-
__publicField(MySqlIntBuilder,
|
33613
|
-
MySqlInt = class extends (_b191 = MySqlColumnWithAutoIncrement,
|
34546
|
+
__publicField(MySqlIntBuilder, _a267, "MySqlIntBuilder");
|
34547
|
+
MySqlInt = class extends (_b191 = MySqlColumnWithAutoIncrement, _a268 = entityKind, _b191) {
|
33614
34548
|
getSQLType() {
|
33615
34549
|
return `int${this.config.unsigned ? " unsigned" : ""}`;
|
33616
34550
|
}
|
@@ -33621,7 +34555,7 @@ var init_int = __esm({
|
|
33621
34555
|
return value;
|
33622
34556
|
}
|
33623
34557
|
};
|
33624
|
-
__publicField(MySqlInt,
|
34558
|
+
__publicField(MySqlInt, _a268, "MySqlInt");
|
33625
34559
|
}
|
33626
34560
|
});
|
33627
34561
|
|
@@ -33629,13 +34563,13 @@ var init_int = __esm({
|
|
33629
34563
|
function json2(name2) {
|
33630
34564
|
return new MySqlJsonBuilder(name2 ?? "");
|
33631
34565
|
}
|
33632
|
-
var
|
34566
|
+
var _a269, _b192, MySqlJsonBuilder, _a270, _b193, MySqlJson;
|
33633
34567
|
var init_json2 = __esm({
|
33634
34568
|
"../drizzle-orm/dist/mysql-core/columns/json.js"() {
|
33635
34569
|
"use strict";
|
33636
34570
|
init_entity();
|
33637
34571
|
init_common4();
|
33638
|
-
MySqlJsonBuilder = class extends (_b192 = MySqlColumnBuilder,
|
34572
|
+
MySqlJsonBuilder = class extends (_b192 = MySqlColumnBuilder, _a269 = entityKind, _b192) {
|
33639
34573
|
constructor(name2) {
|
33640
34574
|
super(name2, "json", "MySqlJson");
|
33641
34575
|
}
|
@@ -33644,8 +34578,8 @@ var init_json2 = __esm({
|
|
33644
34578
|
return new MySqlJson(table4, this.config);
|
33645
34579
|
}
|
33646
34580
|
};
|
33647
|
-
__publicField(MySqlJsonBuilder,
|
33648
|
-
MySqlJson = class extends (_b193 = MySqlColumn,
|
34581
|
+
__publicField(MySqlJsonBuilder, _a269, "MySqlJsonBuilder");
|
34582
|
+
MySqlJson = class extends (_b193 = MySqlColumn, _a270 = entityKind, _b193) {
|
33649
34583
|
getSQLType() {
|
33650
34584
|
return "json";
|
33651
34585
|
}
|
@@ -33653,7 +34587,7 @@ var init_json2 = __esm({
|
|
33653
34587
|
return JSON.stringify(value);
|
33654
34588
|
}
|
33655
34589
|
};
|
33656
|
-
__publicField(MySqlJson,
|
34590
|
+
__publicField(MySqlJson, _a270, "MySqlJson");
|
33657
34591
|
}
|
33658
34592
|
});
|
33659
34593
|
|
@@ -33662,14 +34596,14 @@ function mediumint(a, b) {
|
|
33662
34596
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
33663
34597
|
return new MySqlMediumIntBuilder(name2, config);
|
33664
34598
|
}
|
33665
|
-
var
|
34599
|
+
var _a271, _b194, MySqlMediumIntBuilder, _a272, _b195, MySqlMediumInt;
|
33666
34600
|
var init_mediumint = __esm({
|
33667
34601
|
"../drizzle-orm/dist/mysql-core/columns/mediumint.js"() {
|
33668
34602
|
"use strict";
|
33669
34603
|
init_entity();
|
33670
34604
|
init_utils2();
|
33671
34605
|
init_common4();
|
33672
|
-
MySqlMediumIntBuilder = class extends (_b194 = MySqlColumnBuilderWithAutoIncrement,
|
34606
|
+
MySqlMediumIntBuilder = class extends (_b194 = MySqlColumnBuilderWithAutoIncrement, _a271 = entityKind, _b194) {
|
33673
34607
|
constructor(name2, config) {
|
33674
34608
|
super(name2, "number", "MySqlMediumInt");
|
33675
34609
|
this.config.unsigned = config ? config.unsigned : false;
|
@@ -33682,8 +34616,8 @@ var init_mediumint = __esm({
|
|
33682
34616
|
);
|
33683
34617
|
}
|
33684
34618
|
};
|
33685
|
-
__publicField(MySqlMediumIntBuilder,
|
33686
|
-
MySqlMediumInt = class extends (_b195 = MySqlColumnWithAutoIncrement,
|
34619
|
+
__publicField(MySqlMediumIntBuilder, _a271, "MySqlMediumIntBuilder");
|
34620
|
+
MySqlMediumInt = class extends (_b195 = MySqlColumnWithAutoIncrement, _a272 = entityKind, _b195) {
|
33687
34621
|
getSQLType() {
|
33688
34622
|
return `mediumint${this.config.unsigned ? " unsigned" : ""}`;
|
33689
34623
|
}
|
@@ -33694,7 +34628,7 @@ var init_mediumint = __esm({
|
|
33694
34628
|
return value;
|
33695
34629
|
}
|
33696
34630
|
};
|
33697
|
-
__publicField(MySqlMediumInt,
|
34631
|
+
__publicField(MySqlMediumInt, _a272, "MySqlMediumInt");
|
33698
34632
|
}
|
33699
34633
|
});
|
33700
34634
|
|
@@ -33703,14 +34637,14 @@ function real3(a, b = {}) {
|
|
33703
34637
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
33704
34638
|
return new MySqlRealBuilder(name2, config);
|
33705
34639
|
}
|
33706
|
-
var
|
34640
|
+
var _a273, _b196, MySqlRealBuilder, _a274, _b197, MySqlReal;
|
33707
34641
|
var init_real3 = __esm({
|
33708
34642
|
"../drizzle-orm/dist/mysql-core/columns/real.js"() {
|
33709
34643
|
"use strict";
|
33710
34644
|
init_entity();
|
33711
34645
|
init_utils2();
|
33712
34646
|
init_common4();
|
33713
|
-
MySqlRealBuilder = class extends (_b196 = MySqlColumnBuilderWithAutoIncrement,
|
34647
|
+
MySqlRealBuilder = class extends (_b196 = MySqlColumnBuilderWithAutoIncrement, _a273 = entityKind, _b196) {
|
33714
34648
|
constructor(name2, config) {
|
33715
34649
|
super(name2, "number", "MySqlReal");
|
33716
34650
|
this.config.precision = config?.precision;
|
@@ -33721,8 +34655,8 @@ var init_real3 = __esm({
|
|
33721
34655
|
return new MySqlReal(table4, this.config);
|
33722
34656
|
}
|
33723
34657
|
};
|
33724
|
-
__publicField(MySqlRealBuilder,
|
33725
|
-
MySqlReal = class extends (_b197 = MySqlColumnWithAutoIncrement,
|
34658
|
+
__publicField(MySqlRealBuilder, _a273, "MySqlRealBuilder");
|
34659
|
+
MySqlReal = class extends (_b197 = MySqlColumnWithAutoIncrement, _a274 = entityKind, _b197) {
|
33726
34660
|
constructor() {
|
33727
34661
|
super(...arguments);
|
33728
34662
|
__publicField(this, "precision", this.config.precision);
|
@@ -33738,7 +34672,7 @@ var init_real3 = __esm({
|
|
33738
34672
|
}
|
33739
34673
|
}
|
33740
34674
|
};
|
33741
|
-
__publicField(MySqlReal,
|
34675
|
+
__publicField(MySqlReal, _a274, "MySqlReal");
|
33742
34676
|
}
|
33743
34677
|
});
|
33744
34678
|
|
@@ -33746,13 +34680,13 @@ var init_real3 = __esm({
|
|
33746
34680
|
function serial2(name2) {
|
33747
34681
|
return new MySqlSerialBuilder(name2 ?? "");
|
33748
34682
|
}
|
33749
|
-
var
|
34683
|
+
var _a275, _b198, MySqlSerialBuilder, _a276, _b199, MySqlSerial;
|
33750
34684
|
var init_serial2 = __esm({
|
33751
34685
|
"../drizzle-orm/dist/mysql-core/columns/serial.js"() {
|
33752
34686
|
"use strict";
|
33753
34687
|
init_entity();
|
33754
34688
|
init_common4();
|
33755
|
-
MySqlSerialBuilder = class extends (_b198 = MySqlColumnBuilderWithAutoIncrement,
|
34689
|
+
MySqlSerialBuilder = class extends (_b198 = MySqlColumnBuilderWithAutoIncrement, _a275 = entityKind, _b198) {
|
33756
34690
|
constructor(name2) {
|
33757
34691
|
super(name2, "number", "MySqlSerial");
|
33758
34692
|
this.config.hasDefault = true;
|
@@ -33763,8 +34697,8 @@ var init_serial2 = __esm({
|
|
33763
34697
|
return new MySqlSerial(table4, this.config);
|
33764
34698
|
}
|
33765
34699
|
};
|
33766
|
-
__publicField(MySqlSerialBuilder,
|
33767
|
-
MySqlSerial = class extends (_b199 = MySqlColumnWithAutoIncrement,
|
34700
|
+
__publicField(MySqlSerialBuilder, _a275, "MySqlSerialBuilder");
|
34701
|
+
MySqlSerial = class extends (_b199 = MySqlColumnWithAutoIncrement, _a276 = entityKind, _b199) {
|
33768
34702
|
getSQLType() {
|
33769
34703
|
return "serial";
|
33770
34704
|
}
|
@@ -33775,7 +34709,7 @@ var init_serial2 = __esm({
|
|
33775
34709
|
return value;
|
33776
34710
|
}
|
33777
34711
|
};
|
33778
|
-
__publicField(MySqlSerial,
|
34712
|
+
__publicField(MySqlSerial, _a276, "MySqlSerial");
|
33779
34713
|
}
|
33780
34714
|
});
|
33781
34715
|
|
@@ -33784,14 +34718,14 @@ function smallint2(a, b) {
|
|
33784
34718
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
33785
34719
|
return new MySqlSmallIntBuilder(name2, config);
|
33786
34720
|
}
|
33787
|
-
var
|
34721
|
+
var _a277, _b200, MySqlSmallIntBuilder, _a278, _b201, MySqlSmallInt;
|
33788
34722
|
var init_smallint2 = __esm({
|
33789
34723
|
"../drizzle-orm/dist/mysql-core/columns/smallint.js"() {
|
33790
34724
|
"use strict";
|
33791
34725
|
init_entity();
|
33792
34726
|
init_utils2();
|
33793
34727
|
init_common4();
|
33794
|
-
MySqlSmallIntBuilder = class extends (_b200 = MySqlColumnBuilderWithAutoIncrement,
|
34728
|
+
MySqlSmallIntBuilder = class extends (_b200 = MySqlColumnBuilderWithAutoIncrement, _a277 = entityKind, _b200) {
|
33795
34729
|
constructor(name2, config) {
|
33796
34730
|
super(name2, "number", "MySqlSmallInt");
|
33797
34731
|
this.config.unsigned = config ? config.unsigned : false;
|
@@ -33804,8 +34738,8 @@ var init_smallint2 = __esm({
|
|
33804
34738
|
);
|
33805
34739
|
}
|
33806
34740
|
};
|
33807
|
-
__publicField(MySqlSmallIntBuilder,
|
33808
|
-
MySqlSmallInt = class extends (_b201 = MySqlColumnWithAutoIncrement,
|
34741
|
+
__publicField(MySqlSmallIntBuilder, _a277, "MySqlSmallIntBuilder");
|
34742
|
+
MySqlSmallInt = class extends (_b201 = MySqlColumnWithAutoIncrement, _a278 = entityKind, _b201) {
|
33809
34743
|
getSQLType() {
|
33810
34744
|
return `smallint${this.config.unsigned ? " unsigned" : ""}`;
|
33811
34745
|
}
|
@@ -33816,7 +34750,7 @@ var init_smallint2 = __esm({
|
|
33816
34750
|
return value;
|
33817
34751
|
}
|
33818
34752
|
};
|
33819
|
-
__publicField(MySqlSmallInt,
|
34753
|
+
__publicField(MySqlSmallInt, _a278, "MySqlSmallInt");
|
33820
34754
|
}
|
33821
34755
|
});
|
33822
34756
|
|
@@ -33825,14 +34759,14 @@ function text3(a, b = {}) {
|
|
33825
34759
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
33826
34760
|
return new MySqlTextBuilder(name2, "text", config);
|
33827
34761
|
}
|
33828
|
-
var
|
34762
|
+
var _a279, _b202, MySqlTextBuilder, _a280, _b203, MySqlText;
|
33829
34763
|
var init_text3 = __esm({
|
33830
34764
|
"../drizzle-orm/dist/mysql-core/columns/text.js"() {
|
33831
34765
|
"use strict";
|
33832
34766
|
init_entity();
|
33833
34767
|
init_utils2();
|
33834
34768
|
init_common4();
|
33835
|
-
MySqlTextBuilder = class extends (_b202 = MySqlColumnBuilder,
|
34769
|
+
MySqlTextBuilder = class extends (_b202 = MySqlColumnBuilder, _a279 = entityKind, _b202) {
|
33836
34770
|
constructor(name2, textType, config) {
|
33837
34771
|
super(name2, "string", "MySqlText");
|
33838
34772
|
this.config.textType = textType;
|
@@ -33843,8 +34777,8 @@ var init_text3 = __esm({
|
|
33843
34777
|
return new MySqlText(table4, this.config);
|
33844
34778
|
}
|
33845
34779
|
};
|
33846
|
-
__publicField(MySqlTextBuilder,
|
33847
|
-
MySqlText = class extends (_b203 = MySqlColumn,
|
34780
|
+
__publicField(MySqlTextBuilder, _a279, "MySqlTextBuilder");
|
34781
|
+
MySqlText = class extends (_b203 = MySqlColumn, _a280 = entityKind, _b203) {
|
33848
34782
|
constructor() {
|
33849
34783
|
super(...arguments);
|
33850
34784
|
__publicField(this, "textType", this.config.textType);
|
@@ -33854,7 +34788,7 @@ var init_text3 = __esm({
|
|
33854
34788
|
return this.textType;
|
33855
34789
|
}
|
33856
34790
|
};
|
33857
|
-
__publicField(MySqlText,
|
34791
|
+
__publicField(MySqlText, _a280, "MySqlText");
|
33858
34792
|
}
|
33859
34793
|
});
|
33860
34794
|
|
@@ -33863,14 +34797,14 @@ function time2(a, b) {
|
|
33863
34797
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
33864
34798
|
return new MySqlTimeBuilder(name2, config);
|
33865
34799
|
}
|
33866
|
-
var
|
34800
|
+
var _a281, _b204, MySqlTimeBuilder, _a282, _b205, MySqlTime;
|
33867
34801
|
var init_time2 = __esm({
|
33868
34802
|
"../drizzle-orm/dist/mysql-core/columns/time.js"() {
|
33869
34803
|
"use strict";
|
33870
34804
|
init_entity();
|
33871
34805
|
init_utils2();
|
33872
34806
|
init_common4();
|
33873
|
-
MySqlTimeBuilder = class extends (_b204 = MySqlColumnBuilder,
|
34807
|
+
MySqlTimeBuilder = class extends (_b204 = MySqlColumnBuilder, _a281 = entityKind, _b204) {
|
33874
34808
|
constructor(name2, config) {
|
33875
34809
|
super(name2, "string", "MySqlTime");
|
33876
34810
|
this.config.fsp = config?.fsp;
|
@@ -33880,8 +34814,8 @@ var init_time2 = __esm({
|
|
33880
34814
|
return new MySqlTime(table4, this.config);
|
33881
34815
|
}
|
33882
34816
|
};
|
33883
|
-
__publicField(MySqlTimeBuilder,
|
33884
|
-
MySqlTime = class extends (_b205 = MySqlColumn,
|
34817
|
+
__publicField(MySqlTimeBuilder, _a281, "MySqlTimeBuilder");
|
34818
|
+
MySqlTime = class extends (_b205 = MySqlColumn, _a282 = entityKind, _b205) {
|
33885
34819
|
constructor() {
|
33886
34820
|
super(...arguments);
|
33887
34821
|
__publicField(this, "fsp", this.config.fsp);
|
@@ -33891,19 +34825,19 @@ var init_time2 = __esm({
|
|
33891
34825
|
return `time${precision}`;
|
33892
34826
|
}
|
33893
34827
|
};
|
33894
|
-
__publicField(MySqlTime,
|
34828
|
+
__publicField(MySqlTime, _a282, "MySqlTime");
|
33895
34829
|
}
|
33896
34830
|
});
|
33897
34831
|
|
33898
34832
|
// ../drizzle-orm/dist/mysql-core/columns/date.common.js
|
33899
|
-
var
|
34833
|
+
var _a283, _b206, MySqlDateColumnBaseBuilder, _a284, _b207, MySqlDateBaseColumn;
|
33900
34834
|
var init_date_common2 = __esm({
|
33901
34835
|
"../drizzle-orm/dist/mysql-core/columns/date.common.js"() {
|
33902
34836
|
"use strict";
|
33903
34837
|
init_entity();
|
33904
34838
|
init_sql();
|
33905
34839
|
init_common4();
|
33906
|
-
MySqlDateColumnBaseBuilder = class extends (_b206 = MySqlColumnBuilder,
|
34840
|
+
MySqlDateColumnBaseBuilder = class extends (_b206 = MySqlColumnBuilder, _a283 = entityKind, _b206) {
|
33907
34841
|
defaultNow() {
|
33908
34842
|
return this.default(sql`(now())`);
|
33909
34843
|
}
|
@@ -33914,14 +34848,14 @@ var init_date_common2 = __esm({
|
|
33914
34848
|
return this;
|
33915
34849
|
}
|
33916
34850
|
};
|
33917
|
-
__publicField(MySqlDateColumnBaseBuilder,
|
33918
|
-
MySqlDateBaseColumn = class extends (_b207 = MySqlColumn,
|
34851
|
+
__publicField(MySqlDateColumnBaseBuilder, _a283, "MySqlDateColumnBuilder");
|
34852
|
+
MySqlDateBaseColumn = class extends (_b207 = MySqlColumn, _a284 = entityKind, _b207) {
|
33919
34853
|
constructor() {
|
33920
34854
|
super(...arguments);
|
33921
34855
|
__publicField(this, "hasOnUpdateNow", this.config.hasOnUpdateNow);
|
33922
34856
|
}
|
33923
34857
|
};
|
33924
|
-
__publicField(MySqlDateBaseColumn,
|
34858
|
+
__publicField(MySqlDateBaseColumn, _a284, "MySqlDateColumn");
|
33925
34859
|
}
|
33926
34860
|
});
|
33927
34861
|
|
@@ -33933,14 +34867,14 @@ function timestamp2(a, b = {}) {
|
|
33933
34867
|
}
|
33934
34868
|
return new MySqlTimestampBuilder(name2, config);
|
33935
34869
|
}
|
33936
|
-
var
|
34870
|
+
var _a285, _b208, MySqlTimestampBuilder, _a286, _b209, MySqlTimestamp, _a287, _b210, MySqlTimestampStringBuilder, _a288, _b211, MySqlTimestampString;
|
33937
34871
|
var init_timestamp2 = __esm({
|
33938
34872
|
"../drizzle-orm/dist/mysql-core/columns/timestamp.js"() {
|
33939
34873
|
"use strict";
|
33940
34874
|
init_entity();
|
33941
34875
|
init_utils2();
|
33942
34876
|
init_date_common2();
|
33943
|
-
MySqlTimestampBuilder = class extends (_b208 = MySqlDateColumnBaseBuilder,
|
34877
|
+
MySqlTimestampBuilder = class extends (_b208 = MySqlDateColumnBaseBuilder, _a285 = entityKind, _b208) {
|
33944
34878
|
constructor(name2, config) {
|
33945
34879
|
super(name2, "date", "MySqlTimestamp");
|
33946
34880
|
this.config.fsp = config?.fsp;
|
@@ -33953,8 +34887,8 @@ var init_timestamp2 = __esm({
|
|
33953
34887
|
);
|
33954
34888
|
}
|
33955
34889
|
};
|
33956
|
-
__publicField(MySqlTimestampBuilder,
|
33957
|
-
MySqlTimestamp = class extends (_b209 = MySqlDateBaseColumn,
|
34890
|
+
__publicField(MySqlTimestampBuilder, _a285, "MySqlTimestampBuilder");
|
34891
|
+
MySqlTimestamp = class extends (_b209 = MySqlDateBaseColumn, _a286 = entityKind, _b209) {
|
33958
34892
|
constructor() {
|
33959
34893
|
super(...arguments);
|
33960
34894
|
__publicField(this, "fsp", this.config.fsp);
|
@@ -33970,8 +34904,8 @@ var init_timestamp2 = __esm({
|
|
33970
34904
|
return value.toISOString().slice(0, -1).replace("T", " ");
|
33971
34905
|
}
|
33972
34906
|
};
|
33973
|
-
__publicField(MySqlTimestamp,
|
33974
|
-
MySqlTimestampStringBuilder = class extends (_b210 = MySqlDateColumnBaseBuilder,
|
34907
|
+
__publicField(MySqlTimestamp, _a286, "MySqlTimestamp");
|
34908
|
+
MySqlTimestampStringBuilder = class extends (_b210 = MySqlDateColumnBaseBuilder, _a287 = entityKind, _b210) {
|
33975
34909
|
constructor(name2, config) {
|
33976
34910
|
super(name2, "string", "MySqlTimestampString");
|
33977
34911
|
this.config.fsp = config?.fsp;
|
@@ -33984,8 +34918,8 @@ var init_timestamp2 = __esm({
|
|
33984
34918
|
);
|
33985
34919
|
}
|
33986
34920
|
};
|
33987
|
-
__publicField(MySqlTimestampStringBuilder,
|
33988
|
-
MySqlTimestampString = class extends (_b211 = MySqlDateBaseColumn,
|
34921
|
+
__publicField(MySqlTimestampStringBuilder, _a287, "MySqlTimestampStringBuilder");
|
34922
|
+
MySqlTimestampString = class extends (_b211 = MySqlDateBaseColumn, _a288 = entityKind, _b211) {
|
33989
34923
|
constructor() {
|
33990
34924
|
super(...arguments);
|
33991
34925
|
__publicField(this, "fsp", this.config.fsp);
|
@@ -33995,7 +34929,7 @@ var init_timestamp2 = __esm({
|
|
33995
34929
|
return `timestamp${precision}`;
|
33996
34930
|
}
|
33997
34931
|
};
|
33998
|
-
__publicField(MySqlTimestampString,
|
34932
|
+
__publicField(MySqlTimestampString, _a288, "MySqlTimestampString");
|
33999
34933
|
}
|
34000
34934
|
});
|
34001
34935
|
|
@@ -34004,14 +34938,14 @@ function tinyint(a, b) {
|
|
34004
34938
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
34005
34939
|
return new MySqlTinyIntBuilder(name2, config);
|
34006
34940
|
}
|
34007
|
-
var
|
34941
|
+
var _a289, _b212, MySqlTinyIntBuilder, _a290, _b213, MySqlTinyInt;
|
34008
34942
|
var init_tinyint = __esm({
|
34009
34943
|
"../drizzle-orm/dist/mysql-core/columns/tinyint.js"() {
|
34010
34944
|
"use strict";
|
34011
34945
|
init_entity();
|
34012
34946
|
init_utils2();
|
34013
34947
|
init_common4();
|
34014
|
-
MySqlTinyIntBuilder = class extends (_b212 = MySqlColumnBuilderWithAutoIncrement,
|
34948
|
+
MySqlTinyIntBuilder = class extends (_b212 = MySqlColumnBuilderWithAutoIncrement, _a289 = entityKind, _b212) {
|
34015
34949
|
constructor(name2, config) {
|
34016
34950
|
super(name2, "number", "MySqlTinyInt");
|
34017
34951
|
this.config.unsigned = config ? config.unsigned : false;
|
@@ -34024,8 +34958,8 @@ var init_tinyint = __esm({
|
|
34024
34958
|
);
|
34025
34959
|
}
|
34026
34960
|
};
|
34027
|
-
__publicField(MySqlTinyIntBuilder,
|
34028
|
-
MySqlTinyInt = class extends (_b213 = MySqlColumnWithAutoIncrement,
|
34961
|
+
__publicField(MySqlTinyIntBuilder, _a289, "MySqlTinyIntBuilder");
|
34962
|
+
MySqlTinyInt = class extends (_b213 = MySqlColumnWithAutoIncrement, _a290 = entityKind, _b213) {
|
34029
34963
|
getSQLType() {
|
34030
34964
|
return `tinyint${this.config.unsigned ? " unsigned" : ""}`;
|
34031
34965
|
}
|
@@ -34036,7 +34970,7 @@ var init_tinyint = __esm({
|
|
34036
34970
|
return value;
|
34037
34971
|
}
|
34038
34972
|
};
|
34039
|
-
__publicField(MySqlTinyInt,
|
34973
|
+
__publicField(MySqlTinyInt, _a290, "MySqlTinyInt");
|
34040
34974
|
}
|
34041
34975
|
});
|
34042
34976
|
|
@@ -34045,14 +34979,14 @@ function varbinary(a, b) {
|
|
34045
34979
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
34046
34980
|
return new MySqlVarBinaryBuilder(name2, config);
|
34047
34981
|
}
|
34048
|
-
var
|
34982
|
+
var _a291, _b214, MySqlVarBinaryBuilder, _a292, _b215, MySqlVarBinary;
|
34049
34983
|
var init_varbinary = __esm({
|
34050
34984
|
"../drizzle-orm/dist/mysql-core/columns/varbinary.js"() {
|
34051
34985
|
"use strict";
|
34052
34986
|
init_entity();
|
34053
34987
|
init_utils2();
|
34054
34988
|
init_common4();
|
34055
|
-
MySqlVarBinaryBuilder = class extends (_b214 = MySqlColumnBuilder,
|
34989
|
+
MySqlVarBinaryBuilder = class extends (_b214 = MySqlColumnBuilder, _a291 = entityKind, _b214) {
|
34056
34990
|
/** @internal */
|
34057
34991
|
constructor(name2, config) {
|
34058
34992
|
super(name2, "string", "MySqlVarBinary");
|
@@ -34066,8 +35000,8 @@ var init_varbinary = __esm({
|
|
34066
35000
|
);
|
34067
35001
|
}
|
34068
35002
|
};
|
34069
|
-
__publicField(MySqlVarBinaryBuilder,
|
34070
|
-
MySqlVarBinary = class extends (_b215 = MySqlColumn,
|
35003
|
+
__publicField(MySqlVarBinaryBuilder, _a291, "MySqlVarBinaryBuilder");
|
35004
|
+
MySqlVarBinary = class extends (_b215 = MySqlColumn, _a292 = entityKind, _b215) {
|
34071
35005
|
constructor() {
|
34072
35006
|
super(...arguments);
|
34073
35007
|
__publicField(this, "length", this.config.length);
|
@@ -34076,7 +35010,7 @@ var init_varbinary = __esm({
|
|
34076
35010
|
return this.length === void 0 ? `varbinary` : `varbinary(${this.length})`;
|
34077
35011
|
}
|
34078
35012
|
};
|
34079
|
-
__publicField(MySqlVarBinary,
|
35013
|
+
__publicField(MySqlVarBinary, _a292, "MySqlVarBinary");
|
34080
35014
|
}
|
34081
35015
|
});
|
34082
35016
|
|
@@ -34085,14 +35019,14 @@ function varchar2(a, b) {
|
|
34085
35019
|
const { name: name2, config } = getColumnNameAndConfig(a, b);
|
34086
35020
|
return new MySqlVarCharBuilder(name2, config);
|
34087
35021
|
}
|
34088
|
-
var
|
35022
|
+
var _a293, _b216, MySqlVarCharBuilder, _a294, _b217, MySqlVarChar;
|
34089
35023
|
var init_varchar2 = __esm({
|
34090
35024
|
"../drizzle-orm/dist/mysql-core/columns/varchar.js"() {
|
34091
35025
|
"use strict";
|
34092
35026
|
init_entity();
|
34093
35027
|
init_utils2();
|
34094
35028
|
init_common4();
|
34095
|
-
MySqlVarCharBuilder = class extends (_b216 = MySqlColumnBuilder,
|
35029
|
+
MySqlVarCharBuilder = class extends (_b216 = MySqlColumnBuilder, _a293 = entityKind, _b216) {
|
34096
35030
|
/** @internal */
|
34097
35031
|
constructor(name2, config) {
|
34098
35032
|
super(name2, "string", "MySqlVarChar");
|
@@ -34107,8 +35041,8 @@ var init_varchar2 = __esm({
|
|
34107
35041
|
);
|
34108
35042
|
}
|
34109
35043
|
};
|
34110
|
-
__publicField(MySqlVarCharBuilder,
|
34111
|
-
MySqlVarChar = class extends (_b217 = MySqlColumn,
|
35044
|
+
__publicField(MySqlVarCharBuilder, _a293, "MySqlVarCharBuilder");
|
35045
|
+
MySqlVarChar = class extends (_b217 = MySqlColumn, _a294 = entityKind, _b217) {
|
34112
35046
|
constructor() {
|
34113
35047
|
super(...arguments);
|
34114
35048
|
__publicField(this, "length", this.config.length);
|
@@ -34118,7 +35052,7 @@ var init_varchar2 = __esm({
|
|
34118
35052
|
return this.length === void 0 ? `varchar` : `varchar(${this.length})`;
|
34119
35053
|
}
|
34120
35054
|
};
|
34121
|
-
__publicField(MySqlVarChar,
|
35055
|
+
__publicField(MySqlVarChar, _a294, "MySqlVarChar");
|
34122
35056
|
}
|
34123
35057
|
});
|
34124
35058
|
|
@@ -34126,13 +35060,13 @@ var init_varchar2 = __esm({
|
|
34126
35060
|
function year(name2) {
|
34127
35061
|
return new MySqlYearBuilder(name2 ?? "");
|
34128
35062
|
}
|
34129
|
-
var
|
35063
|
+
var _a295, _b218, MySqlYearBuilder, _a296, _b219, MySqlYear;
|
34130
35064
|
var init_year = __esm({
|
34131
35065
|
"../drizzle-orm/dist/mysql-core/columns/year.js"() {
|
34132
35066
|
"use strict";
|
34133
35067
|
init_entity();
|
34134
35068
|
init_common4();
|
34135
|
-
MySqlYearBuilder = class extends (_b218 = MySqlColumnBuilder,
|
35069
|
+
MySqlYearBuilder = class extends (_b218 = MySqlColumnBuilder, _a295 = entityKind, _b218) {
|
34136
35070
|
constructor(name2) {
|
34137
35071
|
super(name2, "number", "MySqlYear");
|
34138
35072
|
}
|
@@ -34141,13 +35075,13 @@ var init_year = __esm({
|
|
34141
35075
|
return new MySqlYear(table4, this.config);
|
34142
35076
|
}
|
34143
35077
|
};
|
34144
|
-
__publicField(MySqlYearBuilder,
|
34145
|
-
MySqlYear = class extends (_b219 = MySqlColumn,
|
35078
|
+
__publicField(MySqlYearBuilder, _a295, "MySqlYearBuilder");
|
35079
|
+
MySqlYear = class extends (_b219 = MySqlColumn, _a296 = entityKind, _b219) {
|
34146
35080
|
getSQLType() {
|
34147
35081
|
return `year`;
|
34148
35082
|
}
|
34149
35083
|
};
|
34150
|
-
__publicField(MySqlYear,
|
35084
|
+
__publicField(MySqlYear, _a296, "MySqlYear");
|
34151
35085
|
}
|
34152
35086
|
});
|
34153
35087
|
|
@@ -34184,17 +35118,17 @@ var init_columns3 = __esm({
|
|
34184
35118
|
});
|
34185
35119
|
|
34186
35120
|
// ../drizzle-orm/dist/mysql-core/query-builders/count.js
|
34187
|
-
var
|
35121
|
+
var _a297, _b220, _c8, _MySqlCountBuilder, MySqlCountBuilder;
|
34188
35122
|
var init_count3 = __esm({
|
34189
35123
|
"../drizzle-orm/dist/mysql-core/query-builders/count.js"() {
|
34190
35124
|
"use strict";
|
34191
35125
|
init_entity();
|
34192
35126
|
init_sql();
|
34193
|
-
_MySqlCountBuilder = class _MySqlCountBuilder extends (_c8 = SQL, _b220 = entityKind,
|
35127
|
+
_MySqlCountBuilder = class _MySqlCountBuilder extends (_c8 = SQL, _b220 = entityKind, _a297 = Symbol.toStringTag, _c8) {
|
34194
35128
|
constructor(params) {
|
34195
35129
|
super(_MySqlCountBuilder.buildEmbeddedCount(params.source, params.filters).queryChunks);
|
34196
35130
|
__publicField(this, "sql");
|
34197
|
-
__publicField(this,
|
35131
|
+
__publicField(this, _a297, "MySqlCountBuilder");
|
34198
35132
|
__publicField(this, "session");
|
34199
35133
|
this.params = params;
|
34200
35134
|
this.mapWith(Number);
|
@@ -34238,7 +35172,7 @@ var init_count3 = __esm({
|
|
34238
35172
|
});
|
34239
35173
|
|
34240
35174
|
// ../drizzle-orm/dist/mysql-core/query-builders/delete.js
|
34241
|
-
var
|
35175
|
+
var _a298, _b221, MySqlDeleteBase;
|
34242
35176
|
var init_delete3 = __esm({
|
34243
35177
|
"../drizzle-orm/dist/mysql-core/query-builders/delete.js"() {
|
34244
35178
|
"use strict";
|
@@ -34246,7 +35180,7 @@ var init_delete3 = __esm({
|
|
34246
35180
|
init_query_promise();
|
34247
35181
|
init_selection_proxy();
|
34248
35182
|
init_table();
|
34249
|
-
MySqlDeleteBase = class extends (_b221 = QueryPromise,
|
35183
|
+
MySqlDeleteBase = class extends (_b221 = QueryPromise, _a298 = entityKind, _b221) {
|
34250
35184
|
constructor(table4, session, dialect4, withList) {
|
34251
35185
|
super();
|
34252
35186
|
__publicField(this, "config");
|
@@ -34336,12 +35270,12 @@ var init_delete3 = __esm({
|
|
34336
35270
|
return this;
|
34337
35271
|
}
|
34338
35272
|
};
|
34339
|
-
__publicField(MySqlDeleteBase,
|
35273
|
+
__publicField(MySqlDeleteBase, _a298, "MySqlDelete");
|
34340
35274
|
}
|
34341
35275
|
});
|
34342
35276
|
|
34343
35277
|
// ../drizzle-orm/dist/mysql-core/query-builders/insert.js
|
34344
|
-
var
|
35278
|
+
var _a299, MySqlInsertBuilder, _a300, _b222, MySqlInsertBase;
|
34345
35279
|
var init_insert3 = __esm({
|
34346
35280
|
"../drizzle-orm/dist/mysql-core/query-builders/insert.js"() {
|
34347
35281
|
"use strict";
|
@@ -34350,7 +35284,7 @@ var init_insert3 = __esm({
|
|
34350
35284
|
init_sql();
|
34351
35285
|
init_table();
|
34352
35286
|
init_utils2();
|
34353
|
-
|
35287
|
+
_a299 = entityKind;
|
34354
35288
|
MySqlInsertBuilder = class {
|
34355
35289
|
constructor(table4, session, dialect4) {
|
34356
35290
|
__publicField(this, "shouldIgnore", false);
|
@@ -34379,8 +35313,8 @@ var init_insert3 = __esm({
|
|
34379
35313
|
return new MySqlInsertBase(this.table, mappedValues, this.shouldIgnore, this.session, this.dialect);
|
34380
35314
|
}
|
34381
35315
|
};
|
34382
|
-
__publicField(MySqlInsertBuilder,
|
34383
|
-
MySqlInsertBase = class extends (_b222 = QueryPromise,
|
35316
|
+
__publicField(MySqlInsertBuilder, _a299, "MySqlInsertBuilder");
|
35317
|
+
MySqlInsertBase = class extends (_b222 = QueryPromise, _a300 = entityKind, _b222) {
|
34384
35318
|
constructor(table4, values, ignore, session, dialect4) {
|
34385
35319
|
super();
|
34386
35320
|
__publicField(this, "config");
|
@@ -34461,7 +35395,7 @@ var init_insert3 = __esm({
|
|
34461
35395
|
return this;
|
34462
35396
|
}
|
34463
35397
|
};
|
34464
|
-
__publicField(MySqlInsertBase,
|
35398
|
+
__publicField(MySqlInsertBase, _a300, "MySqlInsert");
|
34465
35399
|
}
|
34466
35400
|
});
|
34467
35401
|
|
@@ -34545,7 +35479,7 @@ function mysqlTableWithSchema(name2, columns, extraConfig, schema4, baseName = n
|
|
34545
35479
|
}
|
34546
35480
|
return table4;
|
34547
35481
|
}
|
34548
|
-
var InlineForeignKeys3,
|
35482
|
+
var InlineForeignKeys3, _a301, _b223, _c9, _d4, _e4, MySqlTable, mysqlTable;
|
34549
35483
|
var init_table4 = __esm({
|
34550
35484
|
"../drizzle-orm/dist/mysql-core/table.js"() {
|
34551
35485
|
"use strict";
|
@@ -34553,7 +35487,7 @@ var init_table4 = __esm({
|
|
34553
35487
|
init_table();
|
34554
35488
|
init_all3();
|
34555
35489
|
InlineForeignKeys3 = Symbol.for("drizzle:MySqlInlineForeignKeys");
|
34556
|
-
MySqlTable = class extends (
|
35490
|
+
MySqlTable = class extends (_e4 = Table, _d4 = entityKind, _c9 = Table.Symbol.Columns, _b223 = InlineForeignKeys3, _a301 = Table.Symbol.ExtraConfigBuilder, _e4) {
|
34557
35491
|
constructor() {
|
34558
35492
|
super(...arguments);
|
34559
35493
|
/** @internal */
|
@@ -34561,7 +35495,7 @@ var init_table4 = __esm({
|
|
34561
35495
|
/** @internal */
|
34562
35496
|
__publicField(this, _b223, []);
|
34563
35497
|
/** @internal */
|
34564
|
-
__publicField(this,
|
35498
|
+
__publicField(this, _a301);
|
34565
35499
|
}
|
34566
35500
|
};
|
34567
35501
|
__publicField(MySqlTable, _d4, "MySqlTable");
|
@@ -34576,20 +35510,20 @@ var init_table4 = __esm({
|
|
34576
35510
|
});
|
34577
35511
|
|
34578
35512
|
// ../drizzle-orm/dist/mysql-core/view-base.js
|
34579
|
-
var
|
35513
|
+
var _a302, _b224, MySqlViewBase;
|
34580
35514
|
var init_view_base3 = __esm({
|
34581
35515
|
"../drizzle-orm/dist/mysql-core/view-base.js"() {
|
34582
35516
|
"use strict";
|
34583
35517
|
init_entity();
|
34584
35518
|
init_sql();
|
34585
|
-
MySqlViewBase = class extends (_b224 = View3,
|
35519
|
+
MySqlViewBase = class extends (_b224 = View3, _a302 = entityKind, _b224) {
|
34586
35520
|
};
|
34587
|
-
__publicField(MySqlViewBase,
|
35521
|
+
__publicField(MySqlViewBase, _a302, "MySqlViewBase");
|
34588
35522
|
}
|
34589
35523
|
});
|
34590
35524
|
|
34591
35525
|
// ../drizzle-orm/dist/mysql-core/dialect.js
|
34592
|
-
var
|
35526
|
+
var _a303, MySqlDialect;
|
34593
35527
|
var init_dialect3 = __esm({
|
34594
35528
|
"../drizzle-orm/dist/mysql-core/dialect.js"() {
|
34595
35529
|
"use strict";
|
@@ -34608,7 +35542,7 @@ var init_dialect3 = __esm({
|
|
34608
35542
|
init_common4();
|
34609
35543
|
init_table4();
|
34610
35544
|
init_view_base3();
|
34611
|
-
|
35545
|
+
_a303 = entityKind;
|
34612
35546
|
MySqlDialect = class {
|
34613
35547
|
constructor(config) {
|
34614
35548
|
/** @internal */
|
@@ -35394,7 +36328,7 @@ var init_dialect3 = __esm({
|
|
35394
36328
|
};
|
35395
36329
|
}
|
35396
36330
|
};
|
35397
|
-
__publicField(MySqlDialect,
|
36331
|
+
__publicField(MySqlDialect, _a303, "MySqlDialect");
|
35398
36332
|
}
|
35399
36333
|
});
|
35400
36334
|
|
@@ -35416,7 +36350,7 @@ function createSetOperator3(type, isAll) {
|
|
35416
36350
|
return leftSelect.addSetOperators(setOperators);
|
35417
36351
|
};
|
35418
36352
|
}
|
35419
|
-
var
|
36353
|
+
var _a304, MySqlSelectBuilder, _a305, _b225, MySqlSelectQueryBuilderBase, _a306, _b226, MySqlSelectBase, getMySqlSetOperators, union3, unionAll3, intersect3, intersectAll2, except3, exceptAll2;
|
35420
36354
|
var init_select4 = __esm({
|
35421
36355
|
"../drizzle-orm/dist/mysql-core/query-builders/select.js"() {
|
35422
36356
|
"use strict";
|
@@ -35431,7 +36365,7 @@ var init_select4 = __esm({
|
|
35431
36365
|
init_utils2();
|
35432
36366
|
init_view_common();
|
35433
36367
|
init_view_base3();
|
35434
|
-
|
36368
|
+
_a304 = entityKind;
|
35435
36369
|
MySqlSelectBuilder = class {
|
35436
36370
|
constructor(config) {
|
35437
36371
|
__publicField(this, "fields");
|
@@ -35476,8 +36410,8 @@ var init_select4 = __esm({
|
|
35476
36410
|
);
|
35477
36411
|
}
|
35478
36412
|
};
|
35479
|
-
__publicField(MySqlSelectBuilder,
|
35480
|
-
MySqlSelectQueryBuilderBase = class extends (_b225 = TypedQueryBuilder,
|
36413
|
+
__publicField(MySqlSelectBuilder, _a304, "MySqlSelectBuilder");
|
36414
|
+
MySqlSelectQueryBuilderBase = class extends (_b225 = TypedQueryBuilder, _a305 = entityKind, _b225) {
|
35481
36415
|
constructor({ table: table4, fields, isPartialSelect, session, dialect: dialect4, withList, distinct }) {
|
35482
36416
|
super();
|
35483
36417
|
__publicField(this, "_");
|
@@ -36078,8 +37012,8 @@ var init_select4 = __esm({
|
|
36078
37012
|
return this;
|
36079
37013
|
}
|
36080
37014
|
};
|
36081
|
-
__publicField(MySqlSelectQueryBuilderBase,
|
36082
|
-
MySqlSelectBase = class extends (_b226 = MySqlSelectQueryBuilderBase,
|
37015
|
+
__publicField(MySqlSelectQueryBuilderBase, _a305, "MySqlSelectQueryBuilder");
|
37016
|
+
MySqlSelectBase = class extends (_b226 = MySqlSelectQueryBuilderBase, _a306 = entityKind, _b226) {
|
36083
37017
|
constructor() {
|
36084
37018
|
super(...arguments);
|
36085
37019
|
__publicField(this, "execute", (placeholderValues) => {
|
@@ -36103,7 +37037,7 @@ var init_select4 = __esm({
|
|
36103
37037
|
return query;
|
36104
37038
|
}
|
36105
37039
|
};
|
36106
|
-
__publicField(MySqlSelectBase,
|
37040
|
+
__publicField(MySqlSelectBase, _a306, "MySqlSelect");
|
36107
37041
|
applyMixins(MySqlSelectBase, [QueryPromise]);
|
36108
37042
|
getMySqlSetOperators = () => ({
|
36109
37043
|
union: union3,
|
@@ -36123,7 +37057,7 @@ var init_select4 = __esm({
|
|
36123
37057
|
});
|
36124
37058
|
|
36125
37059
|
// ../drizzle-orm/dist/mysql-core/query-builders/query-builder.js
|
36126
|
-
var
|
37060
|
+
var _a307, QueryBuilder3;
|
36127
37061
|
var init_query_builder4 = __esm({
|
36128
37062
|
"../drizzle-orm/dist/mysql-core/query-builders/query-builder.js"() {
|
36129
37063
|
"use strict";
|
@@ -36132,7 +37066,7 @@ var init_query_builder4 = __esm({
|
|
36132
37066
|
init_selection_proxy();
|
36133
37067
|
init_subquery();
|
36134
37068
|
init_select4();
|
36135
|
-
|
37069
|
+
_a307 = entityKind;
|
36136
37070
|
QueryBuilder3 = class {
|
36137
37071
|
constructor(dialect4) {
|
36138
37072
|
__publicField(this, "dialect");
|
@@ -36194,7 +37128,7 @@ var init_query_builder4 = __esm({
|
|
36194
37128
|
return this.dialect;
|
36195
37129
|
}
|
36196
37130
|
};
|
36197
|
-
__publicField(QueryBuilder3,
|
37131
|
+
__publicField(QueryBuilder3, _a307, "MySqlQueryBuilder");
|
36198
37132
|
}
|
36199
37133
|
});
|
36200
37134
|
|
@@ -36206,7 +37140,7 @@ var init_select_types3 = __esm({
|
|
36206
37140
|
});
|
36207
37141
|
|
36208
37142
|
// ../drizzle-orm/dist/mysql-core/query-builders/update.js
|
36209
|
-
var
|
37143
|
+
var _a308, MySqlUpdateBuilder, _a309, _b227, MySqlUpdateBase;
|
36210
37144
|
var init_update3 = __esm({
|
36211
37145
|
"../drizzle-orm/dist/mysql-core/query-builders/update.js"() {
|
36212
37146
|
"use strict";
|
@@ -36215,7 +37149,7 @@ var init_update3 = __esm({
|
|
36215
37149
|
init_selection_proxy();
|
36216
37150
|
init_table();
|
36217
37151
|
init_utils2();
|
36218
|
-
|
37152
|
+
_a308 = entityKind;
|
36219
37153
|
MySqlUpdateBuilder = class {
|
36220
37154
|
constructor(table4, session, dialect4, withList) {
|
36221
37155
|
this.table = table4;
|
@@ -36227,8 +37161,8 @@ var init_update3 = __esm({
|
|
36227
37161
|
return new MySqlUpdateBase(this.table, mapUpdateSet(this.table, values), this.session, this.dialect, this.withList);
|
36228
37162
|
}
|
36229
37163
|
};
|
36230
|
-
__publicField(MySqlUpdateBuilder,
|
36231
|
-
MySqlUpdateBase = class extends (_b227 = QueryPromise,
|
37164
|
+
__publicField(MySqlUpdateBuilder, _a308, "MySqlUpdateBuilder");
|
37165
|
+
MySqlUpdateBase = class extends (_b227 = QueryPromise, _a309 = entityKind, _b227) {
|
36232
37166
|
constructor(table4, set, session, dialect4, withList) {
|
36233
37167
|
super();
|
36234
37168
|
__publicField(this, "config");
|
@@ -36321,7 +37255,7 @@ var init_update3 = __esm({
|
|
36321
37255
|
return this;
|
36322
37256
|
}
|
36323
37257
|
};
|
36324
|
-
__publicField(MySqlUpdateBase,
|
37258
|
+
__publicField(MySqlUpdateBase, _a309, "MySqlUpdate");
|
36325
37259
|
}
|
36326
37260
|
});
|
36327
37261
|
|
@@ -36339,14 +37273,14 @@ var init_query_builders3 = __esm({
|
|
36339
37273
|
});
|
36340
37274
|
|
36341
37275
|
// ../drizzle-orm/dist/mysql-core/query-builders/query.js
|
36342
|
-
var
|
37276
|
+
var _a310, RelationalQueryBuilder3, _a311, _b228, MySqlRelationalQuery;
|
36343
37277
|
var init_query3 = __esm({
|
36344
37278
|
"../drizzle-orm/dist/mysql-core/query-builders/query.js"() {
|
36345
37279
|
"use strict";
|
36346
37280
|
init_entity();
|
36347
37281
|
init_query_promise();
|
36348
37282
|
init_relations();
|
36349
|
-
|
37283
|
+
_a310 = entityKind;
|
36350
37284
|
RelationalQueryBuilder3 = class {
|
36351
37285
|
constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, mode) {
|
36352
37286
|
this.fullSchema = fullSchema;
|
@@ -36387,8 +37321,8 @@ var init_query3 = __esm({
|
|
36387
37321
|
);
|
36388
37322
|
}
|
36389
37323
|
};
|
36390
|
-
__publicField(RelationalQueryBuilder3,
|
36391
|
-
MySqlRelationalQuery = class extends (_b228 = QueryPromise,
|
37324
|
+
__publicField(RelationalQueryBuilder3, _a310, "MySqlRelationalQueryBuilder");
|
37325
|
+
MySqlRelationalQuery = class extends (_b228 = QueryPromise, _a311 = entityKind, _b228) {
|
36392
37326
|
constructor(fullSchema, schema4, tableNamesMap, table4, tableConfig, dialect4, session, config, queryMode, mode) {
|
36393
37327
|
super();
|
36394
37328
|
this.fullSchema = fullSchema;
|
@@ -36452,12 +37386,12 @@ var init_query3 = __esm({
|
|
36452
37386
|
return this.prepare().execute();
|
36453
37387
|
}
|
36454
37388
|
};
|
36455
|
-
__publicField(MySqlRelationalQuery,
|
37389
|
+
__publicField(MySqlRelationalQuery, _a311, "MySqlRelationalQuery");
|
36456
37390
|
}
|
36457
37391
|
});
|
36458
37392
|
|
36459
37393
|
// ../drizzle-orm/dist/mysql-core/db.js
|
36460
|
-
var
|
37394
|
+
var _a312, MySqlDatabase;
|
36461
37395
|
var init_db3 = __esm({
|
36462
37396
|
"../drizzle-orm/dist/mysql-core/db.js"() {
|
36463
37397
|
"use strict";
|
@@ -36468,7 +37402,7 @@ var init_db3 = __esm({
|
|
36468
37402
|
init_count3();
|
36469
37403
|
init_query_builders3();
|
36470
37404
|
init_query3();
|
36471
|
-
|
37405
|
+
_a312 = entityKind;
|
36472
37406
|
MySqlDatabase = class {
|
36473
37407
|
constructor(dialect4, session, schema4, mode) {
|
36474
37408
|
__publicField(this, "query");
|
@@ -36681,17 +37615,17 @@ var init_db3 = __esm({
|
|
36681
37615
|
return this.session.transaction(transaction, config);
|
36682
37616
|
}
|
36683
37617
|
};
|
36684
|
-
__publicField(MySqlDatabase,
|
37618
|
+
__publicField(MySqlDatabase, _a312, "MySqlDatabase");
|
36685
37619
|
}
|
36686
37620
|
});
|
36687
37621
|
|
36688
37622
|
// ../drizzle-orm/dist/mysql-core/indexes.js
|
36689
|
-
var
|
37623
|
+
var _a313, IndexBuilderOn3, _a314, IndexBuilder3, _a315, Index5;
|
36690
37624
|
var init_indexes3 = __esm({
|
36691
37625
|
"../drizzle-orm/dist/mysql-core/indexes.js"() {
|
36692
37626
|
"use strict";
|
36693
37627
|
init_entity();
|
36694
|
-
|
37628
|
+
_a313 = entityKind;
|
36695
37629
|
IndexBuilderOn3 = class {
|
36696
37630
|
constructor(name2, unique) {
|
36697
37631
|
this.name = name2;
|
@@ -36701,8 +37635,8 @@ var init_indexes3 = __esm({
|
|
36701
37635
|
return new IndexBuilder3(this.name, columns, this.unique);
|
36702
37636
|
}
|
36703
37637
|
};
|
36704
|
-
__publicField(IndexBuilderOn3,
|
36705
|
-
|
37638
|
+
__publicField(IndexBuilderOn3, _a313, "MySqlIndexBuilderOn");
|
37639
|
+
_a314 = entityKind;
|
36706
37640
|
IndexBuilder3 = class {
|
36707
37641
|
constructor(name2, columns, unique) {
|
36708
37642
|
/** @internal */
|
@@ -36730,26 +37664,26 @@ var init_indexes3 = __esm({
|
|
36730
37664
|
return new Index5(this.config, table4);
|
36731
37665
|
}
|
36732
37666
|
};
|
36733
|
-
__publicField(IndexBuilder3,
|
36734
|
-
|
37667
|
+
__publicField(IndexBuilder3, _a314, "MySqlIndexBuilder");
|
37668
|
+
_a315 = entityKind;
|
36735
37669
|
Index5 = class {
|
36736
37670
|
constructor(config, table4) {
|
36737
37671
|
__publicField(this, "config");
|
36738
37672
|
this.config = { ...config, table: table4 };
|
36739
37673
|
}
|
36740
37674
|
};
|
36741
|
-
__publicField(Index5,
|
37675
|
+
__publicField(Index5, _a315, "MySqlIndex");
|
36742
37676
|
}
|
36743
37677
|
});
|
36744
37678
|
|
36745
37679
|
// ../drizzle-orm/dist/mysql-core/primary-keys.js
|
36746
|
-
var
|
37680
|
+
var _a316, PrimaryKeyBuilder3, _a317, PrimaryKey3;
|
36747
37681
|
var init_primary_keys3 = __esm({
|
36748
37682
|
"../drizzle-orm/dist/mysql-core/primary-keys.js"() {
|
36749
37683
|
"use strict";
|
36750
37684
|
init_entity();
|
36751
37685
|
init_table4();
|
36752
|
-
|
37686
|
+
_a316 = entityKind;
|
36753
37687
|
PrimaryKeyBuilder3 = class {
|
36754
37688
|
constructor(columns, name2) {
|
36755
37689
|
/** @internal */
|
@@ -36764,8 +37698,8 @@ var init_primary_keys3 = __esm({
|
|
36764
37698
|
return new PrimaryKey3(table4, this.columns, this.name);
|
36765
37699
|
}
|
36766
37700
|
};
|
36767
|
-
__publicField(PrimaryKeyBuilder3,
|
36768
|
-
|
37701
|
+
__publicField(PrimaryKeyBuilder3, _a316, "MySqlPrimaryKeyBuilder");
|
37702
|
+
_a317 = entityKind;
|
36769
37703
|
PrimaryKey3 = class {
|
36770
37704
|
constructor(table4, columns, name2) {
|
36771
37705
|
__publicField(this, "columns");
|
@@ -36778,7 +37712,7 @@ var init_primary_keys3 = __esm({
|
|
36778
37712
|
return this.name ?? `${this.table[MySqlTable.Symbol.Name]}_${this.columns.map((column4) => column4.name).join("_")}_pk`;
|
36779
37713
|
}
|
36780
37714
|
};
|
36781
|
-
__publicField(PrimaryKey3,
|
37715
|
+
__publicField(PrimaryKey3, _a317, "MySqlPrimaryKey");
|
36782
37716
|
}
|
36783
37717
|
});
|
36784
37718
|
|
@@ -36798,7 +37732,7 @@ function mysqlViewWithSchema(name2, selection, schema4) {
|
|
36798
37732
|
}
|
36799
37733
|
return new ViewBuilder3(name2, schema4);
|
36800
37734
|
}
|
36801
|
-
var
|
37735
|
+
var _a318, ViewBuilderCore2, _a319, _b229, ViewBuilder3, _a320, _b230, ManualViewBuilder3, _a321, _b231, _c10, MySqlView2;
|
36802
37736
|
var init_view3 = __esm({
|
36803
37737
|
"../drizzle-orm/dist/mysql-core/view.js"() {
|
36804
37738
|
"use strict";
|
@@ -36809,7 +37743,7 @@ var init_view3 = __esm({
|
|
36809
37743
|
init_table4();
|
36810
37744
|
init_view_base3();
|
36811
37745
|
init_view_common3();
|
36812
|
-
|
37746
|
+
_a318 = entityKind;
|
36813
37747
|
ViewBuilderCore2 = class {
|
36814
37748
|
constructor(name2, schema4) {
|
36815
37749
|
__publicField(this, "config", {});
|
@@ -36829,8 +37763,8 @@ var init_view3 = __esm({
|
|
36829
37763
|
return this;
|
36830
37764
|
}
|
36831
37765
|
};
|
36832
|
-
__publicField(ViewBuilderCore2,
|
36833
|
-
ViewBuilder3 = class extends (_b229 = ViewBuilderCore2,
|
37766
|
+
__publicField(ViewBuilderCore2, _a318, "MySqlViewBuilder");
|
37767
|
+
ViewBuilder3 = class extends (_b229 = ViewBuilderCore2, _a319 = entityKind, _b229) {
|
36834
37768
|
as(qb) {
|
36835
37769
|
if (typeof qb === "function") {
|
36836
37770
|
qb = qb(new QueryBuilder3());
|
@@ -36856,8 +37790,8 @@ var init_view3 = __esm({
|
|
36856
37790
|
);
|
36857
37791
|
}
|
36858
37792
|
};
|
36859
|
-
__publicField(ViewBuilder3,
|
36860
|
-
ManualViewBuilder3 = class extends (_b230 = ViewBuilderCore2,
|
37793
|
+
__publicField(ViewBuilder3, _a319, "MySqlViewBuilder");
|
37794
|
+
ManualViewBuilder3 = class extends (_b230 = ViewBuilderCore2, _a320 = entityKind, _b230) {
|
36861
37795
|
constructor(name2, columns, schema4) {
|
36862
37796
|
super(name2, schema4);
|
36863
37797
|
__publicField(this, "columns");
|
@@ -36902,11 +37836,11 @@ var init_view3 = __esm({
|
|
36902
37836
|
);
|
36903
37837
|
}
|
36904
37838
|
};
|
36905
|
-
__publicField(ManualViewBuilder3,
|
36906
|
-
MySqlView2 = class extends (_c10 = MySqlViewBase, _b231 = entityKind,
|
37839
|
+
__publicField(ManualViewBuilder3, _a320, "MySqlManualViewBuilder");
|
37840
|
+
MySqlView2 = class extends (_c10 = MySqlViewBase, _b231 = entityKind, _a321 = MySqlViewConfig, _c10) {
|
36907
37841
|
constructor({ mysqlConfig, config }) {
|
36908
37842
|
super(config);
|
36909
|
-
__publicField(this,
|
37843
|
+
__publicField(this, _a321);
|
36910
37844
|
this[MySqlViewConfig] = mysqlConfig;
|
36911
37845
|
}
|
36912
37846
|
};
|
@@ -36915,14 +37849,14 @@ var init_view3 = __esm({
|
|
36915
37849
|
});
|
36916
37850
|
|
36917
37851
|
// ../drizzle-orm/dist/mysql-core/schema.js
|
36918
|
-
var
|
37852
|
+
var _a322, MySqlSchema5;
|
36919
37853
|
var init_schema2 = __esm({
|
36920
37854
|
"../drizzle-orm/dist/mysql-core/schema.js"() {
|
36921
37855
|
"use strict";
|
36922
37856
|
init_entity();
|
36923
37857
|
init_table4();
|
36924
37858
|
init_view3();
|
36925
|
-
|
37859
|
+
_a322 = entityKind;
|
36926
37860
|
MySqlSchema5 = class {
|
36927
37861
|
constructor(schemaName) {
|
36928
37862
|
__publicField(this, "table", (name2, columns, extraConfig) => {
|
@@ -36934,12 +37868,12 @@ var init_schema2 = __esm({
|
|
36934
37868
|
this.schemaName = schemaName;
|
36935
37869
|
}
|
36936
37870
|
};
|
36937
|
-
__publicField(MySqlSchema5,
|
37871
|
+
__publicField(MySqlSchema5, _a322, "MySqlSchema");
|
36938
37872
|
}
|
36939
37873
|
});
|
36940
37874
|
|
36941
37875
|
// ../drizzle-orm/dist/mysql-core/session.js
|
36942
|
-
var
|
37876
|
+
var _a323, MySqlPreparedQuery, _a324, MySqlSession, _a325, _b232, MySqlTransaction;
|
36943
37877
|
var init_session3 = __esm({
|
36944
37878
|
"../drizzle-orm/dist/mysql-core/session.js"() {
|
36945
37879
|
"use strict";
|
@@ -36947,15 +37881,15 @@ var init_session3 = __esm({
|
|
36947
37881
|
init_errors();
|
36948
37882
|
init_sql();
|
36949
37883
|
init_db3();
|
36950
|
-
|
37884
|
+
_a323 = entityKind;
|
36951
37885
|
MySqlPreparedQuery = class {
|
36952
37886
|
constructor() {
|
36953
37887
|
/** @internal */
|
36954
37888
|
__publicField(this, "joinsNotNullableMap");
|
36955
37889
|
}
|
36956
37890
|
};
|
36957
|
-
__publicField(MySqlPreparedQuery,
|
36958
|
-
|
37891
|
+
__publicField(MySqlPreparedQuery, _a323, "MySqlPreparedQuery");
|
37892
|
+
_a324 = entityKind;
|
36959
37893
|
MySqlSession = class {
|
36960
37894
|
constructor(dialect4) {
|
36961
37895
|
this.dialect = dialect4;
|
@@ -36990,8 +37924,8 @@ var init_session3 = __esm({
|
|
36990
37924
|
return parts.length ? sql`start transaction ${sql.raw(parts.join(" "))}` : void 0;
|
36991
37925
|
}
|
36992
37926
|
};
|
36993
|
-
__publicField(MySqlSession,
|
36994
|
-
MySqlTransaction = class extends (_b232 = MySqlDatabase,
|
37927
|
+
__publicField(MySqlSession, _a324, "MySqlSession");
|
37928
|
+
MySqlTransaction = class extends (_b232 = MySqlDatabase, _a325 = entityKind, _b232) {
|
36995
37929
|
constructor(dialect4, session, schema4, nestedIndex, mode) {
|
36996
37930
|
super(dialect4, session, schema4, mode);
|
36997
37931
|
this.schema = schema4;
|
@@ -37001,7 +37935,7 @@ var init_session3 = __esm({
|
|
37001
37935
|
throw new TransactionRollbackError();
|
37002
37936
|
}
|
37003
37937
|
};
|
37004
|
-
__publicField(MySqlTransaction,
|
37938
|
+
__publicField(MySqlTransaction, _a325, "MySqlTransaction");
|
37005
37939
|
}
|
37006
37940
|
});
|
37007
37941
|
|
@@ -37889,6 +38823,13 @@ var init_cli = __esm({
|
|
37889
38823
|
breakpoints: booleanType().optional().default(true),
|
37890
38824
|
migrations: objectType({
|
37891
38825
|
prefix: prefix.optional().default("index")
|
38826
|
+
}).optional(),
|
38827
|
+
entities: objectType({
|
38828
|
+
roles: booleanType().or(objectType({
|
38829
|
+
provider: stringType().optional(),
|
38830
|
+
include: stringType().array().optional(),
|
38831
|
+
exclude: stringType().array().optional()
|
38832
|
+
})).optional().default(false)
|
37892
38833
|
}).optional()
|
37893
38834
|
}).passthrough();
|
37894
38835
|
configCheck = objectType({
|
@@ -38155,6 +39096,7 @@ var init_pgImports = __esm({
|
|
38155
39096
|
const enums = [];
|
38156
39097
|
const schemas = [];
|
38157
39098
|
const sequences = [];
|
39099
|
+
const roles = [];
|
38158
39100
|
const views = [];
|
38159
39101
|
const matViews = [];
|
38160
39102
|
const i0values = Object.values(exports2);
|
@@ -38178,8 +39120,11 @@ var init_pgImports = __esm({
|
|
38178
39120
|
if (isPgSequence(t)) {
|
38179
39121
|
sequences.push(t);
|
38180
39122
|
}
|
39123
|
+
if (is(t, PgRole)) {
|
39124
|
+
roles.push(t);
|
39125
|
+
}
|
38181
39126
|
});
|
38182
|
-
return { tables, enums, schemas, sequences, views, matViews };
|
39127
|
+
return { tables, enums, schemas, sequences, views, matViews, roles };
|
38183
39128
|
};
|
38184
39129
|
}
|
38185
39130
|
});
|
@@ -38599,7 +39544,7 @@ init_mjs();
|
|
38599
39544
|
init_global();
|
38600
39545
|
init_pgSerializer();
|
38601
39546
|
init_views();
|
38602
|
-
var pgPushIntrospect = async (db, filters, schemaFilters) => {
|
39547
|
+
var pgPushIntrospect = async (db, filters, schemaFilters, entities = { roles: true }) => {
|
38603
39548
|
const matchers = filters.map((it) => {
|
38604
39549
|
return new Minimatch(it);
|
38605
39550
|
});
|
@@ -38627,7 +39572,7 @@ var pgPushIntrospect = async (db, filters, schemaFilters) => {
|
|
38627
39572
|
);
|
38628
39573
|
const res = await (0, import_hanji3.renderWithTask)(
|
38629
39574
|
progress,
|
38630
|
-
fromDatabase(db, filter2, schemaFilters)
|
39575
|
+
fromDatabase(db, filter2, schemaFilters, entities)
|
38631
39576
|
);
|
38632
39577
|
const schema4 = { id: originUUID, prevId: "", ...res };
|
38633
39578
|
const { internal, ...schemaWithoutInternals } = schema4;
|
@@ -38797,17 +39742,11 @@ var pgSuggestions = async (db, statements) => {
|
|
38797
39742
|
}
|
38798
39743
|
const stmnt = fromJson([statement], "postgresql");
|
38799
39744
|
if (typeof stmnt !== "undefined") {
|
38800
|
-
|
38801
|
-
statementsToExecute.push(
|
38802
|
-
`DROP TABLE ${concatSchemaAndTableName(statement.schema, statement.tableName)} CASCADE;`
|
38803
|
-
);
|
38804
|
-
} else {
|
38805
|
-
statementsToExecute.push(...stmnt);
|
38806
|
-
}
|
39745
|
+
statementsToExecute.push(...stmnt);
|
38807
39746
|
}
|
38808
39747
|
}
|
38809
39748
|
return {
|
38810
|
-
statementsToExecute,
|
39749
|
+
statementsToExecute: [...new Set(statementsToExecute)],
|
38811
39750
|
shouldAskForApprove,
|
38812
39751
|
infoToPrint,
|
38813
39752
|
matViewsToRemove: [...new Set(matViewsToRemove)],
|
@@ -39053,6 +39992,7 @@ var generateDrizzleJson = (imports, prevId, schemaFilters, casing2) => {
|
|
39053
39992
|
prepared.enums,
|
39054
39993
|
prepared.schemas,
|
39055
39994
|
prepared.sequences,
|
39995
|
+
prepared.roles,
|
39056
39996
|
prepared.views,
|
39057
39997
|
prepared.matViews,
|
39058
39998
|
casing2,
|
@@ -39076,6 +40016,8 @@ var generateMigration = async (prev, cur) => {
|
|
39076
40016
|
schemasResolver,
|
39077
40017
|
enumsResolver,
|
39078
40018
|
sequencesResolver,
|
40019
|
+
policyResolver,
|
40020
|
+
roleResolver,
|
39079
40021
|
tablesResolver,
|
39080
40022
|
columnsResolver,
|
39081
40023
|
viewsResolver,
|
@@ -39109,6 +40051,8 @@ var pushSchema = async (imports, drizzleInstance, schemaFilters) => {
|
|
39109
40051
|
schemasResolver,
|
39110
40052
|
enumsResolver,
|
39111
40053
|
sequencesResolver,
|
40054
|
+
policyResolver,
|
40055
|
+
roleResolver,
|
39112
40056
|
tablesResolver,
|
39113
40057
|
columnsResolver,
|
39114
40058
|
viewsResolver,
|