drizzle-kit 0.25.0-b8bf113 → 0.25.0-cb4af54
Sign up to get free protection for your applications and to get access to all the features.
- package/api.d.mts +4 -3
- package/api.d.ts +4 -3
- package/api.js +1045 -886
- package/api.mjs +1045 -886
- package/bin.cjs +606 -422
- package/common-DYjgLS6u.d.mts +8 -0
- package/common-DYjgLS6u.d.ts +8 -0
- package/index.d.mts +2 -5
- package/index.d.ts +2 -5
- package/package.json +2 -2
- package/utils.js +8 -0
- package/utils.mjs +7 -0
package/bin.cjs
CHANGED
@@ -6591,11 +6591,17 @@ function findAddedAndRemoved(columnNames1, columnNames2) {
|
|
6591
6591
|
const removedColumns = columnNames1.filter((it) => !set2.has(it));
|
6592
6592
|
return { addedColumns, removedColumns };
|
6593
6593
|
}
|
6594
|
-
|
6594
|
+
function getColumnCasing(column7, casing2) {
|
6595
|
+
if (!column7.name)
|
6596
|
+
return "";
|
6597
|
+
return !column7.keyAsName || casing2 === void 0 ? column7.name : casing2 === "camelCase" ? (0, import_casing.toCamelCase)(column7.name) : (0, import_casing.toSnakeCase)(column7.name);
|
6598
|
+
}
|
6599
|
+
var import_casing, import_fs, import_path, import_url, copy, objectValues, assertV1OutFolder, dryJournal, prepareOutFolder, validatorForDialect, validateWithReport, prepareMigrationFolder, prepareMigrationMeta, schemaRenameKey, tableRenameKey, columnRenameKey, normaliseSQLiteUrl, normalisePGliteUrl;
|
6595
6600
|
var init_utils = __esm({
|
6596
6601
|
"src/utils.ts"() {
|
6597
6602
|
"use strict";
|
6598
6603
|
init_source();
|
6604
|
+
import_casing = require("drizzle-orm/casing");
|
6599
6605
|
import_fs = require("fs");
|
6600
6606
|
import_path = require("path");
|
6601
6607
|
import_url = require("url");
|
@@ -6625,27 +6631,27 @@ var init_utils = __esm({
|
|
6625
6631
|
process.exit(1);
|
6626
6632
|
}
|
6627
6633
|
};
|
6628
|
-
dryJournal = (
|
6634
|
+
dryJournal = (dialect4) => {
|
6629
6635
|
return {
|
6630
6636
|
version: snapshotVersion,
|
6631
|
-
dialect:
|
6637
|
+
dialect: dialect4,
|
6632
6638
|
entries: []
|
6633
6639
|
};
|
6634
6640
|
};
|
6635
|
-
prepareOutFolder = (out,
|
6641
|
+
prepareOutFolder = (out, dialect4) => {
|
6636
6642
|
const meta = (0, import_path.join)(out, "meta");
|
6637
6643
|
const journalPath = (0, import_path.join)(meta, "_journal.json");
|
6638
6644
|
if (!(0, import_fs.existsSync)((0, import_path.join)(out, "meta"))) {
|
6639
6645
|
(0, import_fs.mkdirSync)(meta, { recursive: true });
|
6640
|
-
(0, import_fs.writeFileSync)(journalPath, JSON.stringify(dryJournal(
|
6646
|
+
(0, import_fs.writeFileSync)(journalPath, JSON.stringify(dryJournal(dialect4)));
|
6641
6647
|
}
|
6642
6648
|
const journal = JSON.parse((0, import_fs.readFileSync)(journalPath).toString());
|
6643
6649
|
const snapshots = (0, import_fs.readdirSync)(meta).filter((it) => !it.startsWith("_")).map((it) => (0, import_path.join)(meta, it));
|
6644
6650
|
snapshots.sort();
|
6645
6651
|
return { meta, snapshots, journal };
|
6646
6652
|
};
|
6647
|
-
validatorForDialect = (
|
6648
|
-
switch (
|
6653
|
+
validatorForDialect = (dialect4) => {
|
6654
|
+
switch (dialect4) {
|
6649
6655
|
case "postgresql":
|
6650
6656
|
return { validator: backwardCompatiblePgSchema, version: 7 };
|
6651
6657
|
case "sqlite":
|
@@ -6656,8 +6662,8 @@ var init_utils = __esm({
|
|
6656
6662
|
return { validator: backwardCompatibleMysqlSchema, version: 5 };
|
6657
6663
|
}
|
6658
6664
|
};
|
6659
|
-
validateWithReport = (snapshots,
|
6660
|
-
const { validator: validator2, version: version3 } = validatorForDialect(
|
6665
|
+
validateWithReport = (snapshots, dialect4) => {
|
6666
|
+
const { validator: validator2, version: version3 } = validatorForDialect(dialect4);
|
6661
6667
|
const result = snapshots.reduce(
|
6662
6668
|
(accum, it) => {
|
6663
6669
|
const raw2 = JSON.parse((0, import_fs.readFileSync)(`./${it}`).toString());
|
@@ -6698,9 +6704,9 @@ var init_utils = __esm({
|
|
6698
6704
|
);
|
6699
6705
|
return result;
|
6700
6706
|
};
|
6701
|
-
prepareMigrationFolder = (outFolder = "drizzle",
|
6702
|
-
const { snapshots, journal } = prepareOutFolder(outFolder,
|
6703
|
-
const report = validateWithReport(snapshots,
|
6707
|
+
prepareMigrationFolder = (outFolder = "drizzle", dialect4) => {
|
6708
|
+
const { snapshots, journal } = prepareOutFolder(outFolder, dialect4);
|
6709
|
+
const report = validateWithReport(snapshots, dialect4);
|
6704
6710
|
if (report.nonLatest.length > 0) {
|
6705
6711
|
console.log(
|
6706
6712
|
report.nonLatest.map((it) => {
|
@@ -11250,7 +11256,7 @@ var init_outputs = __esm({
|
|
11250
11256
|
});
|
11251
11257
|
|
11252
11258
|
// src/cli/validations/common.ts
|
11253
|
-
var assertCollisions, sqliteDriversLiterals, postgresqlDriversLiterals, prefixes, prefix, sqliteDriver, postgresDriver, driver, configMigrations, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema, drivers, wrapParam;
|
11259
|
+
var assertCollisions, sqliteDriversLiterals, postgresqlDriversLiterals, prefixes, prefix, casingTypes, casingType, sqliteDriver, postgresDriver, driver, configMigrations, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema, drivers, wrapParam;
|
11254
11260
|
var init_common = __esm({
|
11255
11261
|
"src/cli/validations/common.ts"() {
|
11256
11262
|
"use strict";
|
@@ -11294,6 +11300,8 @@ var init_common = __esm({
|
|
11294
11300
|
{
|
11295
11301
|
const _2 = "";
|
11296
11302
|
}
|
11303
|
+
casingTypes = ["snake_case", "camelCase"];
|
11304
|
+
casingType = enumType(casingTypes);
|
11297
11305
|
sqliteDriver = unionType(sqliteDriversLiterals);
|
11298
11306
|
postgresDriver = unionType(postgresqlDriversLiterals);
|
11299
11307
|
driver = unionType([sqliteDriver, postgresDriver]);
|
@@ -11312,7 +11320,8 @@ var init_common = __esm({
|
|
11312
11320
|
tablesFilter: unionType([stringType(), stringType().array()]).optional(),
|
11313
11321
|
schemaFilter: unionType([stringType(), stringType().array()]).default(["public"]),
|
11314
11322
|
migrations: configMigrations,
|
11315
|
-
dbCredentials: anyType().optional()
|
11323
|
+
dbCredentials: anyType().optional(),
|
11324
|
+
casing: casingType.optional()
|
11316
11325
|
}).passthrough();
|
11317
11326
|
casing = unionType([literalType("camel"), literalType("preserve")]).default(
|
11318
11327
|
"camel"
|
@@ -11394,6 +11403,7 @@ var init_cli = __esm({
|
|
11394
11403
|
}).strict();
|
11395
11404
|
pushParams = objectType({
|
11396
11405
|
dialect: dialect3,
|
11406
|
+
casing: casingType.optional(),
|
11397
11407
|
schema: unionType([stringType(), stringType().array()]),
|
11398
11408
|
tablesFilter: unionType([stringType(), stringType().array()]).optional(),
|
11399
11409
|
schemaFilter: unionType([stringType(), stringType().array()]).optional().default(["public"]),
|
@@ -17410,11 +17420,11 @@ var init_utils4 = __esm({
|
|
17410
17420
|
prepareGenerateConfig = async (options, from) => {
|
17411
17421
|
var _a;
|
17412
17422
|
const config = from === "config" ? await drizzleConfigFromFile(options.config) : options;
|
17413
|
-
const { schema: schema5, out, breakpoints, dialect:
|
17414
|
-
if (!schema5 || !
|
17423
|
+
const { schema: schema5, out, breakpoints, dialect: dialect4, driver: driver2, casing: casing2 } = config;
|
17424
|
+
if (!schema5 || !dialect4) {
|
17415
17425
|
console.log(error("Please provide required params:"));
|
17416
17426
|
console.log(wrapParam("schema", schema5));
|
17417
|
-
console.log(wrapParam("dialect",
|
17427
|
+
console.log(wrapParam("dialect", dialect4));
|
17418
17428
|
console.log(wrapParam("out", out, true));
|
17419
17429
|
process.exit(1);
|
17420
17430
|
}
|
@@ -17425,14 +17435,15 @@ var init_utils4 = __esm({
|
|
17425
17435
|
}
|
17426
17436
|
const prefix2 = ("migrations" in config ? (_a = config.migrations) == null ? void 0 : _a.prefix : options.prefix) || "index";
|
17427
17437
|
return {
|
17428
|
-
dialect:
|
17438
|
+
dialect: dialect4,
|
17429
17439
|
name: options.name,
|
17430
17440
|
custom: options.custom || false,
|
17431
17441
|
prefix: prefix2,
|
17432
17442
|
breakpoints: breakpoints || true,
|
17433
17443
|
schema: schema5,
|
17434
17444
|
out: out || "drizzle",
|
17435
|
-
bundle: driver2 === "expo"
|
17445
|
+
bundle: driver2 === "expo",
|
17446
|
+
casing: casing2
|
17436
17447
|
};
|
17437
17448
|
};
|
17438
17449
|
flattenDatabaseCredentials = (config) => {
|
@@ -17499,6 +17510,7 @@ var init_utils4 = __esm({
|
|
17499
17510
|
verbose: config.verbose ?? false,
|
17500
17511
|
force: options.force ?? false,
|
17501
17512
|
credentials: parsed2.data,
|
17513
|
+
casing: config.casing,
|
17502
17514
|
tablesFilter,
|
17503
17515
|
schemasFilter
|
17504
17516
|
};
|
@@ -17516,6 +17528,7 @@ var init_utils4 = __esm({
|
|
17516
17528
|
verbose: config.verbose ?? false,
|
17517
17529
|
force: options.force ?? false,
|
17518
17530
|
credentials: parsed2.data,
|
17531
|
+
casing: config.casing,
|
17519
17532
|
tablesFilter,
|
17520
17533
|
schemasFilter
|
17521
17534
|
};
|
@@ -17533,6 +17546,7 @@ var init_utils4 = __esm({
|
|
17533
17546
|
verbose: config.verbose ?? false,
|
17534
17547
|
force: options.force ?? false,
|
17535
17548
|
credentials: parsed2.data,
|
17549
|
+
casing: config.casing,
|
17536
17550
|
tablesFilter,
|
17537
17551
|
schemasFilter
|
17538
17552
|
};
|
@@ -17550,6 +17564,7 @@ var init_utils4 = __esm({
|
|
17550
17564
|
verbose: config.verbose ?? false,
|
17551
17565
|
force: options.force ?? false,
|
17552
17566
|
credentials: parsed2.data,
|
17567
|
+
casing: config.casing,
|
17553
17568
|
tablesFilter,
|
17554
17569
|
schemasFilter
|
17555
17570
|
};
|
@@ -17568,11 +17583,11 @@ var init_utils4 = __esm({
|
|
17568
17583
|
process.exit(1);
|
17569
17584
|
}
|
17570
17585
|
const config = parsed.data;
|
17571
|
-
const
|
17586
|
+
const dialect4 = config.dialect;
|
17572
17587
|
const tablesFilterConfig = config.tablesFilter;
|
17573
17588
|
const tablesFilter = tablesFilterConfig ? typeof tablesFilterConfig === "string" ? [tablesFilterConfig] : tablesFilterConfig : [];
|
17574
17589
|
if (config.extensionsFilters) {
|
17575
|
-
if (config.extensionsFilters.includes("postgis") &&
|
17590
|
+
if (config.extensionsFilters.includes("postgis") && dialect4 === "postgresql") {
|
17576
17591
|
tablesFilter.push(
|
17577
17592
|
...["!geography_columns", "!geometry_columns", "!spatial_ref_sys"]
|
17578
17593
|
);
|
@@ -17580,7 +17595,7 @@ var init_utils4 = __esm({
|
|
17580
17595
|
}
|
17581
17596
|
const schemasFilterConfig = config.schemaFilter;
|
17582
17597
|
const schemasFilter = schemasFilterConfig ? typeof schemasFilterConfig === "string" ? [schemasFilterConfig] : schemasFilterConfig : [];
|
17583
|
-
if (
|
17598
|
+
if (dialect4 === "postgresql") {
|
17584
17599
|
const parsed2 = postgresCredentials.safeParse(config);
|
17585
17600
|
if (!parsed2.success) {
|
17586
17601
|
printConfigConnectionIssues3(config);
|
@@ -17597,7 +17612,7 @@ var init_utils4 = __esm({
|
|
17597
17612
|
prefix: ((_a = config.migrations) == null ? void 0 : _a.prefix) || "index"
|
17598
17613
|
};
|
17599
17614
|
}
|
17600
|
-
if (
|
17615
|
+
if (dialect4 === "mysql") {
|
17601
17616
|
const parsed2 = mysqlCredentials.safeParse(config);
|
17602
17617
|
if (!parsed2.success) {
|
17603
17618
|
printConfigConnectionIssues2(config);
|
@@ -17614,7 +17629,7 @@ var init_utils4 = __esm({
|
|
17614
17629
|
prefix: ((_b = config.migrations) == null ? void 0 : _b.prefix) || "index"
|
17615
17630
|
};
|
17616
17631
|
}
|
17617
|
-
if (
|
17632
|
+
if (dialect4 === "sqlite") {
|
17618
17633
|
const parsed2 = sqliteCredentials.safeParse(config);
|
17619
17634
|
if (!parsed2.success) {
|
17620
17635
|
printConfigConnectionIssues4(config, "pull");
|
@@ -17631,14 +17646,14 @@ var init_utils4 = __esm({
|
|
17631
17646
|
prefix: ((_c = config.migrations) == null ? void 0 : _c.prefix) || "index"
|
17632
17647
|
};
|
17633
17648
|
}
|
17634
|
-
if (
|
17649
|
+
if (dialect4 === "turso") {
|
17635
17650
|
const parsed2 = libSQLCredentials.safeParse(config);
|
17636
17651
|
if (!parsed2.success) {
|
17637
17652
|
printConfigConnectionIssues(config, "pull");
|
17638
17653
|
process.exit(1);
|
17639
17654
|
}
|
17640
17655
|
return {
|
17641
|
-
dialect:
|
17656
|
+
dialect: dialect4,
|
17642
17657
|
out: config.out,
|
17643
17658
|
breakpoints: config.breakpoints,
|
17644
17659
|
casing: config.casing,
|
@@ -17648,7 +17663,7 @@ var init_utils4 = __esm({
|
|
17648
17663
|
prefix: ((_d = config.migrations) == null ? void 0 : _d.prefix) || "index"
|
17649
17664
|
};
|
17650
17665
|
}
|
17651
|
-
assertUnreachable(
|
17666
|
+
assertUnreachable(dialect4);
|
17652
17667
|
};
|
17653
17668
|
prepareStudioConfig = async (options) => {
|
17654
17669
|
const params = studioCliParams.parse(options);
|
@@ -17665,9 +17680,9 @@ var init_utils4 = __esm({
|
|
17665
17680
|
process.exit(1);
|
17666
17681
|
}
|
17667
17682
|
const { host, port } = params;
|
17668
|
-
const { dialect:
|
17683
|
+
const { dialect: dialect4, schema: schema5 } = result.data;
|
17669
17684
|
const flattened = flattenDatabaseCredentials(config);
|
17670
|
-
if (
|
17685
|
+
if (dialect4 === "postgresql") {
|
17671
17686
|
const parsed = postgresCredentials.safeParse(flattened);
|
17672
17687
|
if (!parsed.success) {
|
17673
17688
|
printConfigConnectionIssues3(flattened);
|
@@ -17675,14 +17690,14 @@ var init_utils4 = __esm({
|
|
17675
17690
|
}
|
17676
17691
|
const credentials2 = parsed.data;
|
17677
17692
|
return {
|
17678
|
-
dialect:
|
17693
|
+
dialect: dialect4,
|
17679
17694
|
schema: schema5,
|
17680
17695
|
host,
|
17681
17696
|
port,
|
17682
17697
|
credentials: credentials2
|
17683
17698
|
};
|
17684
17699
|
}
|
17685
|
-
if (
|
17700
|
+
if (dialect4 === "mysql") {
|
17686
17701
|
const parsed = mysqlCredentials.safeParse(flattened);
|
17687
17702
|
if (!parsed.success) {
|
17688
17703
|
printConfigConnectionIssues2(flattened);
|
@@ -17690,14 +17705,14 @@ var init_utils4 = __esm({
|
|
17690
17705
|
}
|
17691
17706
|
const credentials2 = parsed.data;
|
17692
17707
|
return {
|
17693
|
-
dialect:
|
17708
|
+
dialect: dialect4,
|
17694
17709
|
schema: schema5,
|
17695
17710
|
host,
|
17696
17711
|
port,
|
17697
17712
|
credentials: credentials2
|
17698
17713
|
};
|
17699
17714
|
}
|
17700
|
-
if (
|
17715
|
+
if (dialect4 === "sqlite") {
|
17701
17716
|
const parsed = sqliteCredentials.safeParse(flattened);
|
17702
17717
|
if (!parsed.success) {
|
17703
17718
|
printConfigConnectionIssues4(flattened, "studio");
|
@@ -17705,14 +17720,14 @@ var init_utils4 = __esm({
|
|
17705
17720
|
}
|
17706
17721
|
const credentials2 = parsed.data;
|
17707
17722
|
return {
|
17708
|
-
dialect:
|
17723
|
+
dialect: dialect4,
|
17709
17724
|
schema: schema5,
|
17710
17725
|
host,
|
17711
17726
|
port,
|
17712
17727
|
credentials: credentials2
|
17713
17728
|
};
|
17714
17729
|
}
|
17715
|
-
if (
|
17730
|
+
if (dialect4 === "turso") {
|
17716
17731
|
const parsed = libSQLCredentials.safeParse(flattened);
|
17717
17732
|
if (!parsed.success) {
|
17718
17733
|
printConfigConnectionIssues(flattened, "studio");
|
@@ -17720,14 +17735,14 @@ var init_utils4 = __esm({
|
|
17720
17735
|
}
|
17721
17736
|
const credentials2 = parsed.data;
|
17722
17737
|
return {
|
17723
|
-
dialect:
|
17738
|
+
dialect: dialect4,
|
17724
17739
|
schema: schema5,
|
17725
17740
|
host,
|
17726
17741
|
port,
|
17727
17742
|
credentials: credentials2
|
17728
17743
|
};
|
17729
17744
|
}
|
17730
|
-
assertUnreachable(
|
17745
|
+
assertUnreachable(dialect4);
|
17731
17746
|
};
|
17732
17747
|
migrateConfig = objectType({
|
17733
17748
|
dialect: dialect3,
|
@@ -17742,10 +17757,10 @@ var init_utils4 = __esm({
|
|
17742
17757
|
console.log(wrapParam("dialect", config.dialect));
|
17743
17758
|
process.exit(1);
|
17744
17759
|
}
|
17745
|
-
const { dialect:
|
17760
|
+
const { dialect: dialect4, out } = parsed.data;
|
17746
17761
|
const { schema: schema5, table: table4 } = parsed.data.migrations || {};
|
17747
17762
|
const flattened = flattenDatabaseCredentials(config);
|
17748
|
-
if (
|
17763
|
+
if (dialect4 === "postgresql") {
|
17749
17764
|
const parsed2 = postgresCredentials.safeParse(flattened);
|
17750
17765
|
if (!parsed2.success) {
|
17751
17766
|
printConfigConnectionIssues3(flattened);
|
@@ -17753,14 +17768,14 @@ var init_utils4 = __esm({
|
|
17753
17768
|
}
|
17754
17769
|
const credentials2 = parsed2.data;
|
17755
17770
|
return {
|
17756
|
-
dialect:
|
17771
|
+
dialect: dialect4,
|
17757
17772
|
out,
|
17758
17773
|
credentials: credentials2,
|
17759
17774
|
schema: schema5,
|
17760
17775
|
table: table4
|
17761
17776
|
};
|
17762
17777
|
}
|
17763
|
-
if (
|
17778
|
+
if (dialect4 === "mysql") {
|
17764
17779
|
const parsed2 = mysqlCredentials.safeParse(flattened);
|
17765
17780
|
if (!parsed2.success) {
|
17766
17781
|
printConfigConnectionIssues2(flattened);
|
@@ -17768,14 +17783,14 @@ var init_utils4 = __esm({
|
|
17768
17783
|
}
|
17769
17784
|
const credentials2 = parsed2.data;
|
17770
17785
|
return {
|
17771
|
-
dialect:
|
17786
|
+
dialect: dialect4,
|
17772
17787
|
out,
|
17773
17788
|
credentials: credentials2,
|
17774
17789
|
schema: schema5,
|
17775
17790
|
table: table4
|
17776
17791
|
};
|
17777
17792
|
}
|
17778
|
-
if (
|
17793
|
+
if (dialect4 === "sqlite") {
|
17779
17794
|
const parsed2 = sqliteCredentials.safeParse(flattened);
|
17780
17795
|
if (!parsed2.success) {
|
17781
17796
|
printConfigConnectionIssues4(flattened, "migrate");
|
@@ -17783,14 +17798,14 @@ var init_utils4 = __esm({
|
|
17783
17798
|
}
|
17784
17799
|
const credentials2 = parsed2.data;
|
17785
17800
|
return {
|
17786
|
-
dialect:
|
17801
|
+
dialect: dialect4,
|
17787
17802
|
out,
|
17788
17803
|
credentials: credentials2,
|
17789
17804
|
schema: schema5,
|
17790
17805
|
table: table4
|
17791
17806
|
};
|
17792
17807
|
}
|
17793
|
-
if (
|
17808
|
+
if (dialect4 === "turso") {
|
17794
17809
|
const parsed2 = libSQLCredentials.safeParse(flattened);
|
17795
17810
|
if (!parsed2.success) {
|
17796
17811
|
printConfigConnectionIssues(flattened, "migrate");
|
@@ -17798,14 +17813,14 @@ var init_utils4 = __esm({
|
|
17798
17813
|
}
|
17799
17814
|
const credentials2 = parsed2.data;
|
17800
17815
|
return {
|
17801
|
-
dialect:
|
17816
|
+
dialect: dialect4,
|
17802
17817
|
out,
|
17803
17818
|
credentials: credentials2,
|
17804
17819
|
schema: schema5,
|
17805
17820
|
table: table4
|
17806
17821
|
};
|
17807
17822
|
}
|
17808
|
-
assertUnreachable(
|
17823
|
+
assertUnreachable(dialect4);
|
17809
17824
|
};
|
17810
17825
|
drizzleConfigFromFile = async (configPath) => {
|
17811
17826
|
const prefix2 = process.env.TEST_CONFIG_PATH_PREFIX || "";
|
@@ -17834,6 +17849,7 @@ var init_utils4 = __esm({
|
|
17834
17849
|
unregister();
|
17835
17850
|
const res = configCommonSchema.safeParse(content);
|
17836
17851
|
if (!res.success) {
|
17852
|
+
console.log(res.error);
|
17837
17853
|
if (!("dialect" in content)) {
|
17838
17854
|
console.log(error("Please specify 'dialect' param in config file"));
|
17839
17855
|
}
|
@@ -17906,7 +17922,7 @@ function clearDefaults(defaultValue, collate) {
|
|
17906
17922
|
return `(${resultDefault})`;
|
17907
17923
|
}
|
17908
17924
|
}
|
17909
|
-
var import_drizzle_orm2, import_drizzle_orm3, import_mysql_core2, import_mysql_core3,
|
17925
|
+
var import_drizzle_orm2, import_drizzle_orm3, import_mysql_core2, import_mysql_core3, indexName, generateMySqlSnapshot, fromDatabase;
|
17910
17926
|
var init_mysqlSerializer = __esm({
|
17911
17927
|
"src/serializer/mysqlSerializer.ts"() {
|
17912
17928
|
"use strict";
|
@@ -17916,12 +17932,13 @@ var init_mysqlSerializer = __esm({
|
|
17916
17932
|
import_mysql_core2 = require("drizzle-orm/mysql-core");
|
17917
17933
|
import_mysql_core3 = require("drizzle-orm/mysql-core");
|
17918
17934
|
init_outputs();
|
17935
|
+
init_utils();
|
17919
17936
|
init_serializer();
|
17920
|
-
dialect4 = new import_mysql_core2.MySqlDialect();
|
17921
17937
|
indexName = (tableName, columns) => {
|
17922
17938
|
return `${tableName}_${columns.join("_")}_index`;
|
17923
17939
|
};
|
17924
|
-
generateMySqlSnapshot = (tables) => {
|
17940
|
+
generateMySqlSnapshot = (tables, casing2) => {
|
17941
|
+
const dialect4 = new import_mysql_core2.MySqlDialect({ casing: casing2 });
|
17925
17942
|
const result = {};
|
17926
17943
|
const internal = { tables: {}, indexes: {} };
|
17927
17944
|
for (const table4 of tables) {
|
@@ -17940,12 +17957,13 @@ var init_mysqlSerializer = __esm({
|
|
17940
17957
|
const primaryKeysObject = {};
|
17941
17958
|
const uniqueConstraintObject = {};
|
17942
17959
|
columns.forEach((column7) => {
|
17960
|
+
const name = getColumnCasing(column7, casing2);
|
17943
17961
|
const notNull = column7.notNull;
|
17944
17962
|
const sqlTypeLowered = column7.getSQLType().toLowerCase();
|
17945
17963
|
const autoIncrement = typeof column7.autoIncrement === "undefined" ? false : column7.autoIncrement;
|
17946
17964
|
const generated = column7.generated;
|
17947
17965
|
const columnToSet = {
|
17948
|
-
name
|
17966
|
+
name,
|
17949
17967
|
type: column7.getSQLType(),
|
17950
17968
|
primaryKey: false,
|
17951
17969
|
// If field is autoincrement it's notNull by default
|
@@ -17959,9 +17977,9 @@ var init_mysqlSerializer = __esm({
|
|
17959
17977
|
} : void 0
|
17960
17978
|
};
|
17961
17979
|
if (column7.primary) {
|
17962
|
-
primaryKeysObject[`${tableName}_${
|
17963
|
-
name: `${tableName}_${
|
17964
|
-
columns: [
|
17980
|
+
primaryKeysObject[`${tableName}_${name}`] = {
|
17981
|
+
name: `${tableName}_${name}`,
|
17982
|
+
columns: [name]
|
17965
17983
|
};
|
17966
17984
|
}
|
17967
17985
|
if (column7.isUnique) {
|
@@ -17975,7 +17993,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
17975
17993
|
The unique constraint ${source_default.underline.blue(
|
17976
17994
|
column7.uniqueName
|
17977
17995
|
)} on the ${source_default.underline.blue(
|
17978
|
-
|
17996
|
+
name
|
17979
17997
|
)} column is confilcting with a unique constraint name already defined for ${source_default.underline.blue(
|
17980
17998
|
existingUnique.columns.join(",")
|
17981
17999
|
)} columns
|
@@ -17990,7 +18008,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
17990
18008
|
}
|
17991
18009
|
if (column7.default !== void 0) {
|
17992
18010
|
if ((0, import_drizzle_orm2.is)(column7.default, import_drizzle_orm3.SQL)) {
|
17993
|
-
columnToSet.default = sqlToStr(column7.default);
|
18011
|
+
columnToSet.default = sqlToStr(column7.default, casing2);
|
17994
18012
|
} else {
|
17995
18013
|
if (typeof column7.default === "string") {
|
17996
18014
|
columnToSet.default = `'${column7.default}'`;
|
@@ -18012,20 +18030,27 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
18012
18030
|
}
|
18013
18031
|
}
|
18014
18032
|
}
|
18015
|
-
columnsObject[
|
18033
|
+
columnsObject[name] = columnToSet;
|
18016
18034
|
});
|
18017
18035
|
primaryKeys.map((pk) => {
|
18018
|
-
const
|
18019
|
-
|
18020
|
-
|
18036
|
+
const originalColumnNames = pk.columns.map((c) => c.name);
|
18037
|
+
const columnNames = pk.columns.map((c) => getColumnCasing(c, casing2));
|
18038
|
+
let name = pk.getName();
|
18039
|
+
if (casing2 !== void 0) {
|
18040
|
+
for (let i2 = 0; i2 < originalColumnNames.length; i2++) {
|
18041
|
+
name = name.replace(originalColumnNames[i2], columnNames[i2]);
|
18042
|
+
}
|
18043
|
+
}
|
18044
|
+
primaryKeysObject[name] = {
|
18045
|
+
name,
|
18021
18046
|
columns: columnNames
|
18022
18047
|
};
|
18023
18048
|
for (const column7 of pk.columns) {
|
18024
|
-
columnsObject[column7
|
18049
|
+
columnsObject[getColumnCasing(column7, casing2)].notNull = true;
|
18025
18050
|
}
|
18026
18051
|
});
|
18027
18052
|
uniqueConstraints == null ? void 0 : uniqueConstraints.map((unq) => {
|
18028
|
-
const columnNames = unq.columns.map((c) => c
|
18053
|
+
const columnNames = unq.columns.map((c) => getColumnCasing(c, casing2));
|
18029
18054
|
const name = unq.name ?? (0, import_mysql_core2.uniqueKeyName)(table4, columnNames);
|
18030
18055
|
const existingUnique = uniqueConstraintObject[name];
|
18031
18056
|
if (typeof existingUnique !== "undefined") {
|
@@ -18053,15 +18078,25 @@ The unique constraint ${source_default.underline.blue(
|
|
18053
18078
|
};
|
18054
18079
|
});
|
18055
18080
|
const fks = foreignKeys.map((fk4) => {
|
18056
|
-
const name = fk4.getName();
|
18057
18081
|
const tableFrom = tableName;
|
18058
18082
|
const onDelete = fk4.onDelete ?? "no action";
|
18059
18083
|
const onUpdate = fk4.onUpdate ?? "no action";
|
18060
18084
|
const reference = fk4.reference();
|
18061
18085
|
const referenceFT = reference.foreignTable;
|
18062
18086
|
const tableTo = (0, import_drizzle_orm2.getTableName)(referenceFT);
|
18063
|
-
const
|
18064
|
-
const
|
18087
|
+
const originalColumnsFrom = reference.columns.map((it) => it.name);
|
18088
|
+
const columnsFrom = reference.columns.map((it) => getColumnCasing(it, casing2));
|
18089
|
+
const originalColumnsTo = reference.foreignColumns.map((it) => it.name);
|
18090
|
+
const columnsTo = reference.foreignColumns.map((it) => getColumnCasing(it, casing2));
|
18091
|
+
let name = fk4.getName();
|
18092
|
+
if (casing2 !== void 0) {
|
18093
|
+
for (let i2 = 0; i2 < originalColumnsFrom.length; i2++) {
|
18094
|
+
name = name.replace(originalColumnsFrom[i2], columnsFrom[i2]);
|
18095
|
+
}
|
18096
|
+
for (let i2 = 0; i2 < originalColumnsTo.length; i2++) {
|
18097
|
+
name = name.replace(originalColumnsTo[i2], columnsTo[i2]);
|
18098
|
+
}
|
18099
|
+
}
|
18065
18100
|
return {
|
18066
18101
|
name,
|
18067
18102
|
tableFrom,
|
@@ -18101,7 +18136,7 @@ The unique constraint ${source_default.underline.blue(
|
|
18101
18136
|
}
|
18102
18137
|
return sql;
|
18103
18138
|
} else {
|
18104
|
-
return `${it
|
18139
|
+
return `${getColumnCasing(it, casing2)}`;
|
18105
18140
|
}
|
18106
18141
|
});
|
18107
18142
|
if (value.config.unique) {
|
@@ -18546,7 +18581,7 @@ function buildArrayString(array, sqlType) {
|
|
18546
18581
|
}).join(",");
|
18547
18582
|
return `{${values}}`;
|
18548
18583
|
}
|
18549
|
-
var import_drizzle_orm5, import_pg_core2, import_pg_core3,
|
18584
|
+
var import_drizzle_orm5, import_pg_core2, import_pg_core3, indexName2, generatePgSnapshot, trimChar, fromDatabase2, defaultForColumn;
|
18550
18585
|
var init_pgSerializer = __esm({
|
18551
18586
|
"src/serializer/pgSerializer.ts"() {
|
18552
18587
|
"use strict";
|
@@ -18558,12 +18593,12 @@ var init_pgSerializer = __esm({
|
|
18558
18593
|
init_outputs();
|
18559
18594
|
init_utils();
|
18560
18595
|
init_serializer();
|
18561
|
-
dialect5 = new import_pg_core2.PgDialect();
|
18562
18596
|
indexName2 = (tableName, columns) => {
|
18563
18597
|
return `${tableName}_${columns.join("_")}_index`;
|
18564
18598
|
};
|
18565
|
-
generatePgSnapshot = (tables, enums, schemas, sequences, schemaFilter) => {
|
18599
|
+
generatePgSnapshot = (tables, enums, schemas, sequences, casing2, schemaFilter) => {
|
18566
18600
|
var _a, _b, _c, _d, _e, _f;
|
18601
|
+
const dialect4 = new import_pg_core2.PgDialect({ casing: casing2 });
|
18567
18602
|
const result = {};
|
18568
18603
|
const sequencesToReturn = {};
|
18569
18604
|
const indexesInSchema = {};
|
@@ -18588,6 +18623,7 @@ var init_pgSerializer = __esm({
|
|
18588
18623
|
const uniqueConstraintObject = {};
|
18589
18624
|
columns.forEach((column7) => {
|
18590
18625
|
var _a2, _b2, _c2, _d2, _e2, _f2;
|
18626
|
+
const name = getColumnCasing(column7, casing2);
|
18591
18627
|
const notNull = column7.notNull;
|
18592
18628
|
const primaryKey = column7.primary;
|
18593
18629
|
const sqlTypeLowered = column7.getSQLType().toLowerCase();
|
@@ -18600,18 +18636,18 @@ var init_pgSerializer = __esm({
|
|
18600
18636
|
const startWith = stringFromIdentityProperty((_d2 = identity == null ? void 0 : identity.sequenceOptions) == null ? void 0 : _d2.startWith) ?? (parseFloat(increment) < 0 ? maxValue : minValue);
|
18601
18637
|
const cache = stringFromIdentityProperty((_e2 = identity == null ? void 0 : identity.sequenceOptions) == null ? void 0 : _e2.cache) ?? "1";
|
18602
18638
|
const columnToSet = {
|
18603
|
-
name
|
18639
|
+
name,
|
18604
18640
|
type: column7.getSQLType(),
|
18605
18641
|
typeSchema,
|
18606
18642
|
primaryKey,
|
18607
18643
|
notNull,
|
18608
18644
|
generated: generated ? {
|
18609
|
-
as: (0, import_drizzle_orm5.is)(generated.as, import_drizzle_orm5.SQL) ?
|
18645
|
+
as: (0, import_drizzle_orm5.is)(generated.as, import_drizzle_orm5.SQL) ? dialect4.sqlToQuery(generated.as).sql : typeof generated.as === "function" ? dialect4.sqlToQuery(generated.as()).sql : generated.as,
|
18610
18646
|
type: "stored"
|
18611
18647
|
} : void 0,
|
18612
18648
|
identity: identity ? {
|
18613
18649
|
type: identity.type,
|
18614
|
-
name: identity.sequenceName ?? `${tableName}_${
|
18650
|
+
name: identity.sequenceName ?? `${tableName}_${name}_seq`,
|
18615
18651
|
schema: schema5 ?? "public",
|
18616
18652
|
increment,
|
18617
18653
|
startWith,
|
@@ -18632,7 +18668,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
18632
18668
|
The unique constraint ${source_default.underline.blue(
|
18633
18669
|
column7.uniqueName
|
18634
18670
|
)} on the ${source_default.underline.blue(
|
18635
|
-
|
18671
|
+
name
|
18636
18672
|
)} column is confilcting with a unique constraint name already defined for ${source_default.underline.blue(
|
18637
18673
|
existingUnique.columns.join(",")
|
18638
18674
|
)} columns
|
@@ -18648,7 +18684,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
18648
18684
|
}
|
18649
18685
|
if (column7.default !== void 0) {
|
18650
18686
|
if ((0, import_drizzle_orm5.is)(column7.default, import_drizzle_orm5.SQL)) {
|
18651
|
-
columnToSet.default = sqlToStr(column7.default);
|
18687
|
+
columnToSet.default = sqlToStr(column7.default, casing2);
|
18652
18688
|
} else {
|
18653
18689
|
if (typeof column7.default === "string") {
|
18654
18690
|
columnToSet.default = `'${column7.default}'`;
|
@@ -18676,17 +18712,24 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
18676
18712
|
}
|
18677
18713
|
}
|
18678
18714
|
}
|
18679
|
-
columnsObject[
|
18715
|
+
columnsObject[name] = columnToSet;
|
18680
18716
|
});
|
18681
18717
|
primaryKeys.map((pk) => {
|
18682
|
-
const
|
18683
|
-
|
18684
|
-
|
18718
|
+
const originalColumnNames = pk.columns.map((c) => c.name);
|
18719
|
+
const columnNames = pk.columns.map((c) => getColumnCasing(c, casing2));
|
18720
|
+
let name = pk.getName();
|
18721
|
+
if (casing2 !== void 0) {
|
18722
|
+
for (let i2 = 0; i2 < originalColumnNames.length; i2++) {
|
18723
|
+
name = name.replace(originalColumnNames[i2], columnNames[i2]);
|
18724
|
+
}
|
18725
|
+
}
|
18726
|
+
primaryKeysObject[name] = {
|
18727
|
+
name,
|
18685
18728
|
columns: columnNames
|
18686
18729
|
};
|
18687
18730
|
});
|
18688
18731
|
uniqueConstraints == null ? void 0 : uniqueConstraints.map((unq) => {
|
18689
|
-
const columnNames = unq.columns.map((c) => c
|
18732
|
+
const columnNames = unq.columns.map((c) => getColumnCasing(c, casing2));
|
18690
18733
|
const name = unq.name ?? (0, import_pg_core2.uniqueKeyName)(table4, columnNames);
|
18691
18734
|
const existingUnique = uniqueConstraintObject[name];
|
18692
18735
|
if (typeof existingUnique !== "undefined") {
|
@@ -18713,15 +18756,25 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
18713
18756
|
};
|
18714
18757
|
});
|
18715
18758
|
const fks = foreignKeys.map((fk4) => {
|
18716
|
-
const name = fk4.getName();
|
18717
18759
|
const tableFrom = tableName;
|
18718
18760
|
const onDelete = fk4.onDelete;
|
18719
18761
|
const onUpdate = fk4.onUpdate;
|
18720
18762
|
const reference = fk4.reference();
|
18721
18763
|
const tableTo = (0, import_drizzle_orm5.getTableName)(reference.foreignTable);
|
18722
18764
|
const schemaTo = (0, import_pg_core3.getTableConfig)(reference.foreignTable).schema;
|
18723
|
-
const
|
18724
|
-
const
|
18765
|
+
const originalColumnsFrom = reference.columns.map((it) => it.name);
|
18766
|
+
const columnsFrom = reference.columns.map((it) => getColumnCasing(it, casing2));
|
18767
|
+
const originalColumnsTo = reference.foreignColumns.map((it) => it.name);
|
18768
|
+
const columnsTo = reference.foreignColumns.map((it) => getColumnCasing(it, casing2));
|
18769
|
+
let name = fk4.getName();
|
18770
|
+
if (casing2 !== void 0) {
|
18771
|
+
for (let i2 = 0; i2 < originalColumnsFrom.length; i2++) {
|
18772
|
+
name = name.replace(originalColumnsFrom[i2], columnsFrom[i2]);
|
18773
|
+
}
|
18774
|
+
for (let i2 = 0; i2 < originalColumnsTo.length; i2++) {
|
18775
|
+
name = name.replace(originalColumnsTo[i2], columnsTo[i2]);
|
18776
|
+
}
|
18777
|
+
}
|
18725
18778
|
return {
|
18726
18779
|
name,
|
18727
18780
|
tableFrom,
|
@@ -18747,19 +18800,20 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
18747
18800
|
${withStyle.errorWarning(
|
18748
18801
|
`Please specify an index name in ${(0, import_drizzle_orm5.getTableName)(
|
18749
18802
|
value.config.table
|
18750
|
-
)} table that has "${
|
18803
|
+
)} table that has "${dialect4.sqlToQuery(it).sql}" expression. We can generate index names for indexes on columns only; for expressions in indexes, you need to specify the name yourself.`
|
18751
18804
|
)}`
|
18752
18805
|
);
|
18753
18806
|
process.exit(1);
|
18754
18807
|
}
|
18755
18808
|
}
|
18756
18809
|
it = it;
|
18810
|
+
const name2 = getColumnCasing(it, casing2);
|
18757
18811
|
if (!(0, import_drizzle_orm5.is)(it, import_drizzle_orm5.SQL) && it.type === "PgVector" && typeof it.indexConfig.opClass === "undefined") {
|
18758
18812
|
console.log(
|
18759
18813
|
`
|
18760
18814
|
${withStyle.errorWarning(
|
18761
18815
|
`You are specifying an index on the ${source_default.blueBright(
|
18762
|
-
|
18816
|
+
name2
|
18763
18817
|
)} column inside the ${source_default.blueBright(
|
18764
18818
|
tableName
|
18765
18819
|
)} table with the ${source_default.blueBright(
|
@@ -18769,7 +18823,7 @@ ${withStyle.errorWarning(
|
|
18769
18823
|
)}].
|
18770
18824
|
|
18771
18825
|
You can specify it using current syntax: ${source_default.underline(
|
18772
|
-
`index("${value.config.name}").using("${value.config.method}", table.${
|
18826
|
+
`index("${value.config.name}").using("${value.config.method}", table.${name2}.op("${vectorOps[0]}"))`
|
18773
18827
|
)}
|
18774
18828
|
|
18775
18829
|
You can check the "pg_vector" docs for more info: https://github.com/pgvector/pgvector?tab=readme-ov-file#indexing
|
@@ -18778,7 +18832,7 @@ You can check the "pg_vector" docs for more info: https://github.com/pgvector/pg
|
|
18778
18832
|
);
|
18779
18833
|
process.exit(1);
|
18780
18834
|
}
|
18781
|
-
indexColumnNames.push(
|
18835
|
+
indexColumnNames.push(name2);
|
18782
18836
|
});
|
18783
18837
|
const name = value.config.name ? value.config.name : indexName2(tableName, indexColumnNames);
|
18784
18838
|
let indexColumns = columns2.map(
|
@@ -18786,7 +18840,7 @@ You can check the "pg_vector" docs for more info: https://github.com/pgvector/pg
|
|
18786
18840
|
var _a2, _b2, _c2, _d2, _e2;
|
18787
18841
|
if ((0, import_drizzle_orm5.is)(it, import_drizzle_orm5.SQL)) {
|
18788
18842
|
return {
|
18789
|
-
expression:
|
18843
|
+
expression: dialect4.sqlToQuery(it, "indexes").sql,
|
18790
18844
|
asc: true,
|
18791
18845
|
isExpression: true,
|
18792
18846
|
nulls: "last"
|
@@ -18794,7 +18848,7 @@ You can check the "pg_vector" docs for more info: https://github.com/pgvector/pg
|
|
18794
18848
|
} else {
|
18795
18849
|
it = it;
|
18796
18850
|
return {
|
18797
|
-
expression: it
|
18851
|
+
expression: getColumnCasing(it, casing2),
|
18798
18852
|
isExpression: false,
|
18799
18853
|
asc: ((_a2 = it.indexConfig) == null ? void 0 : _a2.order) === "asc",
|
18800
18854
|
nulls: ((_b2 = it.indexConfig) == null ? void 0 : _b2.nulls) ? (_c2 = it.indexConfig) == null ? void 0 : _c2.nulls : ((_d2 = it.indexConfig) == null ? void 0 : _d2.order) === "desc" ? "first" : "last",
|
@@ -18825,7 +18879,7 @@ ${withStyle.errorWarning(
|
|
18825
18879
|
name,
|
18826
18880
|
columns: indexColumns,
|
18827
18881
|
isUnique: value.config.unique ?? false,
|
18828
|
-
where: value.config.where ?
|
18882
|
+
where: value.config.where ? dialect4.sqlToQuery(value.config.where).sql : void 0,
|
18829
18883
|
concurrently: value.config.concurrently ?? false,
|
18830
18884
|
method: value.config.method ?? "btree",
|
18831
18885
|
with: value.config.with ?? {}
|
@@ -19263,7 +19317,7 @@ ${withStyle.errorWarning(
|
|
19263
19317
|
schema: tableSchema
|
19264
19318
|
} : void 0
|
19265
19319
|
};
|
19266
|
-
if (identityName) {
|
19320
|
+
if (identityName && typeof identityName === "string") {
|
19267
19321
|
delete sequencesToReturn[`${tableSchema}.${identityName.startsWith('"') && identityName.endsWith('"') ? identityName.slice(1, -1) : identityName}`];
|
19268
19322
|
delete sequencesToReturn[identityName];
|
19269
19323
|
}
|
@@ -19594,7 +19648,7 @@ function extractGeneratedColumns(input) {
|
|
19594
19648
|
}
|
19595
19649
|
return columns;
|
19596
19650
|
}
|
19597
|
-
var import_drizzle_orm7, import_sqlite_core2,
|
19651
|
+
var import_drizzle_orm7, import_sqlite_core2, generateSqliteSnapshot, fromDatabase3;
|
19598
19652
|
var init_sqliteSerializer = __esm({
|
19599
19653
|
"src/serializer/sqliteSerializer.ts"() {
|
19600
19654
|
"use strict";
|
@@ -19602,9 +19656,10 @@ var init_sqliteSerializer = __esm({
|
|
19602
19656
|
import_drizzle_orm7 = require("drizzle-orm");
|
19603
19657
|
import_sqlite_core2 = require("drizzle-orm/sqlite-core");
|
19604
19658
|
init_outputs();
|
19659
|
+
init_utils();
|
19605
19660
|
init_serializer();
|
19606
|
-
|
19607
|
-
|
19661
|
+
generateSqliteSnapshot = (tables, casing2) => {
|
19662
|
+
const dialect4 = new import_sqlite_core2.SQLiteSyncDialect({ casing: casing2 });
|
19608
19663
|
const result = {};
|
19609
19664
|
const internal = { indexes: {} };
|
19610
19665
|
for (const table4 of tables) {
|
@@ -19622,28 +19677,29 @@ var init_sqliteSerializer = __esm({
|
|
19622
19677
|
uniqueConstraints
|
19623
19678
|
} = (0, import_sqlite_core2.getTableConfig)(table4);
|
19624
19679
|
columns.forEach((column7) => {
|
19680
|
+
const name = getColumnCasing(column7, casing2);
|
19625
19681
|
const notNull = column7.notNull;
|
19626
19682
|
const primaryKey = column7.primary;
|
19627
19683
|
const generated = column7.generated;
|
19628
19684
|
const columnToSet = {
|
19629
|
-
name
|
19685
|
+
name,
|
19630
19686
|
type: column7.getSQLType(),
|
19631
19687
|
primaryKey,
|
19632
19688
|
notNull,
|
19633
19689
|
autoincrement: (0, import_drizzle_orm7.is)(column7, import_sqlite_core2.SQLiteBaseInteger) ? column7.autoIncrement : false,
|
19634
19690
|
generated: generated ? {
|
19635
|
-
as: (0, import_drizzle_orm7.is)(generated.as, import_drizzle_orm7.SQL) ? `(${
|
19691
|
+
as: (0, import_drizzle_orm7.is)(generated.as, import_drizzle_orm7.SQL) ? `(${dialect4.sqlToQuery(generated.as, "indexes").sql})` : typeof generated.as === "function" ? `(${dialect4.sqlToQuery(generated.as(), "indexes").sql})` : `(${generated.as})`,
|
19636
19692
|
type: generated.mode ?? "virtual"
|
19637
19693
|
} : void 0
|
19638
19694
|
};
|
19639
19695
|
if (column7.default !== void 0) {
|
19640
19696
|
if ((0, import_drizzle_orm7.is)(column7.default, import_drizzle_orm7.SQL)) {
|
19641
|
-
columnToSet.default = sqlToStr(column7.default);
|
19697
|
+
columnToSet.default = sqlToStr(column7.default, casing2);
|
19642
19698
|
} else {
|
19643
19699
|
columnToSet.default = typeof column7.default === "string" ? `'${column7.default}'` : typeof column7.default === "object" || Array.isArray(column7.default) ? `'${JSON.stringify(column7.default)}'` : column7.default;
|
19644
19700
|
}
|
19645
19701
|
}
|
19646
|
-
columnsObject[
|
19702
|
+
columnsObject[name] = columnToSet;
|
19647
19703
|
if (column7.isUnique) {
|
19648
19704
|
const existingUnique = indexesObject[column7.uniqueName];
|
19649
19705
|
if (typeof existingUnique !== "undefined") {
|
@@ -19655,7 +19711,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
19655
19711
|
The unique constraint ${source_default.underline.blue(
|
19656
19712
|
column7.uniqueName
|
19657
19713
|
)} on the ${source_default.underline.blue(
|
19658
|
-
|
19714
|
+
name
|
19659
19715
|
)} column is confilcting with a unique constraint name already defined for ${source_default.underline.blue(
|
19660
19716
|
existingUnique.columns.join(",")
|
19661
19717
|
)} columns
|
@@ -19671,15 +19727,25 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
19671
19727
|
}
|
19672
19728
|
});
|
19673
19729
|
const foreignKeys = tableForeignKeys.map((fk4) => {
|
19674
|
-
const name = fk4.getName();
|
19675
19730
|
const tableFrom = tableName;
|
19676
19731
|
const onDelete = fk4.onDelete ?? "no action";
|
19677
19732
|
const onUpdate = fk4.onUpdate ?? "no action";
|
19678
19733
|
const reference = fk4.reference();
|
19679
19734
|
const referenceFT = reference.foreignTable;
|
19680
19735
|
const tableTo = (0, import_drizzle_orm7.getTableName)(referenceFT);
|
19681
|
-
const
|
19682
|
-
const
|
19736
|
+
const originalColumnsFrom = reference.columns.map((it) => it.name);
|
19737
|
+
const columnsFrom = reference.columns.map((it) => getColumnCasing(it, casing2));
|
19738
|
+
const originalColumnsTo = reference.foreignColumns.map((it) => it.name);
|
19739
|
+
const columnsTo = reference.foreignColumns.map((it) => getColumnCasing(it, casing2));
|
19740
|
+
let name = fk4.getName();
|
19741
|
+
if (casing2 !== void 0) {
|
19742
|
+
for (let i2 = 0; i2 < originalColumnsFrom.length; i2++) {
|
19743
|
+
name = name.replace(originalColumnsFrom[i2], columnsFrom[i2]);
|
19744
|
+
}
|
19745
|
+
for (let i2 = 0; i2 < originalColumnsTo.length; i2++) {
|
19746
|
+
name = name.replace(originalColumnsTo[i2], columnsTo[i2]);
|
19747
|
+
}
|
19748
|
+
}
|
19683
19749
|
return {
|
19684
19750
|
name,
|
19685
19751
|
tableFrom,
|
@@ -19699,7 +19765,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
19699
19765
|
let indexColumns = columns2.map((it) => {
|
19700
19766
|
var _a;
|
19701
19767
|
if ((0, import_drizzle_orm7.is)(it, import_drizzle_orm7.SQL)) {
|
19702
|
-
const sql =
|
19768
|
+
const sql = dialect4.sqlToQuery(it, "indexes").sql;
|
19703
19769
|
if (typeof internal.indexes[name] === "undefined") {
|
19704
19770
|
internal.indexes[name] = {
|
19705
19771
|
columns: {
|
@@ -19719,13 +19785,13 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
19719
19785
|
}
|
19720
19786
|
return sql;
|
19721
19787
|
} else {
|
19722
|
-
return it
|
19788
|
+
return getColumnCasing(it, casing2);
|
19723
19789
|
}
|
19724
19790
|
});
|
19725
19791
|
let where = void 0;
|
19726
19792
|
if (value.config.where !== void 0) {
|
19727
19793
|
if ((0, import_drizzle_orm7.is)(value.config.where, import_drizzle_orm7.SQL)) {
|
19728
|
-
where =
|
19794
|
+
where = dialect4.sqlToQuery(value.config.where).sql;
|
19729
19795
|
}
|
19730
19796
|
}
|
19731
19797
|
indexesObject[name] = {
|
@@ -19736,7 +19802,7 @@ ${withStyle.errorWarning(`We've found duplicated unique constraint names in ${so
|
|
19736
19802
|
};
|
19737
19803
|
});
|
19738
19804
|
uniqueConstraints == null ? void 0 : uniqueConstraints.map((unq) => {
|
19739
|
-
const columnNames = unq.columns.map((c) => c
|
19805
|
+
const columnNames = unq.columns.map((c) => getColumnCasing(c, casing2));
|
19740
19806
|
const name = unq.name ?? (0, import_sqlite_core2.uniqueKeyName)(table4, columnNames);
|
19741
19807
|
const existingUnique = indexesObject[name];
|
19742
19808
|
if (typeof existingUnique !== "undefined") {
|
@@ -19766,12 +19832,20 @@ The unique constraint ${source_default.underline.blue(
|
|
19766
19832
|
});
|
19767
19833
|
primaryKeys.forEach((it) => {
|
19768
19834
|
if (it.columns.length > 1) {
|
19769
|
-
|
19770
|
-
|
19771
|
-
|
19835
|
+
const originalColumnNames = it.columns.map((c) => c.name);
|
19836
|
+
const columnNames = it.columns.map((c) => getColumnCasing(c, casing2));
|
19837
|
+
let name = it.getName();
|
19838
|
+
if (casing2 !== void 0) {
|
19839
|
+
for (let i2 = 0; i2 < originalColumnNames.length; i2++) {
|
19840
|
+
name = name.replace(originalColumnNames[i2], columnNames[i2]);
|
19841
|
+
}
|
19842
|
+
}
|
19843
|
+
primaryKeysObject[name] = {
|
19844
|
+
columns: columnNames,
|
19845
|
+
name
|
19772
19846
|
};
|
19773
19847
|
} else {
|
19774
|
-
columnsObject[it.columns[0]
|
19848
|
+
columnsObject[getColumnCasing(it.columns[0], casing2)].primaryKey = true;
|
19775
19849
|
}
|
19776
19850
|
});
|
19777
19851
|
result[tableName] = {
|
@@ -20016,16 +20090,17 @@ WHERE
|
|
20016
20090
|
});
|
20017
20091
|
|
20018
20092
|
// src/serializer/index.ts
|
20019
|
-
var import_fs3, glob, import_path3, sqlToStr, serializeMySql, serializePg, serializeSQLite, prepareFilenames;
|
20093
|
+
var import_casing2, import_fs3, glob, import_path3, sqlToStr, serializeMySql, serializePg, serializeSQLite, prepareFilenames;
|
20020
20094
|
var init_serializer = __esm({
|
20021
20095
|
"src/serializer/index.ts"() {
|
20022
20096
|
"use strict";
|
20023
20097
|
init_source();
|
20098
|
+
import_casing2 = require("drizzle-orm/casing");
|
20024
20099
|
import_fs3 = __toESM(require("fs"));
|
20025
20100
|
glob = __toESM(require_glob());
|
20026
20101
|
import_path3 = __toESM(require("path"));
|
20027
20102
|
init_views();
|
20028
|
-
sqlToStr = (sql) => {
|
20103
|
+
sqlToStr = (sql, casing2) => {
|
20029
20104
|
return sql.toQuery({
|
20030
20105
|
escapeName: () => {
|
20031
20106
|
throw new Error("we don't support params for `sql` default values");
|
@@ -20035,10 +20110,11 @@ var init_serializer = __esm({
|
|
20035
20110
|
},
|
20036
20111
|
escapeString: () => {
|
20037
20112
|
throw new Error("we don't support params for `sql` default values");
|
20038
|
-
}
|
20113
|
+
},
|
20114
|
+
casing: new import_casing2.CasingCache(casing2)
|
20039
20115
|
}).sql;
|
20040
20116
|
};
|
20041
|
-
serializeMySql = async (path5) => {
|
20117
|
+
serializeMySql = async (path5, casing2) => {
|
20042
20118
|
const filenames = prepareFilenames(path5);
|
20043
20119
|
console.log(source_default.gray(`Reading schema files:
|
20044
20120
|
${filenames.join("\n")}
|
@@ -20046,23 +20122,23 @@ ${filenames.join("\n")}
|
|
20046
20122
|
const { prepareFromMySqlImports: prepareFromMySqlImports2 } = await Promise.resolve().then(() => (init_mysqlImports(), mysqlImports_exports));
|
20047
20123
|
const { generateMySqlSnapshot: generateMySqlSnapshot2 } = await Promise.resolve().then(() => (init_mysqlSerializer(), mysqlSerializer_exports));
|
20048
20124
|
const { tables } = await prepareFromMySqlImports2(filenames);
|
20049
|
-
return generateMySqlSnapshot2(tables);
|
20125
|
+
return generateMySqlSnapshot2(tables, casing2);
|
20050
20126
|
};
|
20051
|
-
serializePg = async (path5, schemaFilter) => {
|
20127
|
+
serializePg = async (path5, casing2, schemaFilter) => {
|
20052
20128
|
const filenames = prepareFilenames(path5);
|
20053
20129
|
const { prepareFromPgImports: prepareFromPgImports2 } = await Promise.resolve().then(() => (init_pgImports(), pgImports_exports));
|
20054
20130
|
const { generatePgSnapshot: generatePgSnapshot2 } = await Promise.resolve().then(() => (init_pgSerializer(), pgSerializer_exports));
|
20055
20131
|
const { tables, enums, schemas, sequences } = await prepareFromPgImports2(
|
20056
20132
|
filenames
|
20057
20133
|
);
|
20058
|
-
return generatePgSnapshot2(tables, enums, schemas, sequences, schemaFilter);
|
20134
|
+
return generatePgSnapshot2(tables, enums, schemas, sequences, casing2, schemaFilter);
|
20059
20135
|
};
|
20060
|
-
serializeSQLite = async (path5) => {
|
20136
|
+
serializeSQLite = async (path5, casing2) => {
|
20061
20137
|
const filenames = prepareFilenames(path5);
|
20062
20138
|
const { prepareFromSqliteImports: prepareFromSqliteImports2 } = await Promise.resolve().then(() => (init_sqliteImports(), sqliteImports_exports));
|
20063
20139
|
const { generateSqliteSnapshot: generateSqliteSnapshot2 } = await Promise.resolve().then(() => (init_sqliteSerializer(), sqliteSerializer_exports));
|
20064
20140
|
const { tables } = await prepareFromSqliteImports2(filenames);
|
20065
|
-
return generateSqliteSnapshot2(tables);
|
20141
|
+
return generateSqliteSnapshot2(tables, casing2);
|
20066
20142
|
};
|
20067
20143
|
prepareFilenames = (path5) => {
|
20068
20144
|
if (typeof path5 === "string") {
|
@@ -20111,45 +20187,45 @@ var init_migrationPreparator = __esm({
|
|
20111
20187
|
init_mysqlSchema();
|
20112
20188
|
init_pgSchema();
|
20113
20189
|
init_sqliteSchema();
|
20114
|
-
prepareMySqlDbPushSnapshot = async (prev, schemaPath) => {
|
20115
|
-
const serialized = await serializeMySql(schemaPath);
|
20190
|
+
prepareMySqlDbPushSnapshot = async (prev, schemaPath, casing2) => {
|
20191
|
+
const serialized = await serializeMySql(schemaPath, casing2);
|
20116
20192
|
const id = (0, import_crypto.randomUUID)();
|
20117
20193
|
const idPrev = prev.id;
|
20118
|
-
const { version: version3, dialect:
|
20119
|
-
const result = { version: version3, dialect:
|
20194
|
+
const { version: version3, dialect: dialect4, ...rest } = serialized;
|
20195
|
+
const result = { version: version3, dialect: dialect4, id, prevId: idPrev, ...rest };
|
20120
20196
|
return { prev, cur: result };
|
20121
20197
|
};
|
20122
|
-
prepareSQLiteDbPushSnapshot = async (prev, schemaPath) => {
|
20123
|
-
const serialized = await serializeSQLite(schemaPath);
|
20198
|
+
prepareSQLiteDbPushSnapshot = async (prev, schemaPath, casing2) => {
|
20199
|
+
const serialized = await serializeSQLite(schemaPath, casing2);
|
20124
20200
|
const id = (0, import_crypto.randomUUID)();
|
20125
20201
|
const idPrev = prev.id;
|
20126
|
-
const { version: version3, dialect:
|
20202
|
+
const { version: version3, dialect: dialect4, ...rest } = serialized;
|
20127
20203
|
const result = {
|
20128
20204
|
version: version3,
|
20129
|
-
dialect:
|
20205
|
+
dialect: dialect4,
|
20130
20206
|
id,
|
20131
20207
|
prevId: idPrev,
|
20132
20208
|
...rest
|
20133
20209
|
};
|
20134
20210
|
return { prev, cur: result };
|
20135
20211
|
};
|
20136
|
-
preparePgDbPushSnapshot = async (prev, schemaPath, schemaFilter = ["public"]) => {
|
20137
|
-
const serialized = await serializePg(schemaPath, schemaFilter);
|
20212
|
+
preparePgDbPushSnapshot = async (prev, schemaPath, casing2, schemaFilter = ["public"]) => {
|
20213
|
+
const serialized = await serializePg(schemaPath, casing2, schemaFilter);
|
20138
20214
|
const id = (0, import_crypto.randomUUID)();
|
20139
20215
|
const idPrev = prev.id;
|
20140
|
-
const { version: version3, dialect:
|
20141
|
-
const result = { version: version3, dialect:
|
20216
|
+
const { version: version3, dialect: dialect4, ...rest } = serialized;
|
20217
|
+
const result = { version: version3, dialect: dialect4, id, prevId: idPrev, ...rest };
|
20142
20218
|
return { prev, cur: result };
|
20143
20219
|
};
|
20144
|
-
prepareMySqlMigrationSnapshot = async (migrationFolders, schemaPath) => {
|
20220
|
+
prepareMySqlMigrationSnapshot = async (migrationFolders, schemaPath, casing2) => {
|
20145
20221
|
const prevSnapshot = mysqlSchema.parse(
|
20146
20222
|
preparePrevSnapshot(migrationFolders, dryMySql)
|
20147
20223
|
);
|
20148
|
-
const serialized = await serializeMySql(schemaPath);
|
20224
|
+
const serialized = await serializeMySql(schemaPath, casing2);
|
20149
20225
|
const id = (0, import_crypto.randomUUID)();
|
20150
20226
|
const idPrev = prevSnapshot.id;
|
20151
|
-
const { version: version3, dialect:
|
20152
|
-
const result = { version: version3, dialect:
|
20227
|
+
const { version: version3, dialect: dialect4, ...rest } = serialized;
|
20228
|
+
const result = { version: version3, dialect: dialect4, id, prevId: idPrev, ...rest };
|
20153
20229
|
const { id: _ignoredId, prevId: _ignoredPrevId, ...prevRest } = prevSnapshot;
|
20154
20230
|
const custom2 = {
|
20155
20231
|
id,
|
@@ -20158,17 +20234,17 @@ var init_migrationPreparator = __esm({
|
|
20158
20234
|
};
|
20159
20235
|
return { prev: prevSnapshot, cur: result, custom: custom2 };
|
20160
20236
|
};
|
20161
|
-
prepareSqliteMigrationSnapshot = async (snapshots, schemaPath) => {
|
20237
|
+
prepareSqliteMigrationSnapshot = async (snapshots, schemaPath, casing2) => {
|
20162
20238
|
const prevSnapshot = sqliteSchema.parse(
|
20163
20239
|
preparePrevSnapshot(snapshots, drySQLite)
|
20164
20240
|
);
|
20165
|
-
const serialized = await serializeSQLite(schemaPath);
|
20241
|
+
const serialized = await serializeSQLite(schemaPath, casing2);
|
20166
20242
|
const id = (0, import_crypto.randomUUID)();
|
20167
20243
|
const idPrev = prevSnapshot.id;
|
20168
|
-
const { version: version3, dialect:
|
20244
|
+
const { version: version3, dialect: dialect4, ...rest } = serialized;
|
20169
20245
|
const result = {
|
20170
20246
|
version: version3,
|
20171
|
-
dialect:
|
20247
|
+
dialect: dialect4,
|
20172
20248
|
id,
|
20173
20249
|
prevId: idPrev,
|
20174
20250
|
...rest
|
@@ -20188,9 +20264,9 @@ var init_migrationPreparator = __esm({
|
|
20188
20264
|
}) => {
|
20189
20265
|
return { id, prevId: idPrev, ...serialized };
|
20190
20266
|
};
|
20191
|
-
preparePgMigrationSnapshot = async (snapshots, schemaPath) => {
|
20267
|
+
preparePgMigrationSnapshot = async (snapshots, schemaPath, casing2) => {
|
20192
20268
|
const prevSnapshot = pgSchema.parse(preparePrevSnapshot(snapshots, dryPg));
|
20193
|
-
const serialized = await serializePg(schemaPath);
|
20269
|
+
const serialized = await serializePg(schemaPath, casing2);
|
20194
20270
|
const id = (0, import_crypto.randomUUID)();
|
20195
20271
|
const idPrev = prevSnapshot.id;
|
20196
20272
|
const result = { id, prevId: idPrev, ...serialized };
|
@@ -23016,10 +23092,10 @@ var init_jsonDiffer = __esm({
|
|
23016
23092
|
});
|
23017
23093
|
|
23018
23094
|
// src/sqlgenerator.ts
|
23019
|
-
function fromJson(statements,
|
23095
|
+
function fromJson(statements, dialect4, action, json2) {
|
23020
23096
|
const result = statements.flatMap((statement) => {
|
23021
23097
|
const filtered = convertors.filter((it) => {
|
23022
|
-
return it.can(statement,
|
23098
|
+
return it.can(statement, dialect4);
|
23023
23099
|
});
|
23024
23100
|
const convertor = filtered.length === 1 ? filtered[0] : void 0;
|
23025
23101
|
if (!convertor) {
|
@@ -23029,7 +23105,7 @@ function fromJson(statements, dialect7, action, json2) {
|
|
23029
23105
|
}).filter((it) => it !== "");
|
23030
23106
|
return result;
|
23031
23107
|
}
|
23032
|
-
var pgNativeTypes, isPgNativeType, Convertor, PgCreateTableConvertor, MySqlCreateTableConvertor, SQLiteCreateTableConvertor, PgAlterTableAlterColumnSetGenerated, PgAlterTableAlterColumnDropGenerated, PgAlterTableAlterColumnAlterGenerated, PgAlterTableAddUniqueConstraintConvertor, PgAlterTableDropUniqueConstraintConvertor, MySQLAlterTableAddUniqueConstraintConvertor, MySQLAlterTableDropUniqueConstraintConvertor, CreatePgSequenceConvertor, DropPgSequenceConvertor, RenamePgSequenceConvertor, MovePgSequenceConvertor, AlterPgSequenceConvertor, CreateTypeEnumConvertor, AlterTypeAddValueConvertor, 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;
|
23108
|
+
var pgNativeTypes, isPgNativeType, Convertor, PgCreateTableConvertor, MySqlCreateTableConvertor, SQLiteCreateTableConvertor, PgAlterTableAlterColumnSetGenerated, PgAlterTableAlterColumnDropGenerated, PgAlterTableAlterColumnAlterGenerated, PgAlterTableAddUniqueConstraintConvertor, PgAlterTableDropUniqueConstraintConvertor, MySQLAlterTableAddUniqueConstraintConvertor, MySQLAlterTableDropUniqueConstraintConvertor, 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;
|
23033
23109
|
var init_sqlgenerator = __esm({
|
23034
23110
|
"src/sqlgenerator.ts"() {
|
23035
23111
|
"use strict";
|
@@ -23087,8 +23163,8 @@ var init_sqlgenerator = __esm({
|
|
23087
23163
|
Convertor = class {
|
23088
23164
|
};
|
23089
23165
|
PgCreateTableConvertor = class extends Convertor {
|
23090
|
-
can(statement,
|
23091
|
-
return statement.type === "create_table" &&
|
23166
|
+
can(statement, dialect4) {
|
23167
|
+
return statement.type === "create_table" && dialect4 === "postgresql";
|
23092
23168
|
}
|
23093
23169
|
convert(st) {
|
23094
23170
|
const { tableName, schema: schema5, columns, compositePKs, uniqueConstraints } = st;
|
@@ -23132,8 +23208,8 @@ var init_sqlgenerator = __esm({
|
|
23132
23208
|
}
|
23133
23209
|
};
|
23134
23210
|
MySqlCreateTableConvertor = class extends Convertor {
|
23135
|
-
can(statement,
|
23136
|
-
return statement.type === "create_table" &&
|
23211
|
+
can(statement, dialect4) {
|
23212
|
+
return statement.type === "create_table" && dialect4 === "mysql";
|
23137
23213
|
}
|
23138
23214
|
convert(st) {
|
23139
23215
|
var _a, _b;
|
@@ -23183,8 +23259,8 @@ var init_sqlgenerator = __esm({
|
|
23183
23259
|
}
|
23184
23260
|
};
|
23185
23261
|
SQLiteCreateTableConvertor = class extends Convertor {
|
23186
|
-
can(statement,
|
23187
|
-
return statement.type === "sqlite_create_table" && (
|
23262
|
+
can(statement, dialect4) {
|
23263
|
+
return statement.type === "sqlite_create_table" && (dialect4 === "sqlite" || dialect4 === "turso");
|
23188
23264
|
}
|
23189
23265
|
convert(st) {
|
23190
23266
|
const {
|
@@ -23246,8 +23322,8 @@ var init_sqlgenerator = __esm({
|
|
23246
23322
|
}
|
23247
23323
|
};
|
23248
23324
|
PgAlterTableAlterColumnSetGenerated = class extends Convertor {
|
23249
|
-
can(statement,
|
23250
|
-
return statement.type === "alter_table_alter_column_set_identity" &&
|
23325
|
+
can(statement, dialect4) {
|
23326
|
+
return statement.type === "alter_table_alter_column_set_identity" && dialect4 === "postgresql";
|
23251
23327
|
}
|
23252
23328
|
convert(statement) {
|
23253
23329
|
const { identity, tableName, columnName, schema: schema5 } = statement;
|
@@ -23259,8 +23335,8 @@ var init_sqlgenerator = __esm({
|
|
23259
23335
|
}
|
23260
23336
|
};
|
23261
23337
|
PgAlterTableAlterColumnDropGenerated = class extends Convertor {
|
23262
|
-
can(statement,
|
23263
|
-
return statement.type === "alter_table_alter_column_drop_identity" &&
|
23338
|
+
can(statement, dialect4) {
|
23339
|
+
return statement.type === "alter_table_alter_column_drop_identity" && dialect4 === "postgresql";
|
23264
23340
|
}
|
23265
23341
|
convert(statement) {
|
23266
23342
|
const { tableName, columnName, schema: schema5 } = statement;
|
@@ -23269,8 +23345,8 @@ var init_sqlgenerator = __esm({
|
|
23269
23345
|
}
|
23270
23346
|
};
|
23271
23347
|
PgAlterTableAlterColumnAlterGenerated = class extends Convertor {
|
23272
|
-
can(statement,
|
23273
|
-
return statement.type === "alter_table_alter_column_change_identity" &&
|
23348
|
+
can(statement, dialect4) {
|
23349
|
+
return statement.type === "alter_table_alter_column_change_identity" && dialect4 === "postgresql";
|
23274
23350
|
}
|
23275
23351
|
convert(statement) {
|
23276
23352
|
const { identity, oldIdentity, tableName, columnName, schema: schema5 } = statement;
|
@@ -23317,8 +23393,8 @@ var init_sqlgenerator = __esm({
|
|
23317
23393
|
}
|
23318
23394
|
};
|
23319
23395
|
PgAlterTableAddUniqueConstraintConvertor = class extends Convertor {
|
23320
|
-
can(statement,
|
23321
|
-
return statement.type === "create_unique_constraint" &&
|
23396
|
+
can(statement, dialect4) {
|
23397
|
+
return statement.type === "create_unique_constraint" && dialect4 === "postgresql";
|
23322
23398
|
}
|
23323
23399
|
convert(statement) {
|
23324
23400
|
const unsquashed = PgSquasher.unsquashUnique(statement.data);
|
@@ -23327,8 +23403,8 @@ var init_sqlgenerator = __esm({
|
|
23327
23403
|
}
|
23328
23404
|
};
|
23329
23405
|
PgAlterTableDropUniqueConstraintConvertor = class extends Convertor {
|
23330
|
-
can(statement,
|
23331
|
-
return statement.type === "delete_unique_constraint" &&
|
23406
|
+
can(statement, dialect4) {
|
23407
|
+
return statement.type === "delete_unique_constraint" && dialect4 === "postgresql";
|
23332
23408
|
}
|
23333
23409
|
convert(statement) {
|
23334
23410
|
const unsquashed = PgSquasher.unsquashUnique(statement.data);
|
@@ -23337,8 +23413,8 @@ var init_sqlgenerator = __esm({
|
|
23337
23413
|
}
|
23338
23414
|
};
|
23339
23415
|
MySQLAlterTableAddUniqueConstraintConvertor = class extends Convertor {
|
23340
|
-
can(statement,
|
23341
|
-
return statement.type === "create_unique_constraint" &&
|
23416
|
+
can(statement, dialect4) {
|
23417
|
+
return statement.type === "create_unique_constraint" && dialect4 === "mysql";
|
23342
23418
|
}
|
23343
23419
|
convert(statement) {
|
23344
23420
|
const unsquashed = MySqlSquasher.unsquashUnique(statement.data);
|
@@ -23346,8 +23422,8 @@ var init_sqlgenerator = __esm({
|
|
23346
23422
|
}
|
23347
23423
|
};
|
23348
23424
|
MySQLAlterTableDropUniqueConstraintConvertor = class extends Convertor {
|
23349
|
-
can(statement,
|
23350
|
-
return statement.type === "delete_unique_constraint" &&
|
23425
|
+
can(statement, dialect4) {
|
23426
|
+
return statement.type === "delete_unique_constraint" && dialect4 === "mysql";
|
23351
23427
|
}
|
23352
23428
|
convert(statement) {
|
23353
23429
|
const unsquashed = MySqlSquasher.unsquashUnique(statement.data);
|
@@ -23355,8 +23431,8 @@ var init_sqlgenerator = __esm({
|
|
23355
23431
|
}
|
23356
23432
|
};
|
23357
23433
|
CreatePgSequenceConvertor = class extends Convertor {
|
23358
|
-
can(statement,
|
23359
|
-
return statement.type === "create_sequence" &&
|
23434
|
+
can(statement, dialect4) {
|
23435
|
+
return statement.type === "create_sequence" && dialect4 === "postgresql";
|
23360
23436
|
}
|
23361
23437
|
convert(st) {
|
23362
23438
|
const { name, values, schema: schema5 } = st;
|
@@ -23365,8 +23441,8 @@ var init_sqlgenerator = __esm({
|
|
23365
23441
|
}
|
23366
23442
|
};
|
23367
23443
|
DropPgSequenceConvertor = class extends Convertor {
|
23368
|
-
can(statement,
|
23369
|
-
return statement.type === "drop_sequence" &&
|
23444
|
+
can(statement, dialect4) {
|
23445
|
+
return statement.type === "drop_sequence" && dialect4 === "postgresql";
|
23370
23446
|
}
|
23371
23447
|
convert(st) {
|
23372
23448
|
const { name, schema: schema5 } = st;
|
@@ -23375,8 +23451,8 @@ var init_sqlgenerator = __esm({
|
|
23375
23451
|
}
|
23376
23452
|
};
|
23377
23453
|
RenamePgSequenceConvertor = class extends Convertor {
|
23378
|
-
can(statement,
|
23379
|
-
return statement.type === "rename_sequence" &&
|
23454
|
+
can(statement, dialect4) {
|
23455
|
+
return statement.type === "rename_sequence" && dialect4 === "postgresql";
|
23380
23456
|
}
|
23381
23457
|
convert(st) {
|
23382
23458
|
const { nameFrom, nameTo, schema: schema5 } = st;
|
@@ -23386,8 +23462,8 @@ var init_sqlgenerator = __esm({
|
|
23386
23462
|
}
|
23387
23463
|
};
|
23388
23464
|
MovePgSequenceConvertor = class extends Convertor {
|
23389
|
-
can(statement,
|
23390
|
-
return statement.type === "move_sequence" &&
|
23465
|
+
can(statement, dialect4) {
|
23466
|
+
return statement.type === "move_sequence" && dialect4 === "postgresql";
|
23391
23467
|
}
|
23392
23468
|
convert(st) {
|
23393
23469
|
const { schemaFrom, schemaTo, name } = st;
|
@@ -23397,8 +23473,8 @@ var init_sqlgenerator = __esm({
|
|
23397
23473
|
}
|
23398
23474
|
};
|
23399
23475
|
AlterPgSequenceConvertor = class extends Convertor {
|
23400
|
-
can(statement,
|
23401
|
-
return statement.type === "alter_sequence" &&
|
23476
|
+
can(statement, dialect4) {
|
23477
|
+
return statement.type === "alter_sequence" && dialect4 === "postgresql";
|
23402
23478
|
}
|
23403
23479
|
convert(st) {
|
23404
23480
|
const { name, schema: schema5, values } = st;
|
@@ -23413,20 +23489,22 @@ var init_sqlgenerator = __esm({
|
|
23413
23489
|
}
|
23414
23490
|
convert(st) {
|
23415
23491
|
const { name, values, schema: schema5 } = st;
|
23416
|
-
const
|
23492
|
+
const enumNameWithSchema = schema5 ? `"${schema5}"."${name}"` : `"${name}"`;
|
23417
23493
|
let valuesStatement = "(";
|
23418
23494
|
valuesStatement += values.map((it) => `'${it}'`).join(", ");
|
23419
23495
|
valuesStatement += ")";
|
23420
|
-
let statement =
|
23421
|
-
statement
|
23422
|
-
|
23423
|
-
|
23424
|
-
|
23425
|
-
|
23426
|
-
statement
|
23427
|
-
|
23428
|
-
|
23429
|
-
|
23496
|
+
let statement = `CREATE TYPE ${enumNameWithSchema} AS ENUM${valuesStatement};`;
|
23497
|
+
return statement;
|
23498
|
+
}
|
23499
|
+
};
|
23500
|
+
DropTypeEnumConvertor = class extends Convertor {
|
23501
|
+
can(statement) {
|
23502
|
+
return statement.type === "drop_type_enum";
|
23503
|
+
}
|
23504
|
+
convert(st) {
|
23505
|
+
const { name, schema: schema5 } = st;
|
23506
|
+
const enumNameWithSchema = schema5 ? `"${schema5}"."${name}"` : `"${name}"`;
|
23507
|
+
let statement = `DROP TYPE ${enumNameWithSchema};`;
|
23430
23508
|
return statement;
|
23431
23509
|
}
|
23432
23510
|
};
|
@@ -23435,14 +23513,61 @@ var init_sqlgenerator = __esm({
|
|
23435
23513
|
return statement.type === "alter_type_add_value";
|
23436
23514
|
}
|
23437
23515
|
convert(st) {
|
23438
|
-
const { name, schema: schema5, value } = st;
|
23439
|
-
const
|
23440
|
-
return `ALTER TYPE ${
|
23516
|
+
const { name, schema: schema5, value, before } = st;
|
23517
|
+
const enumNameWithSchema = schema5 ? `"${schema5}"."${name}"` : `"${name}"`;
|
23518
|
+
return `ALTER TYPE ${enumNameWithSchema} ADD VALUE '${value}'${before.length ? ` BEFORE '${before}'` : ""};`;
|
23519
|
+
}
|
23520
|
+
};
|
23521
|
+
AlterTypeSetSchemaConvertor = class extends Convertor {
|
23522
|
+
can(statement) {
|
23523
|
+
return statement.type === "move_type_enum";
|
23524
|
+
}
|
23525
|
+
convert(st) {
|
23526
|
+
const { name, schemaFrom, schemaTo } = st;
|
23527
|
+
const enumNameWithSchema = schemaFrom ? `"${schemaFrom}"."${name}"` : `"${name}"`;
|
23528
|
+
return `ALTER TYPE ${enumNameWithSchema} SET SCHEMA "${schemaTo}";`;
|
23529
|
+
}
|
23530
|
+
};
|
23531
|
+
AlterRenameTypeConvertor = class extends Convertor {
|
23532
|
+
can(statement) {
|
23533
|
+
return statement.type === "rename_type_enum";
|
23534
|
+
}
|
23535
|
+
convert(st) {
|
23536
|
+
const { nameTo, nameFrom, schema: schema5 } = st;
|
23537
|
+
const enumNameWithSchema = schema5 ? `"${schema5}"."${nameFrom}"` : `"${nameFrom}"`;
|
23538
|
+
return `ALTER TYPE ${enumNameWithSchema} RENAME TO "${nameTo}";`;
|
23539
|
+
}
|
23540
|
+
};
|
23541
|
+
AlterTypeDropValueConvertor = class extends Convertor {
|
23542
|
+
can(statement) {
|
23543
|
+
return statement.type === "alter_type_drop_value";
|
23544
|
+
}
|
23545
|
+
convert(st) {
|
23546
|
+
const { columnsWithEnum, name, newValues, schema: schema5 } = st;
|
23547
|
+
const statements = [];
|
23548
|
+
for (const withEnum of columnsWithEnum) {
|
23549
|
+
statements.push(
|
23550
|
+
`ALTER TABLE "${withEnum.schema}"."${withEnum.table}" ALTER COLUMN "${withEnum.column}" SET DATA TYPE text;`
|
23551
|
+
);
|
23552
|
+
}
|
23553
|
+
statements.push(new DropTypeEnumConvertor().convert({ name, schema: schema5, type: "drop_type_enum" }));
|
23554
|
+
statements.push(new CreateTypeEnumConvertor().convert({
|
23555
|
+
name,
|
23556
|
+
schema: schema5,
|
23557
|
+
values: newValues,
|
23558
|
+
type: "create_type_enum"
|
23559
|
+
}));
|
23560
|
+
for (const withEnum of columnsWithEnum) {
|
23561
|
+
statements.push(
|
23562
|
+
`ALTER TABLE "${withEnum.schema}"."${withEnum.table}" ALTER COLUMN "${withEnum.column}" SET DATA TYPE "${schema5}"."${name}" USING "${withEnum.column}"::"${schema5}"."${name}";`
|
23563
|
+
);
|
23564
|
+
}
|
23565
|
+
return statements;
|
23441
23566
|
}
|
23442
23567
|
};
|
23443
23568
|
PgDropTableConvertor = class extends Convertor {
|
23444
|
-
can(statement,
|
23445
|
-
return statement.type === "drop_table" &&
|
23569
|
+
can(statement, dialect4) {
|
23570
|
+
return statement.type === "drop_table" && dialect4 === "postgresql";
|
23446
23571
|
}
|
23447
23572
|
convert(statement) {
|
23448
23573
|
const { tableName, schema: schema5 } = statement;
|
@@ -23451,8 +23576,8 @@ var init_sqlgenerator = __esm({
|
|
23451
23576
|
}
|
23452
23577
|
};
|
23453
23578
|
MySQLDropTableConvertor = class extends Convertor {
|
23454
|
-
can(statement,
|
23455
|
-
return statement.type === "drop_table" &&
|
23579
|
+
can(statement, dialect4) {
|
23580
|
+
return statement.type === "drop_table" && dialect4 === "mysql";
|
23456
23581
|
}
|
23457
23582
|
convert(statement) {
|
23458
23583
|
const { tableName } = statement;
|
@@ -23460,8 +23585,8 @@ var init_sqlgenerator = __esm({
|
|
23460
23585
|
}
|
23461
23586
|
};
|
23462
23587
|
SQLiteDropTableConvertor = class extends Convertor {
|
23463
|
-
can(statement,
|
23464
|
-
return statement.type === "drop_table" && (
|
23588
|
+
can(statement, dialect4) {
|
23589
|
+
return statement.type === "drop_table" && (dialect4 === "sqlite" || dialect4 === "turso");
|
23465
23590
|
}
|
23466
23591
|
convert(statement) {
|
23467
23592
|
const { tableName } = statement;
|
@@ -23469,8 +23594,8 @@ var init_sqlgenerator = __esm({
|
|
23469
23594
|
}
|
23470
23595
|
};
|
23471
23596
|
PgRenameTableConvertor = class extends Convertor {
|
23472
|
-
can(statement,
|
23473
|
-
return statement.type === "rename_table" &&
|
23597
|
+
can(statement, dialect4) {
|
23598
|
+
return statement.type === "rename_table" && dialect4 === "postgresql";
|
23474
23599
|
}
|
23475
23600
|
convert(statement) {
|
23476
23601
|
const { tableNameFrom, tableNameTo, toSchema, fromSchema } = statement;
|
@@ -23480,8 +23605,8 @@ var init_sqlgenerator = __esm({
|
|
23480
23605
|
}
|
23481
23606
|
};
|
23482
23607
|
SqliteRenameTableConvertor = class extends Convertor {
|
23483
|
-
can(statement,
|
23484
|
-
return statement.type === "rename_table" && (
|
23608
|
+
can(statement, dialect4) {
|
23609
|
+
return statement.type === "rename_table" && (dialect4 === "sqlite" || dialect4 === "turso");
|
23485
23610
|
}
|
23486
23611
|
convert(statement) {
|
23487
23612
|
const { tableNameFrom, tableNameTo } = statement;
|
@@ -23489,8 +23614,8 @@ var init_sqlgenerator = __esm({
|
|
23489
23614
|
}
|
23490
23615
|
};
|
23491
23616
|
MySqlRenameTableConvertor = class extends Convertor {
|
23492
|
-
can(statement,
|
23493
|
-
return statement.type === "rename_table" &&
|
23617
|
+
can(statement, dialect4) {
|
23618
|
+
return statement.type === "rename_table" && dialect4 === "mysql";
|
23494
23619
|
}
|
23495
23620
|
convert(statement) {
|
23496
23621
|
const { tableNameFrom, tableNameTo } = statement;
|
@@ -23498,8 +23623,8 @@ var init_sqlgenerator = __esm({
|
|
23498
23623
|
}
|
23499
23624
|
};
|
23500
23625
|
PgAlterTableRenameColumnConvertor = class extends Convertor {
|
23501
|
-
can(statement,
|
23502
|
-
return statement.type === "alter_table_rename_column" &&
|
23626
|
+
can(statement, dialect4) {
|
23627
|
+
return statement.type === "alter_table_rename_column" && dialect4 === "postgresql";
|
23503
23628
|
}
|
23504
23629
|
convert(statement) {
|
23505
23630
|
const { tableName, oldColumnName, newColumnName, schema: schema5 } = statement;
|
@@ -23508,8 +23633,8 @@ var init_sqlgenerator = __esm({
|
|
23508
23633
|
}
|
23509
23634
|
};
|
23510
23635
|
MySqlAlterTableRenameColumnConvertor = class extends Convertor {
|
23511
|
-
can(statement,
|
23512
|
-
return statement.type === "alter_table_rename_column" &&
|
23636
|
+
can(statement, dialect4) {
|
23637
|
+
return statement.type === "alter_table_rename_column" && dialect4 === "mysql";
|
23513
23638
|
}
|
23514
23639
|
convert(statement) {
|
23515
23640
|
const { tableName, oldColumnName, newColumnName } = statement;
|
@@ -23517,8 +23642,8 @@ var init_sqlgenerator = __esm({
|
|
23517
23642
|
}
|
23518
23643
|
};
|
23519
23644
|
SQLiteAlterTableRenameColumnConvertor = class extends Convertor {
|
23520
|
-
can(statement,
|
23521
|
-
return statement.type === "alter_table_rename_column" && (
|
23645
|
+
can(statement, dialect4) {
|
23646
|
+
return statement.type === "alter_table_rename_column" && (dialect4 === "sqlite" || dialect4 === "turso");
|
23522
23647
|
}
|
23523
23648
|
convert(statement) {
|
23524
23649
|
const { tableName, oldColumnName, newColumnName } = statement;
|
@@ -23526,8 +23651,8 @@ var init_sqlgenerator = __esm({
|
|
23526
23651
|
}
|
23527
23652
|
};
|
23528
23653
|
PgAlterTableDropColumnConvertor = class extends Convertor {
|
23529
|
-
can(statement,
|
23530
|
-
return statement.type === "alter_table_drop_column" &&
|
23654
|
+
can(statement, dialect4) {
|
23655
|
+
return statement.type === "alter_table_drop_column" && dialect4 === "postgresql";
|
23531
23656
|
}
|
23532
23657
|
convert(statement) {
|
23533
23658
|
const { tableName, columnName, schema: schema5 } = statement;
|
@@ -23536,8 +23661,8 @@ var init_sqlgenerator = __esm({
|
|
23536
23661
|
}
|
23537
23662
|
};
|
23538
23663
|
MySqlAlterTableDropColumnConvertor = class extends Convertor {
|
23539
|
-
can(statement,
|
23540
|
-
return statement.type === "alter_table_drop_column" &&
|
23664
|
+
can(statement, dialect4) {
|
23665
|
+
return statement.type === "alter_table_drop_column" && dialect4 === "mysql";
|
23541
23666
|
}
|
23542
23667
|
convert(statement) {
|
23543
23668
|
const { tableName, columnName } = statement;
|
@@ -23545,8 +23670,8 @@ var init_sqlgenerator = __esm({
|
|
23545
23670
|
}
|
23546
23671
|
};
|
23547
23672
|
SQLiteAlterTableDropColumnConvertor = class extends Convertor {
|
23548
|
-
can(statement,
|
23549
|
-
return statement.type === "alter_table_drop_column" && (
|
23673
|
+
can(statement, dialect4) {
|
23674
|
+
return statement.type === "alter_table_drop_column" && (dialect4 === "sqlite" || dialect4 === "turso");
|
23550
23675
|
}
|
23551
23676
|
convert(statement) {
|
23552
23677
|
const { tableName, columnName } = statement;
|
@@ -23554,8 +23679,8 @@ var init_sqlgenerator = __esm({
|
|
23554
23679
|
}
|
23555
23680
|
};
|
23556
23681
|
PgAlterTableAddColumnConvertor = class extends Convertor {
|
23557
|
-
can(statement,
|
23558
|
-
return statement.type === "alter_table_add_column" &&
|
23682
|
+
can(statement, dialect4) {
|
23683
|
+
return statement.type === "alter_table_add_column" && dialect4 === "postgresql";
|
23559
23684
|
}
|
23560
23685
|
convert(statement) {
|
23561
23686
|
const { tableName, column: column7, schema: schema5 } = statement;
|
@@ -23574,8 +23699,8 @@ var init_sqlgenerator = __esm({
|
|
23574
23699
|
}
|
23575
23700
|
};
|
23576
23701
|
MySqlAlterTableAddColumnConvertor = class extends Convertor {
|
23577
|
-
can(statement,
|
23578
|
-
return statement.type === "alter_table_add_column" &&
|
23702
|
+
can(statement, dialect4) {
|
23703
|
+
return statement.type === "alter_table_add_column" && dialect4 === "mysql";
|
23579
23704
|
}
|
23580
23705
|
convert(statement) {
|
23581
23706
|
const { tableName, column: column7 } = statement;
|
@@ -23598,8 +23723,8 @@ var init_sqlgenerator = __esm({
|
|
23598
23723
|
}
|
23599
23724
|
};
|
23600
23725
|
SQLiteAlterTableAddColumnConvertor = class extends Convertor {
|
23601
|
-
can(statement,
|
23602
|
-
return statement.type === "sqlite_alter_table_add_column" && (
|
23726
|
+
can(statement, dialect4) {
|
23727
|
+
return statement.type === "sqlite_alter_table_add_column" && (dialect4 === "sqlite" || dialect4 === "turso");
|
23603
23728
|
}
|
23604
23729
|
convert(statement) {
|
23605
23730
|
const { tableName, column: column7, referenceData } = statement;
|
@@ -23614,8 +23739,8 @@ var init_sqlgenerator = __esm({
|
|
23614
23739
|
}
|
23615
23740
|
};
|
23616
23741
|
PgAlterTableAlterColumnSetTypeConvertor = class extends Convertor {
|
23617
|
-
can(statement,
|
23618
|
-
return statement.type === "alter_table_alter_column_set_type" &&
|
23742
|
+
can(statement, dialect4) {
|
23743
|
+
return statement.type === "alter_table_alter_column_set_type" && dialect4 === "postgresql";
|
23619
23744
|
}
|
23620
23745
|
convert(statement) {
|
23621
23746
|
const { tableName, columnName, newDataType, schema: schema5 } = statement;
|
@@ -23624,8 +23749,8 @@ var init_sqlgenerator = __esm({
|
|
23624
23749
|
}
|
23625
23750
|
};
|
23626
23751
|
PgAlterTableAlterColumnSetDefaultConvertor = class extends Convertor {
|
23627
|
-
can(statement,
|
23628
|
-
return statement.type === "alter_table_alter_column_set_default" &&
|
23752
|
+
can(statement, dialect4) {
|
23753
|
+
return statement.type === "alter_table_alter_column_set_default" && dialect4 === "postgresql";
|
23629
23754
|
}
|
23630
23755
|
convert(statement) {
|
23631
23756
|
const { tableName, columnName, schema: schema5 } = statement;
|
@@ -23634,8 +23759,8 @@ var init_sqlgenerator = __esm({
|
|
23634
23759
|
}
|
23635
23760
|
};
|
23636
23761
|
PgAlterTableAlterColumnDropDefaultConvertor = class extends Convertor {
|
23637
|
-
can(statement,
|
23638
|
-
return statement.type === "alter_table_alter_column_drop_default" &&
|
23762
|
+
can(statement, dialect4) {
|
23763
|
+
return statement.type === "alter_table_alter_column_drop_default" && dialect4 === "postgresql";
|
23639
23764
|
}
|
23640
23765
|
convert(statement) {
|
23641
23766
|
const { tableName, columnName, schema: schema5 } = statement;
|
@@ -23644,8 +23769,8 @@ var init_sqlgenerator = __esm({
|
|
23644
23769
|
}
|
23645
23770
|
};
|
23646
23771
|
PgAlterTableAlterColumnDropGeneratedConvertor = class extends Convertor {
|
23647
|
-
can(statement,
|
23648
|
-
return statement.type === "alter_table_alter_column_drop_generated" &&
|
23772
|
+
can(statement, dialect4) {
|
23773
|
+
return statement.type === "alter_table_alter_column_drop_generated" && dialect4 === "postgresql";
|
23649
23774
|
}
|
23650
23775
|
convert(statement) {
|
23651
23776
|
const { tableName, columnName, schema: schema5 } = statement;
|
@@ -23654,8 +23779,8 @@ var init_sqlgenerator = __esm({
|
|
23654
23779
|
}
|
23655
23780
|
};
|
23656
23781
|
PgAlterTableAlterColumnSetExpressionConvertor = class extends Convertor {
|
23657
|
-
can(statement,
|
23658
|
-
return statement.type === "alter_table_alter_column_set_generated" &&
|
23782
|
+
can(statement, dialect4) {
|
23783
|
+
return statement.type === "alter_table_alter_column_set_generated" && dialect4 === "postgresql";
|
23659
23784
|
}
|
23660
23785
|
convert(statement) {
|
23661
23786
|
const {
|
@@ -23692,8 +23817,8 @@ var init_sqlgenerator = __esm({
|
|
23692
23817
|
}
|
23693
23818
|
};
|
23694
23819
|
PgAlterTableAlterColumnAlterrGeneratedConvertor = class extends Convertor {
|
23695
|
-
can(statement,
|
23696
|
-
return statement.type === "alter_table_alter_column_alter_generated" &&
|
23820
|
+
can(statement, dialect4) {
|
23821
|
+
return statement.type === "alter_table_alter_column_alter_generated" && dialect4 === "postgresql";
|
23697
23822
|
}
|
23698
23823
|
convert(statement) {
|
23699
23824
|
const {
|
@@ -23730,8 +23855,8 @@ var init_sqlgenerator = __esm({
|
|
23730
23855
|
}
|
23731
23856
|
};
|
23732
23857
|
SqliteAlterTableAlterColumnDropGeneratedConvertor = class extends Convertor {
|
23733
|
-
can(statement,
|
23734
|
-
return statement.type === "alter_table_alter_column_drop_generated" && (
|
23858
|
+
can(statement, dialect4) {
|
23859
|
+
return statement.type === "alter_table_alter_column_drop_generated" && (dialect4 === "sqlite" || dialect4 === "turso");
|
23735
23860
|
}
|
23736
23861
|
convert(statement) {
|
23737
23862
|
const {
|
@@ -23771,8 +23896,8 @@ var init_sqlgenerator = __esm({
|
|
23771
23896
|
}
|
23772
23897
|
};
|
23773
23898
|
SqliteAlterTableAlterColumnSetExpressionConvertor = class extends Convertor {
|
23774
|
-
can(statement,
|
23775
|
-
return statement.type === "alter_table_alter_column_set_generated" && (
|
23899
|
+
can(statement, dialect4) {
|
23900
|
+
return statement.type === "alter_table_alter_column_set_generated" && (dialect4 === "sqlite" || dialect4 === "turso");
|
23776
23901
|
}
|
23777
23902
|
convert(statement) {
|
23778
23903
|
const {
|
@@ -23812,8 +23937,8 @@ var init_sqlgenerator = __esm({
|
|
23812
23937
|
}
|
23813
23938
|
};
|
23814
23939
|
SqliteAlterTableAlterColumnAlterGeneratedConvertor = class extends Convertor {
|
23815
|
-
can(statement,
|
23816
|
-
return statement.type === "alter_table_alter_column_alter_generated" && (
|
23940
|
+
can(statement, dialect4) {
|
23941
|
+
return statement.type === "alter_table_alter_column_alter_generated" && (dialect4 === "sqlite" || dialect4 === "turso");
|
23817
23942
|
}
|
23818
23943
|
convert(statement) {
|
23819
23944
|
const {
|
@@ -23853,8 +23978,8 @@ var init_sqlgenerator = __esm({
|
|
23853
23978
|
}
|
23854
23979
|
};
|
23855
23980
|
MySqlAlterTableAlterColumnAlterrGeneratedConvertor = class extends Convertor {
|
23856
|
-
can(statement,
|
23857
|
-
return statement.type === "alter_table_alter_column_alter_generated" &&
|
23981
|
+
can(statement, dialect4) {
|
23982
|
+
return statement.type === "alter_table_alter_column_alter_generated" && dialect4 === "mysql";
|
23858
23983
|
}
|
23859
23984
|
convert(statement) {
|
23860
23985
|
const {
|
@@ -23891,24 +24016,24 @@ var init_sqlgenerator = __esm({
|
|
23891
24016
|
}
|
23892
24017
|
};
|
23893
24018
|
MySqlAlterTableAddPk = class extends Convertor {
|
23894
|
-
can(statement,
|
23895
|
-
return statement.type === "alter_table_alter_column_set_pk" &&
|
24019
|
+
can(statement, dialect4) {
|
24020
|
+
return statement.type === "alter_table_alter_column_set_pk" && dialect4 === "mysql";
|
23896
24021
|
}
|
23897
24022
|
convert(statement) {
|
23898
24023
|
return `ALTER TABLE \`${statement.tableName}\` ADD PRIMARY KEY (\`${statement.columnName}\`);`;
|
23899
24024
|
}
|
23900
24025
|
};
|
23901
24026
|
MySqlAlterTableDropPk = class extends Convertor {
|
23902
|
-
can(statement,
|
23903
|
-
return statement.type === "alter_table_alter_column_drop_pk" &&
|
24027
|
+
can(statement, dialect4) {
|
24028
|
+
return statement.type === "alter_table_alter_column_drop_pk" && dialect4 === "mysql";
|
23904
24029
|
}
|
23905
24030
|
convert(statement) {
|
23906
24031
|
return `ALTER TABLE \`${statement.tableName}\` DROP PRIMARY KEY`;
|
23907
24032
|
}
|
23908
24033
|
};
|
23909
24034
|
LibSQLModifyColumn = class extends Convertor {
|
23910
|
-
can(statement,
|
23911
|
-
return (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default") &&
|
24035
|
+
can(statement, dialect4) {
|
24036
|
+
return (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default") && dialect4 === "turso";
|
23912
24037
|
}
|
23913
24038
|
convert(statement, json2) {
|
23914
24039
|
const { tableName, columnName } = statement;
|
@@ -23968,8 +24093,8 @@ var init_sqlgenerator = __esm({
|
|
23968
24093
|
}
|
23969
24094
|
};
|
23970
24095
|
MySqlModifyColumn = class extends Convertor {
|
23971
|
-
can(statement,
|
23972
|
-
return (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_drop_on_update" || statement.type === "alter_table_alter_column_set_on_update" || statement.type === "alter_table_alter_column_set_autoincrement" || statement.type === "alter_table_alter_column_drop_autoincrement" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default" || statement.type === "alter_table_alter_column_set_generated" || statement.type === "alter_table_alter_column_drop_generated") &&
|
24096
|
+
can(statement, dialect4) {
|
24097
|
+
return (statement.type === "alter_table_alter_column_set_type" || statement.type === "alter_table_alter_column_set_notnull" || statement.type === "alter_table_alter_column_drop_notnull" || statement.type === "alter_table_alter_column_drop_on_update" || statement.type === "alter_table_alter_column_set_on_update" || statement.type === "alter_table_alter_column_set_autoincrement" || statement.type === "alter_table_alter_column_drop_autoincrement" || statement.type === "alter_table_alter_column_set_default" || statement.type === "alter_table_alter_column_drop_default" || statement.type === "alter_table_alter_column_set_generated" || statement.type === "alter_table_alter_column_drop_generated") && dialect4 === "mysql";
|
23973
24098
|
}
|
23974
24099
|
convert(statement) {
|
23975
24100
|
var _a, _b, _c, _d, _e, _f, _g;
|
@@ -24106,8 +24231,8 @@ var init_sqlgenerator = __esm({
|
|
24106
24231
|
}
|
24107
24232
|
};
|
24108
24233
|
PgAlterTableCreateCompositePrimaryKeyConvertor = class extends Convertor {
|
24109
|
-
can(statement,
|
24110
|
-
return statement.type === "create_composite_pk" &&
|
24234
|
+
can(statement, dialect4) {
|
24235
|
+
return statement.type === "create_composite_pk" && dialect4 === "postgresql";
|
24111
24236
|
}
|
24112
24237
|
convert(statement) {
|
24113
24238
|
const { name, columns } = PgSquasher.unsquashPK(statement.data);
|
@@ -24116,8 +24241,8 @@ var init_sqlgenerator = __esm({
|
|
24116
24241
|
}
|
24117
24242
|
};
|
24118
24243
|
PgAlterTableDeleteCompositePrimaryKeyConvertor = class extends Convertor {
|
24119
|
-
can(statement,
|
24120
|
-
return statement.type === "delete_composite_pk" &&
|
24244
|
+
can(statement, dialect4) {
|
24245
|
+
return statement.type === "delete_composite_pk" && dialect4 === "postgresql";
|
24121
24246
|
}
|
24122
24247
|
convert(statement) {
|
24123
24248
|
const { name, columns } = PgSquasher.unsquashPK(statement.data);
|
@@ -24126,8 +24251,8 @@ var init_sqlgenerator = __esm({
|
|
24126
24251
|
}
|
24127
24252
|
};
|
24128
24253
|
PgAlterTableAlterCompositePrimaryKeyConvertor = class extends Convertor {
|
24129
|
-
can(statement,
|
24130
|
-
return statement.type === "alter_composite_pk" &&
|
24254
|
+
can(statement, dialect4) {
|
24255
|
+
return statement.type === "alter_composite_pk" && dialect4 === "postgresql";
|
24131
24256
|
}
|
24132
24257
|
convert(statement) {
|
24133
24258
|
const { name, columns } = PgSquasher.unsquashPK(statement.old);
|
@@ -24140,8 +24265,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24140
24265
|
}
|
24141
24266
|
};
|
24142
24267
|
MySqlAlterTableCreateCompositePrimaryKeyConvertor = class extends Convertor {
|
24143
|
-
can(statement,
|
24144
|
-
return statement.type === "create_composite_pk" &&
|
24268
|
+
can(statement, dialect4) {
|
24269
|
+
return statement.type === "create_composite_pk" && dialect4 === "mysql";
|
24145
24270
|
}
|
24146
24271
|
convert(statement) {
|
24147
24272
|
const { name, columns } = MySqlSquasher.unsquashPK(statement.data);
|
@@ -24149,8 +24274,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24149
24274
|
}
|
24150
24275
|
};
|
24151
24276
|
MySqlAlterTableDeleteCompositePrimaryKeyConvertor = class extends Convertor {
|
24152
|
-
can(statement,
|
24153
|
-
return statement.type === "delete_composite_pk" &&
|
24277
|
+
can(statement, dialect4) {
|
24278
|
+
return statement.type === "delete_composite_pk" && dialect4 === "mysql";
|
24154
24279
|
}
|
24155
24280
|
convert(statement) {
|
24156
24281
|
const { name, columns } = MySqlSquasher.unsquashPK(statement.data);
|
@@ -24158,8 +24283,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24158
24283
|
}
|
24159
24284
|
};
|
24160
24285
|
MySqlAlterTableAlterCompositePrimaryKeyConvertor = class extends Convertor {
|
24161
|
-
can(statement,
|
24162
|
-
return statement.type === "alter_composite_pk" &&
|
24286
|
+
can(statement, dialect4) {
|
24287
|
+
return statement.type === "alter_composite_pk" && dialect4 === "mysql";
|
24163
24288
|
}
|
24164
24289
|
convert(statement) {
|
24165
24290
|
const { name, columns } = MySqlSquasher.unsquashPK(statement.old);
|
@@ -24170,8 +24295,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24170
24295
|
}
|
24171
24296
|
};
|
24172
24297
|
PgAlterTableAlterColumnSetPrimaryKeyConvertor = class extends Convertor {
|
24173
|
-
can(statement,
|
24174
|
-
return statement.type === "alter_table_alter_column_set_pk" &&
|
24298
|
+
can(statement, dialect4) {
|
24299
|
+
return statement.type === "alter_table_alter_column_set_pk" && dialect4 === "postgresql";
|
24175
24300
|
}
|
24176
24301
|
convert(statement) {
|
24177
24302
|
const { tableName, columnName } = statement;
|
@@ -24180,8 +24305,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24180
24305
|
}
|
24181
24306
|
};
|
24182
24307
|
PgAlterTableAlterColumnDropPrimaryKeyConvertor = class extends Convertor {
|
24183
|
-
can(statement,
|
24184
|
-
return statement.type === "alter_table_alter_column_drop_pk" &&
|
24308
|
+
can(statement, dialect4) {
|
24309
|
+
return statement.type === "alter_table_alter_column_drop_pk" && dialect4 === "postgresql";
|
24185
24310
|
}
|
24186
24311
|
convert(statement) {
|
24187
24312
|
const { tableName, columnName, schema: schema5 } = statement;
|
@@ -24204,8 +24329,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24204
24329
|
}
|
24205
24330
|
};
|
24206
24331
|
PgAlterTableAlterColumnSetNotNullConvertor = class extends Convertor {
|
24207
|
-
can(statement,
|
24208
|
-
return statement.type === "alter_table_alter_column_set_notnull" &&
|
24332
|
+
can(statement, dialect4) {
|
24333
|
+
return statement.type === "alter_table_alter_column_set_notnull" && dialect4 === "postgresql";
|
24209
24334
|
}
|
24210
24335
|
convert(statement) {
|
24211
24336
|
const { tableName, columnName } = statement;
|
@@ -24214,8 +24339,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24214
24339
|
}
|
24215
24340
|
};
|
24216
24341
|
PgAlterTableAlterColumnDropNotNullConvertor = class extends Convertor {
|
24217
|
-
can(statement,
|
24218
|
-
return statement.type === "alter_table_alter_column_drop_notnull" &&
|
24342
|
+
can(statement, dialect4) {
|
24343
|
+
return statement.type === "alter_table_alter_column_drop_notnull" && dialect4 === "postgresql";
|
24219
24344
|
}
|
24220
24345
|
convert(statement) {
|
24221
24346
|
const { tableName, columnName } = statement;
|
@@ -24224,8 +24349,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24224
24349
|
}
|
24225
24350
|
};
|
24226
24351
|
PgCreateForeignKeyConvertor = class extends Convertor {
|
24227
|
-
can(statement,
|
24228
|
-
return statement.type === "create_reference" &&
|
24352
|
+
can(statement, dialect4) {
|
24353
|
+
return statement.type === "create_reference" && dialect4 === "postgresql";
|
24229
24354
|
}
|
24230
24355
|
convert(statement) {
|
24231
24356
|
const {
|
@@ -24254,8 +24379,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24254
24379
|
}
|
24255
24380
|
};
|
24256
24381
|
LibSQLCreateForeignKeyConvertor = class extends Convertor {
|
24257
|
-
can(statement,
|
24258
|
-
return statement.type === "create_reference" &&
|
24382
|
+
can(statement, dialect4) {
|
24383
|
+
return statement.type === "create_reference" && dialect4 === "turso";
|
24259
24384
|
}
|
24260
24385
|
convert(statement, json2, action) {
|
24261
24386
|
const { columnsFrom, columnsTo, tableFrom, onDelete, onUpdate, tableTo } = action === "push" ? SQLiteSquasher.unsquashPushFK(statement.data) : SQLiteSquasher.unsquashFK(statement.data);
|
@@ -24271,8 +24396,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24271
24396
|
}
|
24272
24397
|
};
|
24273
24398
|
MySqlCreateForeignKeyConvertor = class extends Convertor {
|
24274
|
-
can(statement,
|
24275
|
-
return statement.type === "create_reference" &&
|
24399
|
+
can(statement, dialect4) {
|
24400
|
+
return statement.type === "create_reference" && dialect4 === "mysql";
|
24276
24401
|
}
|
24277
24402
|
convert(statement) {
|
24278
24403
|
const {
|
@@ -24292,8 +24417,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24292
24417
|
}
|
24293
24418
|
};
|
24294
24419
|
PgAlterForeignKeyConvertor = class extends Convertor {
|
24295
|
-
can(statement,
|
24296
|
-
return statement.type === "alter_reference" &&
|
24420
|
+
can(statement, dialect4) {
|
24421
|
+
return statement.type === "alter_reference" && dialect4 === "postgresql";
|
24297
24422
|
}
|
24298
24423
|
convert(statement) {
|
24299
24424
|
const newFk = PgSquasher.unsquashFK(statement.data);
|
@@ -24317,8 +24442,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24317
24442
|
}
|
24318
24443
|
};
|
24319
24444
|
PgDeleteForeignKeyConvertor = class extends Convertor {
|
24320
|
-
can(statement,
|
24321
|
-
return statement.type === "delete_reference" &&
|
24445
|
+
can(statement, dialect4) {
|
24446
|
+
return statement.type === "delete_reference" && dialect4 === "postgresql";
|
24322
24447
|
}
|
24323
24448
|
convert(statement) {
|
24324
24449
|
const tableFrom = statement.tableName;
|
@@ -24329,8 +24454,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24329
24454
|
}
|
24330
24455
|
};
|
24331
24456
|
MySqlDeleteForeignKeyConvertor = class extends Convertor {
|
24332
|
-
can(statement,
|
24333
|
-
return statement.type === "delete_reference" &&
|
24457
|
+
can(statement, dialect4) {
|
24458
|
+
return statement.type === "delete_reference" && dialect4 === "mysql";
|
24334
24459
|
}
|
24335
24460
|
convert(statement) {
|
24336
24461
|
const tableFrom = statement.tableName;
|
@@ -24340,8 +24465,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24340
24465
|
}
|
24341
24466
|
};
|
24342
24467
|
CreatePgIndexConvertor = class extends Convertor {
|
24343
|
-
can(statement,
|
24344
|
-
return statement.type === "create_index_pg" &&
|
24468
|
+
can(statement, dialect4) {
|
24469
|
+
return statement.type === "create_index_pg" && dialect4 === "postgresql";
|
24345
24470
|
}
|
24346
24471
|
convert(statement) {
|
24347
24472
|
const {
|
@@ -24372,8 +24497,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24372
24497
|
}
|
24373
24498
|
};
|
24374
24499
|
CreateMySqlIndexConvertor = class extends Convertor {
|
24375
|
-
can(statement,
|
24376
|
-
return statement.type === "create_index" &&
|
24500
|
+
can(statement, dialect4) {
|
24501
|
+
return statement.type === "create_index" && dialect4 === "mysql";
|
24377
24502
|
}
|
24378
24503
|
convert(statement) {
|
24379
24504
|
const { name, columns, isUnique } = MySqlSquasher.unsquashIdx(
|
@@ -24388,8 +24513,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24388
24513
|
}
|
24389
24514
|
};
|
24390
24515
|
CreateSqliteIndexConvertor = class extends Convertor {
|
24391
|
-
can(statement,
|
24392
|
-
return statement.type === "create_index" && (
|
24516
|
+
can(statement, dialect4) {
|
24517
|
+
return statement.type === "create_index" && (dialect4 === "sqlite" || dialect4 === "turso");
|
24393
24518
|
}
|
24394
24519
|
convert(statement) {
|
24395
24520
|
const { name, columns, isUnique, where } = SQLiteSquasher.unsquashIdx(
|
@@ -24405,8 +24530,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24405
24530
|
}
|
24406
24531
|
};
|
24407
24532
|
PgDropIndexConvertor = class extends Convertor {
|
24408
|
-
can(statement,
|
24409
|
-
return statement.type === "drop_index" &&
|
24533
|
+
can(statement, dialect4) {
|
24534
|
+
return statement.type === "drop_index" && dialect4 === "postgresql";
|
24410
24535
|
}
|
24411
24536
|
convert(statement) {
|
24412
24537
|
const { name } = PgSquasher.unsquashIdx(statement.data);
|
@@ -24414,8 +24539,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24414
24539
|
}
|
24415
24540
|
};
|
24416
24541
|
PgCreateSchemaConvertor = class extends Convertor {
|
24417
|
-
can(statement,
|
24418
|
-
return statement.type === "create_schema" &&
|
24542
|
+
can(statement, dialect4) {
|
24543
|
+
return statement.type === "create_schema" && dialect4 === "postgresql";
|
24419
24544
|
}
|
24420
24545
|
convert(statement) {
|
24421
24546
|
const { name } = statement;
|
@@ -24424,8 +24549,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24424
24549
|
}
|
24425
24550
|
};
|
24426
24551
|
PgRenameSchemaConvertor = class extends Convertor {
|
24427
|
-
can(statement,
|
24428
|
-
return statement.type === "rename_schema" &&
|
24552
|
+
can(statement, dialect4) {
|
24553
|
+
return statement.type === "rename_schema" && dialect4 === "postgresql";
|
24429
24554
|
}
|
24430
24555
|
convert(statement) {
|
24431
24556
|
const { from, to } = statement;
|
@@ -24434,8 +24559,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24434
24559
|
}
|
24435
24560
|
};
|
24436
24561
|
PgDropSchemaConvertor = class extends Convertor {
|
24437
|
-
can(statement,
|
24438
|
-
return statement.type === "drop_schema" &&
|
24562
|
+
can(statement, dialect4) {
|
24563
|
+
return statement.type === "drop_schema" && dialect4 === "postgresql";
|
24439
24564
|
}
|
24440
24565
|
convert(statement) {
|
24441
24566
|
const { name } = statement;
|
@@ -24444,8 +24569,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24444
24569
|
}
|
24445
24570
|
};
|
24446
24571
|
PgAlterTableSetSchemaConvertor = class extends Convertor {
|
24447
|
-
can(statement,
|
24448
|
-
return statement.type === "alter_table_set_schema" &&
|
24572
|
+
can(statement, dialect4) {
|
24573
|
+
return statement.type === "alter_table_set_schema" && dialect4 === "postgresql";
|
24449
24574
|
}
|
24450
24575
|
convert(statement) {
|
24451
24576
|
const { tableName, schemaFrom, schemaTo } = statement;
|
@@ -24454,8 +24579,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24454
24579
|
}
|
24455
24580
|
};
|
24456
24581
|
PgAlterTableSetNewSchemaConvertor = class extends Convertor {
|
24457
|
-
can(statement,
|
24458
|
-
return statement.type === "alter_table_set_new_schema" &&
|
24582
|
+
can(statement, dialect4) {
|
24583
|
+
return statement.type === "alter_table_set_new_schema" && dialect4 === "postgresql";
|
24459
24584
|
}
|
24460
24585
|
convert(statement) {
|
24461
24586
|
const { tableName, to, from } = statement;
|
@@ -24465,8 +24590,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24465
24590
|
}
|
24466
24591
|
};
|
24467
24592
|
PgAlterTableRemoveFromSchemaConvertor = class extends Convertor {
|
24468
|
-
can(statement,
|
24469
|
-
return statement.type === "alter_table_remove_from_schema" &&
|
24593
|
+
can(statement, dialect4) {
|
24594
|
+
return statement.type === "alter_table_remove_from_schema" && dialect4 === "postgresql";
|
24470
24595
|
}
|
24471
24596
|
convert(statement) {
|
24472
24597
|
const { tableName, schema: schema5 } = statement;
|
@@ -24476,8 +24601,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24476
24601
|
}
|
24477
24602
|
};
|
24478
24603
|
SqliteDropIndexConvertor = class extends Convertor {
|
24479
|
-
can(statement,
|
24480
|
-
return statement.type === "drop_index" && (
|
24604
|
+
can(statement, dialect4) {
|
24605
|
+
return statement.type === "drop_index" && (dialect4 === "sqlite" || dialect4 === "turso");
|
24481
24606
|
}
|
24482
24607
|
convert(statement) {
|
24483
24608
|
const { name } = PgSquasher.unsquashIdx(statement.data);
|
@@ -24485,8 +24610,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24485
24610
|
}
|
24486
24611
|
};
|
24487
24612
|
MySqlDropIndexConvertor = class extends Convertor {
|
24488
|
-
can(statement,
|
24489
|
-
return statement.type === "drop_index" &&
|
24613
|
+
can(statement, dialect4) {
|
24614
|
+
return statement.type === "drop_index" && dialect4 === "mysql";
|
24490
24615
|
}
|
24491
24616
|
convert(statement) {
|
24492
24617
|
const { name } = MySqlSquasher.unsquashIdx(statement.data);
|
@@ -24494,8 +24619,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24494
24619
|
}
|
24495
24620
|
};
|
24496
24621
|
SQLiteRecreateTableConvertor = class extends Convertor {
|
24497
|
-
can(statement,
|
24498
|
-
return statement.type === "recreate_table" &&
|
24622
|
+
can(statement, dialect4) {
|
24623
|
+
return statement.type === "recreate_table" && dialect4 === "sqlite";
|
24499
24624
|
}
|
24500
24625
|
convert(statement) {
|
24501
24626
|
const { tableName, columns, compositePKs, referenceData } = statement;
|
@@ -24536,8 +24661,8 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24536
24661
|
}
|
24537
24662
|
};
|
24538
24663
|
LibSQLRecreateTableConvertor = class extends Convertor {
|
24539
|
-
can(statement,
|
24540
|
-
return statement.type === "recreate_table" &&
|
24664
|
+
can(statement, dialect4) {
|
24665
|
+
return statement.type === "recreate_table" && dialect4 === "turso";
|
24541
24666
|
}
|
24542
24667
|
convert(statement) {
|
24543
24668
|
const { tableName, columns, compositePKs, referenceData } = statement;
|
@@ -24584,6 +24709,11 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24584
24709
|
convertors.push(new SQLiteRecreateTableConvertor());
|
24585
24710
|
convertors.push(new LibSQLRecreateTableConvertor());
|
24586
24711
|
convertors.push(new CreateTypeEnumConvertor());
|
24712
|
+
convertors.push(new DropTypeEnumConvertor());
|
24713
|
+
convertors.push(new AlterTypeAddValueConvertor());
|
24714
|
+
convertors.push(new AlterTypeSetSchemaConvertor());
|
24715
|
+
convertors.push(new AlterRenameTypeConvertor());
|
24716
|
+
convertors.push(new AlterTypeDropValueConvertor());
|
24587
24717
|
convertors.push(new CreatePgSequenceConvertor());
|
24588
24718
|
convertors.push(new DropPgSequenceConvertor());
|
24589
24719
|
convertors.push(new RenamePgSequenceConvertor());
|
@@ -24615,7 +24745,6 @@ ${BREAKPOINT}ALTER TABLE ${tableNameWithSchema} ADD CONSTRAINT ${statement.newCo
|
|
24615
24745
|
convertors.push(new PgDropIndexConvertor());
|
24616
24746
|
convertors.push(new SqliteDropIndexConvertor());
|
24617
24747
|
convertors.push(new MySqlDropIndexConvertor());
|
24618
|
-
convertors.push(new AlterTypeAddValueConvertor());
|
24619
24748
|
convertors.push(new PgAlterTableAlterColumnSetPrimaryKeyConvertor());
|
24620
24749
|
convertors.push(new PgAlterTableAlterColumnDropPrimaryKeyConvertor());
|
24621
24750
|
convertors.push(new PgAlterTableAlterColumnSetNotNullConvertor());
|
@@ -24917,7 +25046,7 @@ var init_sqlitePushUtils = __esm({
|
|
24917
25046
|
});
|
24918
25047
|
|
24919
25048
|
// src/jsonStatements.ts
|
24920
|
-
var preparePgCreateTableJson, prepareMySqlCreateTableJson, prepareSQLiteCreateTable, prepareDropTableJson, prepareRenameTableJson, prepareCreateEnumJson, prepareAddValuesToEnumJson, 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, prepareAddCompositePrimaryKeyMySql, prepareDeleteCompositePrimaryKeyMySql, prepareAlterCompositePrimaryKeyMySql;
|
25049
|
+
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, prepareAddCompositePrimaryKeyMySql, prepareDeleteCompositePrimaryKeyMySql, prepareAlterCompositePrimaryKeyMySql;
|
24921
25050
|
var init_jsonStatements = __esm({
|
24922
25051
|
"src/jsonStatements.ts"() {
|
24923
25052
|
"use strict";
|
@@ -25007,6 +25136,28 @@ var init_jsonStatements = __esm({
|
|
25007
25136
|
};
|
25008
25137
|
});
|
25009
25138
|
};
|
25139
|
+
prepareDropEnumValues = (name, schema5, removedValues, json2) => {
|
25140
|
+
if (!removedValues.length)
|
25141
|
+
return [];
|
25142
|
+
const affectedColumns = [];
|
25143
|
+
for (const tableKey2 in json2.tables) {
|
25144
|
+
const table4 = json2.tables[tableKey2];
|
25145
|
+
for (const columnKey in table4.columns) {
|
25146
|
+
const column7 = table4.columns[columnKey];
|
25147
|
+
if (column7.type === name && column7.typeSchema === schema5) {
|
25148
|
+
affectedColumns.push({ schema: table4.schema || "public", table: table4.name, column: column7.name });
|
25149
|
+
}
|
25150
|
+
}
|
25151
|
+
}
|
25152
|
+
return [{
|
25153
|
+
type: "alter_type_drop_value",
|
25154
|
+
name,
|
25155
|
+
schema: schema5,
|
25156
|
+
deletedValues: removedValues,
|
25157
|
+
newValues: json2.enums[`${schema5}.${name}`].values,
|
25158
|
+
columnsWithEnum: affectedColumns
|
25159
|
+
}];
|
25160
|
+
};
|
25010
25161
|
prepareDropEnumJson = (name, schema5) => {
|
25011
25162
|
return {
|
25012
25163
|
type: "drop_type_enum",
|
@@ -27200,6 +27351,9 @@ var init_snapshotsDiffer = __esm({
|
|
27200
27351
|
const jsonAlterEnumsWithAddedValues = typedResult.alteredEnums.map((it) => {
|
27201
27352
|
return prepareAddValuesToEnumJson(it.name, it.schema, it.addedValues);
|
27202
27353
|
}).flat() ?? [];
|
27354
|
+
const jsonAlterEnumsWithDroppedValues = typedResult.alteredEnums.map((it) => {
|
27355
|
+
return prepareDropEnumValues(it.name, it.schema, it.deletedValues, curFull);
|
27356
|
+
}).flat() ?? [];
|
27203
27357
|
const createSequences = createdSequences.map((it) => {
|
27204
27358
|
return prepareCreateSequenceJson(it);
|
27205
27359
|
}) ?? [];
|
@@ -27257,6 +27411,7 @@ var init_snapshotsDiffer = __esm({
|
|
27257
27411
|
jsonStatements.push(...jsonAlteredCompositePKs);
|
27258
27412
|
jsonStatements.push(...jsonAddedUniqueConstraints);
|
27259
27413
|
jsonStatements.push(...jsonAlteredUniqueConstraints);
|
27414
|
+
jsonStatements.push(...jsonAlterEnumsWithDroppedValues);
|
27260
27415
|
jsonStatements.push(...dropEnums);
|
27261
27416
|
jsonStatements.push(...dropSequences);
|
27262
27417
|
jsonStatements.push(...dropSchemas);
|
@@ -27277,7 +27432,17 @@ var init_snapshotsDiffer = __esm({
|
|
27277
27432
|
}
|
27278
27433
|
return true;
|
27279
27434
|
});
|
27280
|
-
const
|
27435
|
+
const filteredEnumsJsonStatements = filteredJsonStatements.filter((st) => {
|
27436
|
+
if (st.type === "alter_type_add_value") {
|
27437
|
+
if (jsonStatements.find(
|
27438
|
+
(it) => it.type === "alter_type_drop_value" && it.name === st.name && it.schema === st.schema
|
27439
|
+
)) {
|
27440
|
+
return false;
|
27441
|
+
}
|
27442
|
+
}
|
27443
|
+
return true;
|
27444
|
+
});
|
27445
|
+
const sqlStatements = fromJson(filteredEnumsJsonStatements, "postgresql");
|
27281
27446
|
const uniqueSqlStatements = [];
|
27282
27447
|
sqlStatements.forEach((ss) => {
|
27283
27448
|
if (!uniqueSqlStatements.includes(ss)) {
|
@@ -27293,7 +27458,7 @@ var init_snapshotsDiffer = __esm({
|
|
27293
27458
|
});
|
27294
27459
|
const _meta = prepareMigrationMeta(rSchemas, rTables, rColumns);
|
27295
27460
|
return {
|
27296
|
-
statements:
|
27461
|
+
statements: filteredEnumsJsonStatements,
|
27297
27462
|
sqlStatements: uniqueSqlStatements,
|
27298
27463
|
_meta
|
27299
27464
|
};
|
@@ -29637,6 +29802,7 @@ var init_migrate = __esm({
|
|
29637
29802
|
prepareAndMigratePg = async (config) => {
|
29638
29803
|
const outFolder = config.out;
|
29639
29804
|
const schemaPath = config.schema;
|
29805
|
+
const casing2 = config.casing;
|
29640
29806
|
try {
|
29641
29807
|
assertV1OutFolder(outFolder);
|
29642
29808
|
const { snapshots, journal } = prepareMigrationFolder(
|
@@ -29645,7 +29811,8 @@ var init_migrate = __esm({
|
|
29645
29811
|
);
|
29646
29812
|
const { prev, cur, custom: custom2 } = await preparePgMigrationSnapshot(
|
29647
29813
|
snapshots,
|
29648
|
-
schemaPath
|
29814
|
+
schemaPath,
|
29815
|
+
casing2
|
29649
29816
|
);
|
29650
29817
|
const validatedPrev = pgSchema.parse(prev);
|
29651
29818
|
const validatedCur = pgSchema.parse(cur);
|
@@ -29688,10 +29855,11 @@ var init_migrate = __esm({
|
|
29688
29855
|
console.error(e2);
|
29689
29856
|
}
|
29690
29857
|
};
|
29691
|
-
preparePgPush = async (schemaPath, snapshot, schemaFilter) => {
|
29858
|
+
preparePgPush = async (schemaPath, snapshot, schemaFilter, casing2) => {
|
29692
29859
|
const { prev, cur } = await preparePgDbPushSnapshot(
|
29693
29860
|
snapshot,
|
29694
29861
|
schemaPath,
|
29862
|
+
casing2,
|
29695
29863
|
schemaFilter
|
29696
29864
|
);
|
29697
29865
|
const validatedPrev = pgSchema.parse(prev);
|
@@ -29712,11 +29880,12 @@ var init_migrate = __esm({
|
|
29712
29880
|
);
|
29713
29881
|
return { sqlStatements, statements, squashedPrev, squashedCur };
|
29714
29882
|
};
|
29715
|
-
prepareMySQLPush = async (schemaPath, snapshot) => {
|
29883
|
+
prepareMySQLPush = async (schemaPath, snapshot, casing2) => {
|
29716
29884
|
try {
|
29717
29885
|
const { prev, cur } = await prepareMySqlDbPushSnapshot(
|
29718
29886
|
snapshot,
|
29719
|
-
schemaPath
|
29887
|
+
schemaPath,
|
29888
|
+
casing2
|
29720
29889
|
);
|
29721
29890
|
const validatedPrev = mysqlSchema.parse(prev);
|
29722
29891
|
const validatedCur = mysqlSchema.parse(cur);
|
@@ -29740,12 +29909,14 @@ var init_migrate = __esm({
|
|
29740
29909
|
prepareAndMigrateMysql = async (config) => {
|
29741
29910
|
const outFolder = config.out;
|
29742
29911
|
const schemaPath = config.schema;
|
29912
|
+
const casing2 = config.casing;
|
29743
29913
|
try {
|
29744
29914
|
assertV1OutFolder(outFolder);
|
29745
29915
|
const { snapshots, journal } = prepareMigrationFolder(outFolder, "mysql");
|
29746
29916
|
const { prev, cur, custom: custom2 } = await prepareMySqlMigrationSnapshot(
|
29747
29917
|
snapshots,
|
29748
|
-
schemaPath
|
29918
|
+
schemaPath,
|
29919
|
+
casing2
|
29749
29920
|
);
|
29750
29921
|
const validatedPrev = mysqlSchema.parse(prev);
|
29751
29922
|
const validatedCur = mysqlSchema.parse(cur);
|
@@ -29789,12 +29960,14 @@ var init_migrate = __esm({
|
|
29789
29960
|
prepareAndMigrateSqlite = async (config) => {
|
29790
29961
|
const outFolder = config.out;
|
29791
29962
|
const schemaPath = config.schema;
|
29963
|
+
const casing2 = config.casing;
|
29792
29964
|
try {
|
29793
29965
|
assertV1OutFolder(outFolder);
|
29794
29966
|
const { snapshots, journal } = prepareMigrationFolder(outFolder, "sqlite");
|
29795
29967
|
const { prev, cur, custom: custom2 } = await prepareSqliteMigrationSnapshot(
|
29796
29968
|
snapshots,
|
29797
|
-
schemaPath
|
29969
|
+
schemaPath,
|
29970
|
+
casing2
|
29798
29971
|
);
|
29799
29972
|
const validatedPrev = sqliteSchema.parse(prev);
|
29800
29973
|
const validatedCur = sqliteSchema.parse(cur);
|
@@ -29840,12 +30013,14 @@ var init_migrate = __esm({
|
|
29840
30013
|
prepareAndMigrateLibSQL = async (config) => {
|
29841
30014
|
const outFolder = config.out;
|
29842
30015
|
const schemaPath = config.schema;
|
30016
|
+
const casing2 = config.casing;
|
29843
30017
|
try {
|
29844
30018
|
assertV1OutFolder(outFolder);
|
29845
30019
|
const { snapshots, journal } = prepareMigrationFolder(outFolder, "sqlite");
|
29846
30020
|
const { prev, cur, custom: custom2 } = await prepareSqliteMigrationSnapshot(
|
29847
30021
|
snapshots,
|
29848
|
-
schemaPath
|
30022
|
+
schemaPath,
|
30023
|
+
casing2
|
29849
30024
|
);
|
29850
30025
|
const validatedPrev = sqliteSchema.parse(prev);
|
29851
30026
|
const validatedCur = sqliteSchema.parse(cur);
|
@@ -29888,8 +30063,8 @@ var init_migrate = __esm({
|
|
29888
30063
|
console.error(e2);
|
29889
30064
|
}
|
29890
30065
|
};
|
29891
|
-
prepareSQLitePush = async (schemaPath, snapshot) => {
|
29892
|
-
const { prev, cur } = await prepareSQLiteDbPushSnapshot(snapshot, schemaPath);
|
30066
|
+
prepareSQLitePush = async (schemaPath, snapshot, casing2) => {
|
30067
|
+
const { prev, cur } = await prepareSQLiteDbPushSnapshot(snapshot, schemaPath, casing2);
|
29893
30068
|
const validatedPrev = sqliteSchema.parse(prev);
|
29894
30069
|
const validatedCur = sqliteSchema.parse(cur);
|
29895
30070
|
const squashedPrev = squashSqliteScheme(validatedPrev, "push");
|
@@ -29911,8 +30086,8 @@ var init_migrate = __esm({
|
|
29911
30086
|
meta: _meta
|
29912
30087
|
};
|
29913
30088
|
};
|
29914
|
-
prepareLibSQLPush = async (schemaPath, snapshot) => {
|
29915
|
-
const { prev, cur } = await prepareSQLiteDbPushSnapshot(snapshot, schemaPath);
|
30089
|
+
prepareLibSQLPush = async (schemaPath, snapshot, casing2) => {
|
30090
|
+
const { prev, cur } = await prepareSQLiteDbPushSnapshot(snapshot, schemaPath, casing2);
|
29916
30091
|
const validatedPrev = sqliteSchema.parse(prev);
|
29917
30092
|
const validatedCur = sqliteSchema.parse(cur);
|
29918
30093
|
const squashedPrev = squashSqliteScheme(validatedPrev, "push");
|
@@ -56234,9 +56409,9 @@ var require_dist_cjs46 = __commonJS({
|
|
56234
56409
|
}
|
56235
56410
|
});
|
56236
56411
|
|
56237
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/auth/httpAuthSchemeProvider.js
|
56412
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0_@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/auth/httpAuthSchemeProvider.js
|
56238
56413
|
var require_httpAuthSchemeProvider3 = __commonJS({
|
56239
|
-
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/auth/httpAuthSchemeProvider.js"(exports2) {
|
56414
|
+
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0_@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/auth/httpAuthSchemeProvider.js"(exports2) {
|
56240
56415
|
"use strict";
|
56241
56416
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
56242
56417
|
exports2.resolveHttpAuthSchemeConfig = exports2.defaultSSOOIDCHttpAuthSchemeProvider = exports2.defaultSSOOIDCHttpAuthSchemeParametersProvider = void 0;
|
@@ -56303,9 +56478,9 @@ var require_httpAuthSchemeProvider3 = __commonJS({
|
|
56303
56478
|
}
|
56304
56479
|
});
|
56305
56480
|
|
56306
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/package.json
|
56481
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0_@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sso-oidc/package.json
|
56307
56482
|
var require_package4 = __commonJS({
|
56308
|
-
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/package.json"(exports2, module2) {
|
56483
|
+
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0_@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sso-oidc/package.json"(exports2, module2) {
|
56309
56484
|
module2.exports = {
|
56310
56485
|
name: "@aws-sdk/client-sso-oidc",
|
56311
56486
|
description: "AWS SDK for JavaScript Sso Oidc Client for Node.js, Browser and React Native",
|
@@ -56409,9 +56584,9 @@ var require_package4 = __commonJS({
|
|
56409
56584
|
}
|
56410
56585
|
});
|
56411
56586
|
|
56412
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/ruleset.js
|
56587
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0_@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/ruleset.js
|
56413
56588
|
var require_ruleset2 = __commonJS({
|
56414
|
-
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/ruleset.js"(exports2) {
|
56589
|
+
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0_@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/ruleset.js"(exports2) {
|
56415
56590
|
"use strict";
|
56416
56591
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
56417
56592
|
exports2.ruleSet = void 0;
|
@@ -56444,9 +56619,9 @@ var require_ruleset2 = __commonJS({
|
|
56444
56619
|
}
|
56445
56620
|
});
|
56446
56621
|
|
56447
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/endpointResolver.js
|
56622
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0_@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/endpointResolver.js
|
56448
56623
|
var require_endpointResolver2 = __commonJS({
|
56449
|
-
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/endpointResolver.js"(exports2) {
|
56624
|
+
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0_@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/endpoint/endpointResolver.js"(exports2) {
|
56450
56625
|
"use strict";
|
56451
56626
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
56452
56627
|
exports2.defaultEndpointResolver = void 0;
|
@@ -56464,9 +56639,9 @@ var require_endpointResolver2 = __commonJS({
|
|
56464
56639
|
}
|
56465
56640
|
});
|
56466
56641
|
|
56467
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.shared.js
|
56642
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0_@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.shared.js
|
56468
56643
|
var require_runtimeConfig_shared2 = __commonJS({
|
56469
|
-
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.shared.js"(exports2) {
|
56644
|
+
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0_@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.shared.js"(exports2) {
|
56470
56645
|
"use strict";
|
56471
56646
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
56472
56647
|
exports2.getRuntimeConfig = void 0;
|
@@ -56510,9 +56685,9 @@ var require_runtimeConfig_shared2 = __commonJS({
|
|
56510
56685
|
}
|
56511
56686
|
});
|
56512
56687
|
|
56513
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.js
|
56688
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0_@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.js
|
56514
56689
|
var require_runtimeConfig2 = __commonJS({
|
56515
|
-
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.js"(exports2) {
|
56690
|
+
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0_@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/runtimeConfig.js"(exports2) {
|
56516
56691
|
"use strict";
|
56517
56692
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
56518
56693
|
exports2.getRuntimeConfig = void 0;
|
@@ -56563,9 +56738,9 @@ var require_runtimeConfig2 = __commonJS({
|
|
56563
56738
|
}
|
56564
56739
|
});
|
56565
56740
|
|
56566
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js
|
56741
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0_@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js
|
56567
56742
|
var require_dist_cjs47 = __commonJS({
|
56568
|
-
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js"(exports2, module2) {
|
56743
|
+
"../node_modules/.pnpm/@aws-sdk+client-sso-oidc@3.583.0_@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sso-oidc/dist-cjs/index.js"(exports2, module2) {
|
56569
56744
|
"use strict";
|
56570
56745
|
var __defProp3 = Object.defineProperty;
|
56571
56746
|
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
@@ -57911,9 +58086,9 @@ Reference: https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.ht
|
|
57911
58086
|
}
|
57912
58087
|
});
|
57913
58088
|
|
57914
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58089
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js
|
57915
58090
|
var require_httpAuthSchemeProvider4 = __commonJS({
|
57916
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58091
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthSchemeProvider.js"(exports2) {
|
57917
58092
|
"use strict";
|
57918
58093
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
57919
58094
|
exports2.resolveHttpAuthSchemeConfig = exports2.resolveStsAuthConfig = exports2.defaultSTSHttpAuthSchemeProvider = exports2.defaultSTSHttpAuthSchemeParametersProvider = void 0;
|
@@ -57983,9 +58158,9 @@ var require_httpAuthSchemeProvider4 = __commonJS({
|
|
57983
58158
|
}
|
57984
58159
|
});
|
57985
58160
|
|
57986
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58161
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js
|
57987
58162
|
var require_EndpointParameters = __commonJS({
|
57988
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58163
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/EndpointParameters.js"(exports2) {
|
57989
58164
|
"use strict";
|
57990
58165
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
57991
58166
|
exports2.commonParams = exports2.resolveClientEndpointParameters = void 0;
|
@@ -58009,9 +58184,9 @@ var require_EndpointParameters = __commonJS({
|
|
58009
58184
|
}
|
58010
58185
|
});
|
58011
58186
|
|
58012
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58187
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/package.json
|
58013
58188
|
var require_package5 = __commonJS({
|
58014
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58189
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/package.json"(exports2, module2) {
|
58015
58190
|
module2.exports = {
|
58016
58191
|
name: "@aws-sdk/client-sts",
|
58017
58192
|
description: "AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native",
|
@@ -58117,9 +58292,9 @@ var require_package5 = __commonJS({
|
|
58117
58292
|
}
|
58118
58293
|
});
|
58119
58294
|
|
58120
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58295
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/ruleset.js
|
58121
58296
|
var require_ruleset3 = __commonJS({
|
58122
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58297
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/ruleset.js"(exports2) {
|
58123
58298
|
"use strict";
|
58124
58299
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58125
58300
|
exports2.ruleSet = void 0;
|
@@ -58164,9 +58339,9 @@ var require_ruleset3 = __commonJS({
|
|
58164
58339
|
}
|
58165
58340
|
});
|
58166
58341
|
|
58167
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58342
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js
|
58168
58343
|
var require_endpointResolver3 = __commonJS({
|
58169
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58344
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/endpoint/endpointResolver.js"(exports2) {
|
58170
58345
|
"use strict";
|
58171
58346
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58172
58347
|
exports2.defaultEndpointResolver = void 0;
|
@@ -58184,9 +58359,9 @@ var require_endpointResolver3 = __commonJS({
|
|
58184
58359
|
}
|
58185
58360
|
});
|
58186
58361
|
|
58187
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58362
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js
|
58188
58363
|
var require_runtimeConfig_shared3 = __commonJS({
|
58189
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58364
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.shared.js"(exports2) {
|
58190
58365
|
"use strict";
|
58191
58366
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58192
58367
|
exports2.getRuntimeConfig = void 0;
|
@@ -58230,9 +58405,9 @@ var require_runtimeConfig_shared3 = __commonJS({
|
|
58230
58405
|
}
|
58231
58406
|
});
|
58232
58407
|
|
58233
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58408
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js
|
58234
58409
|
var require_runtimeConfig3 = __commonJS({
|
58235
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58410
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeConfig.js"(exports2) {
|
58236
58411
|
"use strict";
|
58237
58412
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58238
58413
|
exports2.getRuntimeConfig = void 0;
|
@@ -58296,9 +58471,9 @@ var require_runtimeConfig3 = __commonJS({
|
|
58296
58471
|
}
|
58297
58472
|
});
|
58298
58473
|
|
58299
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58474
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthExtensionConfiguration.js
|
58300
58475
|
var require_httpAuthExtensionConfiguration = __commonJS({
|
58301
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58476
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/auth/httpAuthExtensionConfiguration.js"(exports2) {
|
58302
58477
|
"use strict";
|
58303
58478
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58304
58479
|
exports2.resolveHttpAuthRuntimeConfig = exports2.getHttpAuthExtensionConfiguration = void 0;
|
@@ -58344,9 +58519,9 @@ var require_httpAuthExtensionConfiguration = __commonJS({
|
|
58344
58519
|
}
|
58345
58520
|
});
|
58346
58521
|
|
58347
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58522
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeExtensions.js
|
58348
58523
|
var require_runtimeExtensions = __commonJS({
|
58349
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58524
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/runtimeExtensions.js"(exports2) {
|
58350
58525
|
"use strict";
|
58351
58526
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58352
58527
|
exports2.resolveRuntimeExtensions = void 0;
|
@@ -58375,9 +58550,9 @@ var require_runtimeExtensions = __commonJS({
|
|
58375
58550
|
}
|
58376
58551
|
});
|
58377
58552
|
|
58378
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58553
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js
|
58379
58554
|
var require_STSClient = __commonJS({
|
58380
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58555
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/STSClient.js"(exports2) {
|
58381
58556
|
"use strict";
|
58382
58557
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
58383
58558
|
exports2.STSClient = exports2.__Client = void 0;
|
@@ -58439,9 +58614,9 @@ var require_STSClient = __commonJS({
|
|
58439
58614
|
}
|
58440
58615
|
});
|
58441
58616
|
|
58442
|
-
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58617
|
+
// ../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/index.js
|
58443
58618
|
var require_dist_cjs50 = __commonJS({
|
58444
|
-
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.
|
58619
|
+
"../node_modules/.pnpm/@aws-sdk+client-sts@3.583.0/node_modules/@aws-sdk/client-sts/dist-cjs/index.js"(exports2, module2) {
|
58445
58620
|
"use strict";
|
58446
58621
|
var __defProp3 = Object.defineProperty;
|
58447
58622
|
var __getOwnPropDesc3 = Object.getOwnPropertyDescriptor;
|
@@ -62599,7 +62774,7 @@ var init_studio2 = __esm({
|
|
62599
62774
|
});
|
62600
62775
|
};
|
62601
62776
|
prepareServer = async ({
|
62602
|
-
dialect:
|
62777
|
+
dialect: dialect4,
|
62603
62778
|
driver: driver2,
|
62604
62779
|
proxy,
|
62605
62780
|
customDefaults,
|
@@ -62649,7 +62824,7 @@ var init_studio2 = __esm({
|
|
62649
62824
|
}));
|
62650
62825
|
return c.json({
|
62651
62826
|
version: "6",
|
62652
|
-
dialect:
|
62827
|
+
dialect: dialect4,
|
62653
62828
|
driver: driver2,
|
62654
62829
|
schemaFiles,
|
62655
62830
|
customDefaults: preparedDefaults,
|
@@ -78956,11 +79131,11 @@ var init_pgIntrospect = __esm({
|
|
78956
79131
|
});
|
78957
79132
|
|
78958
79133
|
// src/introspect-sqlite.ts
|
78959
|
-
var
|
79134
|
+
var import_casing3, sqliteImportsList, indexName3, objToStatement2, relations, escapeColumnKey, withCasing, dbColumnName, schemaToTypeScript, isCyclic, isSelf, mapColumnDefault, column4, createTableColumns, createTableIndexes, createTableUniques, createTablePKs, createTableFKs;
|
78960
79135
|
var init_introspect_sqlite = __esm({
|
78961
79136
|
"src/introspect-sqlite.ts"() {
|
78962
79137
|
"use strict";
|
78963
|
-
|
79138
|
+
import_casing3 = require("drizzle-orm/casing");
|
78964
79139
|
init_utils3();
|
78965
79140
|
init_global();
|
78966
79141
|
sqliteImportsList = /* @__PURE__ */ new Set([
|
@@ -79005,7 +79180,7 @@ var init_introspect_sqlite = __esm({
|
|
79005
79180
|
return "";
|
79006
79181
|
}
|
79007
79182
|
if (casing2 === "camel") {
|
79008
|
-
return (0,
|
79183
|
+
return (0, import_casing3.toCamelCase)(name) === name ? "" : withMode ? `"${name}", ` : `"${name}"`;
|
79009
79184
|
}
|
79010
79185
|
assertUnreachable(casing2);
|
79011
79186
|
};
|
@@ -79380,13 +79555,13 @@ var init_push = __esm({
|
|
79380
79555
|
init_mysqlPushUtils();
|
79381
79556
|
init_pgPushUtils();
|
79382
79557
|
init_sqlitePushUtils();
|
79383
|
-
mysqlPush = async (schemaPath, credentials2, tablesFilter, strict, verbose, force) => {
|
79558
|
+
mysqlPush = async (schemaPath, credentials2, tablesFilter, strict, verbose, force, casing2) => {
|
79384
79559
|
const { connectToMySQL: connectToMySQL2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
|
79385
79560
|
const { mysqlPushIntrospect: mysqlPushIntrospect2 } = await Promise.resolve().then(() => (init_mysqlIntrospect(), mysqlIntrospect_exports));
|
79386
79561
|
const { db, database } = await connectToMySQL2(credentials2);
|
79387
79562
|
const { schema: schema5 } = await mysqlPushIntrospect2(db, database, tablesFilter);
|
79388
79563
|
const { prepareMySQLPush: prepareMySQLPush2 } = await Promise.resolve().then(() => (init_migrate(), migrate_exports));
|
79389
|
-
const statements = await prepareMySQLPush2(schemaPath, schema5);
|
79564
|
+
const statements = await prepareMySQLPush2(schemaPath, schema5, casing2);
|
79390
79565
|
const filteredStatements = filterStatements(
|
79391
79566
|
statements.statements ?? [],
|
79392
79567
|
statements.validatedCur,
|
@@ -79481,13 +79656,13 @@ var init_push = __esm({
|
|
79481
79656
|
console.log(e2);
|
79482
79657
|
}
|
79483
79658
|
};
|
79484
|
-
pgPush = async (schemaPath, verbose, strict, credentials2, tablesFilter, schemasFilter, force) => {
|
79659
|
+
pgPush = async (schemaPath, verbose, strict, credentials2, tablesFilter, schemasFilter, force, casing2) => {
|
79485
79660
|
const { preparePostgresDB: preparePostgresDB2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
|
79486
79661
|
const { pgPushIntrospect: pgPushIntrospect2 } = await Promise.resolve().then(() => (init_pgIntrospect(), pgIntrospect_exports));
|
79487
79662
|
const db = await preparePostgresDB2(credentials2);
|
79488
79663
|
const { schema: schema5 } = await pgPushIntrospect2(db, tablesFilter, schemasFilter);
|
79489
79664
|
const { preparePgPush: preparePgPush2 } = await Promise.resolve().then(() => (init_migrate(), migrate_exports));
|
79490
|
-
const statements = await preparePgPush2(schemaPath, schema5, schemasFilter);
|
79665
|
+
const statements = await preparePgPush2(schemaPath, schema5, schemasFilter, casing2);
|
79491
79666
|
try {
|
79492
79667
|
if (statements.sqlStatements.length === 0) {
|
79493
79668
|
(0, import_hanji11.render)(`[${source_default.blue("i")}] No changes detected`);
|
@@ -79555,13 +79730,13 @@ var init_push = __esm({
|
|
79555
79730
|
console.error(e2);
|
79556
79731
|
}
|
79557
79732
|
};
|
79558
|
-
sqlitePush = async (schemaPath, verbose, strict, credentials2, tablesFilter, force) => {
|
79733
|
+
sqlitePush = async (schemaPath, verbose, strict, credentials2, tablesFilter, force, casing2) => {
|
79559
79734
|
const { connectToSQLite: connectToSQLite2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
|
79560
79735
|
const { sqlitePushIntrospect: sqlitePushIntrospect2 } = await Promise.resolve().then(() => (init_sqliteIntrospect(), sqliteIntrospect_exports));
|
79561
79736
|
const db = await connectToSQLite2(credentials2);
|
79562
79737
|
const { schema: schema5 } = await sqlitePushIntrospect2(db, tablesFilter);
|
79563
79738
|
const { prepareSQLitePush: prepareSQLitePush2 } = await Promise.resolve().then(() => (init_migrate(), migrate_exports));
|
79564
|
-
const statements = await prepareSQLitePush2(schemaPath, schema5);
|
79739
|
+
const statements = await prepareSQLitePush2(schemaPath, schema5, casing2);
|
79565
79740
|
if (statements.sqlStatements.length === 0) {
|
79566
79741
|
(0, import_hanji11.render)(`
|
79567
79742
|
[${source_default.blue("i")}] No changes detected`);
|
@@ -79643,13 +79818,13 @@ var init_push = __esm({
|
|
79643
79818
|
}
|
79644
79819
|
}
|
79645
79820
|
};
|
79646
|
-
libSQLPush = async (schemaPath, verbose, strict, credentials2, tablesFilter, force) => {
|
79821
|
+
libSQLPush = async (schemaPath, verbose, strict, credentials2, tablesFilter, force, casing2) => {
|
79647
79822
|
const { connectToLibSQL: connectToLibSQL2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
|
79648
79823
|
const { sqlitePushIntrospect: sqlitePushIntrospect2 } = await Promise.resolve().then(() => (init_sqliteIntrospect(), sqliteIntrospect_exports));
|
79649
79824
|
const db = await connectToLibSQL2(credentials2);
|
79650
79825
|
const { schema: schema5 } = await sqlitePushIntrospect2(db, tablesFilter);
|
79651
79826
|
const { prepareLibSQLPush: prepareLibSQLPush2 } = await Promise.resolve().then(() => (init_migrate(), migrate_exports));
|
79652
|
-
const statements = await prepareLibSQLPush2(schemaPath, schema5);
|
79827
|
+
const statements = await prepareLibSQLPush2(schemaPath, schema5, casing2);
|
79653
79828
|
if (statements.sqlStatements.length === 0) {
|
79654
79829
|
(0, import_hanji11.render)(`
|
79655
79830
|
[${source_default.blue("i")}] No changes detected`);
|
@@ -80079,11 +80254,11 @@ var require_pluralize = __commonJS({
|
|
80079
80254
|
});
|
80080
80255
|
|
80081
80256
|
// src/introspect-mysql.ts
|
80082
|
-
var
|
80257
|
+
var import_casing4, mysqlImportsList, objToStatement22, timeConfig, binaryConfig, importsPatch, relations2, escapeColumnKey2, prepareCasing, dbColumnName2, schemaToTypeScript2, isCyclic2, isSelf2, mapColumnDefault2, mapColumnDefaultForJson, column5, createTableColumns2, createTableIndexes2, createTableUniques2, createTablePKs2, createTableFKs2;
|
80083
80258
|
var init_introspect_mysql = __esm({
|
80084
80259
|
"src/introspect-mysql.ts"() {
|
80085
80260
|
"use strict";
|
80086
|
-
|
80261
|
+
import_casing4 = require("drizzle-orm/casing");
|
80087
80262
|
init_utils3();
|
80088
80263
|
init_global();
|
80089
80264
|
init_mysqlSerializer();
|
@@ -80172,7 +80347,7 @@ var init_introspect_mysql = __esm({
|
|
80172
80347
|
return "";
|
80173
80348
|
}
|
80174
80349
|
if (casing2 === "camel") {
|
80175
|
-
return (0,
|
80350
|
+
return (0, import_casing4.toCamelCase)(name) === name ? "" : withMode ? `"${name}", ` : `"${name}"`;
|
80176
80351
|
}
|
80177
80352
|
assertUnreachable(casing2);
|
80178
80353
|
};
|
@@ -80670,14 +80845,14 @@ function generateIdentityParams(identity) {
|
|
80670
80845
|
}
|
80671
80846
|
return `.generatedByDefaultAsIdentity(${paramsObj})`;
|
80672
80847
|
}
|
80673
|
-
var import_drizzle_orm9, import_relations,
|
80848
|
+
var import_drizzle_orm9, import_relations, import_casing5, pgImportsList, timeConfig2, possibleIntervals, intervalStrToObj, intervalConfig, mapColumnDefault3, importsPatch2, relations3, escapeColumnKey3, withCasing2, dbColumnName3, paramNameFor, schemaToTypeScript3, isCyclic3, isSelf3, buildArrayDefault, mapDefault, column6, dimensionsInArray, createTableColumns3, createTableIndexes3, createTablePKs3, createTableUniques3, createTableFKs3;
|
80674
80849
|
var init_introspect_pg = __esm({
|
80675
80850
|
"src/introspect-pg.ts"() {
|
80676
80851
|
"use strict";
|
80677
80852
|
import_drizzle_orm9 = require("drizzle-orm");
|
80678
80853
|
import_relations = require("drizzle-orm/relations");
|
80679
80854
|
init_utils3();
|
80680
|
-
|
80855
|
+
import_casing5 = require("drizzle-orm/casing");
|
80681
80856
|
init_vector();
|
80682
80857
|
init_global();
|
80683
80858
|
init_pgSerializer();
|
@@ -80808,7 +80983,7 @@ var init_introspect_pg = __esm({
|
|
80808
80983
|
return "";
|
80809
80984
|
}
|
80810
80985
|
if (casing2 === "camel") {
|
80811
|
-
return (0,
|
80986
|
+
return (0, import_casing5.toCamelCase)(name) === name ? "" : withMode ? `"${name}", ` : `"${name}"`;
|
80812
80987
|
}
|
80813
80988
|
assertUnreachable(casing2);
|
80814
80989
|
};
|
@@ -83393,9 +83568,9 @@ init_source();
|
|
83393
83568
|
|
83394
83569
|
// src/cli/commands/check.ts
|
83395
83570
|
init_utils();
|
83396
|
-
var checkHandler = (out,
|
83397
|
-
const { snapshots } = prepareOutFolder(out,
|
83398
|
-
const report = validateWithReport(snapshots,
|
83571
|
+
var checkHandler = (out, dialect4) => {
|
83572
|
+
const { snapshots } = prepareOutFolder(out, dialect4);
|
83573
|
+
const report = validateWithReport(snapshots, dialect4);
|
83399
83574
|
if (report.nonLatest.length > 0) {
|
83400
83575
|
console.log(
|
83401
83576
|
report.nonLatest.map((it) => {
|
@@ -84682,12 +84857,14 @@ var optionBreakpoints = boolean().desc(
|
|
84682
84857
|
`Prepare SQL statements with breakpoints`
|
84683
84858
|
);
|
84684
84859
|
var optionDriver = string().enum(...drivers).desc("Database driver");
|
84860
|
+
var optionCasing = string().enum("camelCase", "snake_case").desc("Casing for serialization");
|
84685
84861
|
var generate = command({
|
84686
84862
|
name: "generate",
|
84687
84863
|
options: {
|
84688
84864
|
config: optionConfig,
|
84689
84865
|
dialect: optionDialect,
|
84690
84866
|
driver: optionDriver,
|
84867
|
+
casing: optionCasing,
|
84691
84868
|
schema: string().desc("Path to a schema file or folder"),
|
84692
84869
|
out: optionOut,
|
84693
84870
|
name: string().desc("Migration file name"),
|
@@ -84700,7 +84877,7 @@ var generate = command({
|
|
84700
84877
|
"generate",
|
84701
84878
|
opts,
|
84702
84879
|
["prefix", "name", "custom"],
|
84703
|
-
["driver", "breakpoints", "schema", "out", "dialect"]
|
84880
|
+
["driver", "breakpoints", "schema", "out", "dialect", "casing"]
|
84704
84881
|
);
|
84705
84882
|
return prepareGenerateConfig(opts, from);
|
84706
84883
|
},
|
@@ -84713,17 +84890,17 @@ var generate = command({
|
|
84713
84890
|
prepareAndMigrateSqlite: prepareAndMigrateSqlite2,
|
84714
84891
|
prepareAndMigrateLibSQL: prepareAndMigrateLibSQL2
|
84715
84892
|
} = await Promise.resolve().then(() => (init_migrate(), migrate_exports));
|
84716
|
-
const
|
84717
|
-
if (
|
84893
|
+
const dialect4 = opts.dialect;
|
84894
|
+
if (dialect4 === "postgresql") {
|
84718
84895
|
await prepareAndMigratePg2(opts);
|
84719
|
-
} else if (
|
84896
|
+
} else if (dialect4 === "mysql") {
|
84720
84897
|
await prepareAndMigrateMysql2(opts);
|
84721
|
-
} else if (
|
84898
|
+
} else if (dialect4 === "sqlite") {
|
84722
84899
|
await prepareAndMigrateSqlite2(opts);
|
84723
|
-
} else if (
|
84900
|
+
} else if (dialect4 === "turso") {
|
84724
84901
|
await prepareAndMigrateLibSQL2(opts);
|
84725
84902
|
} else {
|
84726
|
-
assertUnreachable(
|
84903
|
+
assertUnreachable(dialect4);
|
84727
84904
|
}
|
84728
84905
|
}
|
84729
84906
|
});
|
@@ -84738,9 +84915,9 @@ var migrate = command({
|
|
84738
84915
|
handler: async (opts) => {
|
84739
84916
|
await assertOrmCoreVersion();
|
84740
84917
|
await assertPackages("drizzle-orm");
|
84741
|
-
const { dialect:
|
84918
|
+
const { dialect: dialect4, schema: schema5, table: table4, out, credentials: credentials2 } = opts;
|
84742
84919
|
try {
|
84743
|
-
if (
|
84920
|
+
if (dialect4 === "postgresql") {
|
84744
84921
|
if ("driver" in credentials2) {
|
84745
84922
|
const { driver: driver2 } = credentials2;
|
84746
84923
|
if (driver2 === "aws-data-api") {
|
@@ -84771,7 +84948,7 @@ var migrate = command({
|
|
84771
84948
|
migrationsSchema: schema5
|
84772
84949
|
})
|
84773
84950
|
);
|
84774
|
-
} else if (
|
84951
|
+
} else if (dialect4 === "mysql") {
|
84775
84952
|
const { connectToMySQL: connectToMySQL2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
|
84776
84953
|
const { migrate: migrate2 } = await connectToMySQL2(credentials2);
|
84777
84954
|
await (0, import_hanji13.renderWithTask)(
|
@@ -84782,7 +84959,7 @@ var migrate = command({
|
|
84782
84959
|
migrationsSchema: schema5
|
84783
84960
|
})
|
84784
84961
|
);
|
84785
|
-
} else if (
|
84962
|
+
} else if (dialect4 === "sqlite") {
|
84786
84963
|
const { connectToSQLite: connectToSQLite2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
|
84787
84964
|
const { migrate: migrate2 } = await connectToSQLite2(credentials2);
|
84788
84965
|
await (0, import_hanji13.renderWithTask)(
|
@@ -84793,7 +84970,7 @@ var migrate = command({
|
|
84793
84970
|
migrationsSchema: schema5
|
84794
84971
|
})
|
84795
84972
|
);
|
84796
|
-
} else if (
|
84973
|
+
} else if (dialect4 === "turso") {
|
84797
84974
|
const { connectToLibSQL: connectToLibSQL2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
|
84798
84975
|
const { migrate: migrate2 } = await connectToLibSQL2(credentials2);
|
84799
84976
|
await (0, import_hanji13.renderWithTask)(
|
@@ -84805,7 +84982,7 @@ var migrate = command({
|
|
84805
84982
|
})
|
84806
84983
|
);
|
84807
84984
|
} else {
|
84808
|
-
assertUnreachable(
|
84985
|
+
assertUnreachable(dialect4);
|
84809
84986
|
}
|
84810
84987
|
} catch (e2) {
|
84811
84988
|
console.error(e2);
|
@@ -84839,6 +85016,7 @@ var push = command({
|
|
84839
85016
|
options: {
|
84840
85017
|
config: optionConfig,
|
84841
85018
|
dialect: optionDialect,
|
85019
|
+
casing: optionCasing,
|
84842
85020
|
schema: string().desc("Path to a schema file or folder"),
|
84843
85021
|
...optionsFilters,
|
84844
85022
|
...optionsDatabaseCredentials,
|
@@ -84867,7 +85045,8 @@ var push = command({
|
|
84867
85045
|
"authToken",
|
84868
85046
|
"schemaFilters",
|
84869
85047
|
"extensionsFilters",
|
84870
|
-
"tablesFilter"
|
85048
|
+
"tablesFilter",
|
85049
|
+
"casing"
|
84871
85050
|
]
|
84872
85051
|
);
|
84873
85052
|
return preparePushConfig(opts, from);
|
@@ -84876,17 +85055,18 @@ var push = command({
|
|
84876
85055
|
await assertPackages("drizzle-orm");
|
84877
85056
|
await assertOrmCoreVersion();
|
84878
85057
|
const {
|
84879
|
-
dialect:
|
85058
|
+
dialect: dialect4,
|
84880
85059
|
schemaPath,
|
84881
85060
|
strict,
|
84882
85061
|
verbose,
|
84883
85062
|
credentials: credentials2,
|
84884
85063
|
tablesFilter,
|
84885
85064
|
schemasFilter,
|
84886
|
-
force
|
85065
|
+
force,
|
85066
|
+
casing: casing2
|
84887
85067
|
} = config;
|
84888
85068
|
try {
|
84889
|
-
if (
|
85069
|
+
if (dialect4 === "mysql") {
|
84890
85070
|
const { mysqlPush: mysqlPush2 } = await Promise.resolve().then(() => (init_push(), push_exports));
|
84891
85071
|
await mysqlPush2(
|
84892
85072
|
schemaPath,
|
@@ -84894,9 +85074,10 @@ var push = command({
|
|
84894
85074
|
tablesFilter,
|
84895
85075
|
strict,
|
84896
85076
|
verbose,
|
84897
|
-
force
|
85077
|
+
force,
|
85078
|
+
casing2
|
84898
85079
|
);
|
84899
|
-
} else if (
|
85080
|
+
} else if (dialect4 === "postgresql") {
|
84900
85081
|
if ("driver" in credentials2) {
|
84901
85082
|
const { driver: driver2 } = credentials2;
|
84902
85083
|
if (driver2 === "aws-data-api") {
|
@@ -84925,9 +85106,10 @@ var push = command({
|
|
84925
85106
|
credentials2,
|
84926
85107
|
tablesFilter,
|
84927
85108
|
schemasFilter,
|
84928
|
-
force
|
85109
|
+
force,
|
85110
|
+
casing2
|
84929
85111
|
);
|
84930
|
-
} else if (
|
85112
|
+
} else if (dialect4 === "sqlite") {
|
84931
85113
|
const { sqlitePush: sqlitePush2 } = await Promise.resolve().then(() => (init_push(), push_exports));
|
84932
85114
|
await sqlitePush2(
|
84933
85115
|
schemaPath,
|
@@ -84935,9 +85117,10 @@ var push = command({
|
|
84935
85117
|
strict,
|
84936
85118
|
credentials2,
|
84937
85119
|
tablesFilter,
|
84938
|
-
force
|
85120
|
+
force,
|
85121
|
+
casing2
|
84939
85122
|
);
|
84940
|
-
} else if (
|
85123
|
+
} else if (dialect4 === "turso") {
|
84941
85124
|
const { libSQLPush: libSQLPush2 } = await Promise.resolve().then(() => (init_push(), push_exports));
|
84942
85125
|
await libSQLPush2(
|
84943
85126
|
schemaPath,
|
@@ -84945,10 +85128,11 @@ var push = command({
|
|
84945
85128
|
strict,
|
84946
85129
|
credentials2,
|
84947
85130
|
tablesFilter,
|
84948
|
-
force
|
85131
|
+
force,
|
85132
|
+
casing2
|
84949
85133
|
);
|
84950
85134
|
} else {
|
84951
|
-
assertUnreachable(
|
85135
|
+
assertUnreachable(dialect4);
|
84952
85136
|
}
|
84953
85137
|
} catch (e2) {
|
84954
85138
|
console.error(e2);
|
@@ -84969,8 +85153,8 @@ var check = command({
|
|
84969
85153
|
},
|
84970
85154
|
handler: async (config) => {
|
84971
85155
|
await assertOrmCoreVersion();
|
84972
|
-
const { out, dialect:
|
84973
|
-
checkHandler(out,
|
85156
|
+
const { out, dialect: dialect4 } = config;
|
85157
|
+
checkHandler(out, dialect4);
|
84974
85158
|
console.log("Everything's fine \u{1F436}\u{1F525}");
|
84975
85159
|
}
|
84976
85160
|
});
|
@@ -84987,15 +85171,15 @@ var up = command({
|
|
84987
85171
|
},
|
84988
85172
|
handler: async (config) => {
|
84989
85173
|
await assertOrmCoreVersion();
|
84990
|
-
const { out, dialect:
|
85174
|
+
const { out, dialect: dialect4 } = config;
|
84991
85175
|
await assertPackages("drizzle-orm");
|
84992
|
-
if (
|
85176
|
+
if (dialect4 === "postgresql") {
|
84993
85177
|
upPgHandler(out);
|
84994
85178
|
}
|
84995
|
-
if (
|
85179
|
+
if (dialect4 === "mysql") {
|
84996
85180
|
upMysqlHandler(out);
|
84997
85181
|
}
|
84998
|
-
if (
|
85182
|
+
if (dialect4 === "sqlite" || dialect4 === "turso") {
|
84999
85183
|
upSqliteHandler(out);
|
85000
85184
|
}
|
85001
85185
|
}
|
@@ -85042,7 +85226,7 @@ var pull = command({
|
|
85042
85226
|
await assertPackages("drizzle-orm");
|
85043
85227
|
await assertOrmCoreVersion();
|
85044
85228
|
const {
|
85045
|
-
dialect:
|
85229
|
+
dialect: dialect4,
|
85046
85230
|
credentials: credentials2,
|
85047
85231
|
out,
|
85048
85232
|
casing: casing2,
|
@@ -85059,7 +85243,7 @@ var pull = command({
|
|
85059
85243
|
);
|
85060
85244
|
console.log();
|
85061
85245
|
try {
|
85062
|
-
if (
|
85246
|
+
if (dialect4 === "postgresql") {
|
85063
85247
|
if ("driver" in credentials2) {
|
85064
85248
|
const { driver: driver2 } = credentials2;
|
85065
85249
|
if (driver2 === "aws-data-api") {
|
@@ -85090,7 +85274,7 @@ var pull = command({
|
|
85090
85274
|
schemasFilter,
|
85091
85275
|
prefix2
|
85092
85276
|
);
|
85093
|
-
} else if (
|
85277
|
+
} else if (dialect4 === "mysql") {
|
85094
85278
|
const { introspectMysql: introspectMysql2 } = await Promise.resolve().then(() => (init_introspect(), introspect_exports));
|
85095
85279
|
await introspectMysql2(
|
85096
85280
|
casing2,
|
@@ -85100,7 +85284,7 @@ var pull = command({
|
|
85100
85284
|
tablesFilter,
|
85101
85285
|
prefix2
|
85102
85286
|
);
|
85103
|
-
} else if (
|
85287
|
+
} else if (dialect4 === "sqlite") {
|
85104
85288
|
const { introspectSqlite: introspectSqlite2 } = await Promise.resolve().then(() => (init_introspect(), introspect_exports));
|
85105
85289
|
await introspectSqlite2(
|
85106
85290
|
casing2,
|
@@ -85110,7 +85294,7 @@ var pull = command({
|
|
85110
85294
|
tablesFilter,
|
85111
85295
|
prefix2
|
85112
85296
|
);
|
85113
|
-
} else if (
|
85297
|
+
} else if (dialect4 === "turso") {
|
85114
85298
|
const { introspectLibSQL: introspectLibSQL2 } = await Promise.resolve().then(() => (init_introspect(), introspect_exports));
|
85115
85299
|
await introspectLibSQL2(
|
85116
85300
|
casing2,
|
@@ -85121,7 +85305,7 @@ var pull = command({
|
|
85121
85305
|
prefix2
|
85122
85306
|
);
|
85123
85307
|
} else {
|
85124
|
-
assertUnreachable(
|
85308
|
+
assertUnreachable(dialect4);
|
85125
85309
|
}
|
85126
85310
|
} catch (e2) {
|
85127
85311
|
console.error(e2);
|
@@ -85159,7 +85343,7 @@ var studio = command({
|
|
85159
85343
|
await assertPackages("drizzle-orm");
|
85160
85344
|
assertStudioNodeVersion();
|
85161
85345
|
const {
|
85162
|
-
dialect:
|
85346
|
+
dialect: dialect4,
|
85163
85347
|
schema: schemaPath,
|
85164
85348
|
port,
|
85165
85349
|
host,
|
@@ -85175,7 +85359,7 @@ var studio = command({
|
|
85175
85359
|
} = await Promise.resolve().then(() => (init_studio2(), studio_exports));
|
85176
85360
|
let setup;
|
85177
85361
|
try {
|
85178
|
-
if (
|
85362
|
+
if (dialect4 === "postgresql") {
|
85179
85363
|
if ("driver" in credentials2) {
|
85180
85364
|
const { driver: driver2 } = credentials2;
|
85181
85365
|
if (driver2 === "aws-data-api") {
|
@@ -85198,17 +85382,17 @@ var studio = command({
|
|
85198
85382
|
}
|
85199
85383
|
const { schema: schema5, relations: relations4, files } = schemaPath ? await preparePgSchema2(schemaPath) : { schema: {}, relations: {}, files: [] };
|
85200
85384
|
setup = await drizzleForPostgres2(credentials2, schema5, relations4, files);
|
85201
|
-
} else if (
|
85385
|
+
} else if (dialect4 === "mysql") {
|
85202
85386
|
const { schema: schema5, relations: relations4, files } = schemaPath ? await prepareMySqlSchema2(schemaPath) : { schema: {}, relations: {}, files: [] };
|
85203
85387
|
setup = await drizzleForMySQL2(credentials2, schema5, relations4, files);
|
85204
|
-
} else if (
|
85388
|
+
} else if (dialect4 === "sqlite") {
|
85205
85389
|
const { schema: schema5, relations: relations4, files } = schemaPath ? await prepareSQLiteSchema2(schemaPath) : { schema: {}, relations: {}, files: [] };
|
85206
85390
|
setup = await drizzleForSQLite2(credentials2, schema5, relations4, files);
|
85207
|
-
} else if (
|
85391
|
+
} else if (dialect4 === "turso") {
|
85208
85392
|
const { schema: schema5, relations: relations4, files } = schemaPath ? await prepareSQLiteSchema2(schemaPath) : { schema: {}, relations: {}, files: [] };
|
85209
85393
|
setup = await drizzleForLibSQL(credentials2, schema5, relations4, files);
|
85210
85394
|
} else {
|
85211
|
-
assertUnreachable(
|
85395
|
+
assertUnreachable(dialect4);
|
85212
85396
|
}
|
85213
85397
|
const { prepareServer: prepareServer2 } = await Promise.resolve().then(() => (init_studio2(), studio_exports));
|
85214
85398
|
const server = await prepareServer2(setup);
|
@@ -85259,7 +85443,7 @@ init_utils2();
|
|
85259
85443
|
var version2 = async () => {
|
85260
85444
|
const { npmVersion } = await ormCoreVersions();
|
85261
85445
|
const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
|
85262
|
-
const envVersion = "0.25.0-
|
85446
|
+
const envVersion = "0.25.0-cb4af54";
|
85263
85447
|
const kitVersion = envVersion ? `v${envVersion}` : "--";
|
85264
85448
|
const versions = `drizzle-kit: ${kitVersion}
|
85265
85449
|
${ormVersion}`;
|