drizzle-kit 0.31.4-3d1846f → 0.31.4-5e97a0a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.js +3 -2
- package/api.mjs +3 -2
- package/bin.cjs +100 -56
- package/package.json +1 -1
package/api.js
CHANGED
@@ -42509,6 +42509,7 @@ var init_studio = __esm({
|
|
42509
42509
|
"use strict";
|
42510
42510
|
init_esm();
|
42511
42511
|
init_schemaValidator();
|
42512
|
+
init_common();
|
42512
42513
|
init_mysql();
|
42513
42514
|
init_postgres();
|
42514
42515
|
init_sqlite();
|
@@ -42524,7 +42525,8 @@ var init_studio = __esm({
|
|
42524
42525
|
});
|
42525
42526
|
studioConfig = objectType({
|
42526
42527
|
dialect: dialect4,
|
42527
|
-
schema: unionType([stringType(), stringType().array()]).optional()
|
42528
|
+
schema: unionType([stringType(), stringType().array()]).optional(),
|
42529
|
+
casing: casingType.optional()
|
42528
42530
|
});
|
42529
42531
|
}
|
42530
42532
|
});
|
@@ -42557,7 +42559,6 @@ var init_utils9 = __esm({
|
|
42557
42559
|
init_cli();
|
42558
42560
|
init_common();
|
42559
42561
|
init_gel();
|
42560
|
-
init_gel();
|
42561
42562
|
init_libsql();
|
42562
42563
|
init_mysql();
|
42563
42564
|
init_outputs();
|
package/api.mjs
CHANGED
@@ -42514,6 +42514,7 @@ var init_studio = __esm({
|
|
42514
42514
|
"use strict";
|
42515
42515
|
init_esm();
|
42516
42516
|
init_schemaValidator();
|
42517
|
+
init_common();
|
42517
42518
|
init_mysql();
|
42518
42519
|
init_postgres();
|
42519
42520
|
init_sqlite();
|
@@ -42529,7 +42530,8 @@ var init_studio = __esm({
|
|
42529
42530
|
});
|
42530
42531
|
studioConfig = objectType({
|
42531
42532
|
dialect: dialect4,
|
42532
|
-
schema: unionType([stringType(), stringType().array()]).optional()
|
42533
|
+
schema: unionType([stringType(), stringType().array()]).optional(),
|
42534
|
+
casing: casingType.optional()
|
42533
42535
|
});
|
42534
42536
|
}
|
42535
42537
|
});
|
@@ -42562,7 +42564,6 @@ var init_utils9 = __esm({
|
|
42562
42564
|
init_cli();
|
42563
42565
|
init_common();
|
42564
42566
|
init_gel();
|
42565
|
-
init_gel();
|
42566
42567
|
init_libsql();
|
42567
42568
|
init_mysql();
|
42568
42569
|
init_outputs();
|
package/bin.cjs
CHANGED
@@ -11266,6 +11266,7 @@ var init_studio = __esm({
|
|
11266
11266
|
"use strict";
|
11267
11267
|
init_esm();
|
11268
11268
|
init_schemaValidator();
|
11269
|
+
init_common();
|
11269
11270
|
init_mysql();
|
11270
11271
|
init_postgres();
|
11271
11272
|
init_sqlite();
|
@@ -11281,7 +11282,8 @@ var init_studio = __esm({
|
|
11281
11282
|
});
|
11282
11283
|
studioConfig = objectType({
|
11283
11284
|
dialect: dialect4,
|
11284
|
-
schema: unionType([stringType(), stringType().array()]).optional()
|
11285
|
+
schema: unionType([stringType(), stringType().array()]).optional(),
|
11286
|
+
casing: casingType.optional()
|
11285
11287
|
});
|
11286
11288
|
}
|
11287
11289
|
});
|
@@ -16942,7 +16944,6 @@ var init_utils3 = __esm({
|
|
16942
16944
|
init_cli();
|
16943
16945
|
init_common();
|
16944
16946
|
init_gel();
|
16945
|
-
init_gel();
|
16946
16947
|
init_libsql();
|
16947
16948
|
init_mysql();
|
16948
16949
|
init_outputs();
|
@@ -17358,7 +17359,7 @@ var init_utils3 = __esm({
|
|
17358
17359
|
process.exit(1);
|
17359
17360
|
}
|
17360
17361
|
const { host, port } = params;
|
17361
|
-
const { dialect: dialect6, schema: schema6 } = result.data;
|
17362
|
+
const { dialect: dialect6, schema: schema6, casing: casing2 } = result.data;
|
17362
17363
|
const flattened = flattenDatabaseCredentials(config);
|
17363
17364
|
if (dialect6 === "postgresql") {
|
17364
17365
|
const parsed = postgresCredentials.safeParse(flattened);
|
@@ -17372,7 +17373,8 @@ var init_utils3 = __esm({
|
|
17372
17373
|
schema: schema6,
|
17373
17374
|
host,
|
17374
17375
|
port,
|
17375
|
-
credentials: credentials2
|
17376
|
+
credentials: credentials2,
|
17377
|
+
casing: casing2
|
17376
17378
|
};
|
17377
17379
|
}
|
17378
17380
|
if (dialect6 === "mysql") {
|
@@ -17387,7 +17389,8 @@ var init_utils3 = __esm({
|
|
17387
17389
|
schema: schema6,
|
17388
17390
|
host,
|
17389
17391
|
port,
|
17390
|
-
credentials: credentials2
|
17392
|
+
credentials: credentials2,
|
17393
|
+
casing: casing2
|
17391
17394
|
};
|
17392
17395
|
}
|
17393
17396
|
if (dialect6 === "singlestore") {
|
@@ -17402,7 +17405,8 @@ var init_utils3 = __esm({
|
|
17402
17405
|
schema: schema6,
|
17403
17406
|
host,
|
17404
17407
|
port,
|
17405
|
-
credentials: credentials2
|
17408
|
+
credentials: credentials2,
|
17409
|
+
casing: casing2
|
17406
17410
|
};
|
17407
17411
|
}
|
17408
17412
|
if (dialect6 === "sqlite") {
|
@@ -17417,7 +17421,8 @@ var init_utils3 = __esm({
|
|
17417
17421
|
schema: schema6,
|
17418
17422
|
host,
|
17419
17423
|
port,
|
17420
|
-
credentials: credentials2
|
17424
|
+
credentials: credentials2,
|
17425
|
+
casing: casing2
|
17421
17426
|
};
|
17422
17427
|
}
|
17423
17428
|
if (dialect6 === "turso") {
|
@@ -17432,7 +17437,8 @@ var init_utils3 = __esm({
|
|
17432
17437
|
schema: schema6,
|
17433
17438
|
host,
|
17434
17439
|
port,
|
17435
|
-
credentials: credentials2
|
17440
|
+
credentials: credentials2,
|
17441
|
+
casing: casing2
|
17436
17442
|
};
|
17437
17443
|
}
|
17438
17444
|
if (dialect6 === "gel") {
|
@@ -91248,7 +91254,7 @@ __export(studio_exports, {
|
|
91248
91254
|
prepareServer: () => prepareServer,
|
91249
91255
|
prepareSingleStoreSchema: () => prepareSingleStoreSchema
|
91250
91256
|
});
|
91251
|
-
var import_crypto9, import_drizzle_orm11,
|
91257
|
+
var import_crypto9, import_drizzle_orm11, import_mysql_core3, import_pg_core3, import_singlestore_core3, import_sqlite_core3, import_fs12, import_node_https2, preparePgSchema, prepareMySqlSchema, prepareSQLiteSchema, prepareSingleStoreSchema, getCustomDefaults, drizzleForPostgres, drizzleForMySQL, drizzleForSQLite, drizzleForLibSQL, drizzleForSingleStore, extractRelations, init, proxySchema, transactionProxySchema, defaultsSchema, schema5, jsonStringify, prepareServer;
|
91252
91258
|
var init_studio2 = __esm({
|
91253
91259
|
"src/serializer/studio.ts"() {
|
91254
91260
|
"use strict";
|
@@ -91256,7 +91262,6 @@ var init_studio2 = __esm({
|
|
91256
91262
|
init_esm2();
|
91257
91263
|
import_crypto9 = require("crypto");
|
91258
91264
|
import_drizzle_orm11 = require("drizzle-orm");
|
91259
|
-
import_drizzle_orm12 = require("drizzle-orm");
|
91260
91265
|
import_mysql_core3 = require("drizzle-orm/mysql-core");
|
91261
91266
|
import_pg_core3 = require("drizzle-orm/pg-core");
|
91262
91267
|
import_singlestore_core3 = require("drizzle-orm/singlestore-core");
|
@@ -91270,6 +91275,7 @@ var init_studio2 = __esm({
|
|
91270
91275
|
init_esm();
|
91271
91276
|
init_utils3();
|
91272
91277
|
init_serializer();
|
91278
|
+
init_utils4();
|
91273
91279
|
preparePgSchema = async (path4) => {
|
91274
91280
|
const imports = prepareFilenames(path4);
|
91275
91281
|
const pgSchema2 = {};
|
@@ -91290,7 +91296,7 @@ var init_studio2 = __esm({
|
|
91290
91296
|
pgSchema2[schema6] = pgSchema2[schema6] || {};
|
91291
91297
|
pgSchema2[schema6][k3] = t4;
|
91292
91298
|
}
|
91293
|
-
if ((0, import_drizzle_orm11.is)(t4,
|
91299
|
+
if ((0, import_drizzle_orm11.is)(t4, import_drizzle_orm11.Relations)) {
|
91294
91300
|
relations5[k3] = t4;
|
91295
91301
|
}
|
91296
91302
|
});
|
@@ -91319,7 +91325,7 @@ var init_studio2 = __esm({
|
|
91319
91325
|
const schema6 = (0, import_mysql_core3.getTableConfig)(t4).schema || "public";
|
91320
91326
|
mysqlSchema3[schema6][k3] = t4;
|
91321
91327
|
}
|
91322
|
-
if ((0, import_drizzle_orm11.is)(t4,
|
91328
|
+
if ((0, import_drizzle_orm11.is)(t4, import_drizzle_orm11.Relations)) {
|
91323
91329
|
relations5[k3] = t4;
|
91324
91330
|
}
|
91325
91331
|
});
|
@@ -91348,7 +91354,7 @@ var init_studio2 = __esm({
|
|
91348
91354
|
const schema6 = "public";
|
91349
91355
|
sqliteSchema2[schema6][k3] = t4;
|
91350
91356
|
}
|
91351
|
-
if ((0, import_drizzle_orm11.is)(t4,
|
91357
|
+
if ((0, import_drizzle_orm11.is)(t4, import_drizzle_orm11.Relations)) {
|
91352
91358
|
relations5[k3] = t4;
|
91353
91359
|
}
|
91354
91360
|
});
|
@@ -91377,7 +91383,7 @@ var init_studio2 = __esm({
|
|
91377
91383
|
const schema6 = (0, import_singlestore_core3.getTableConfig)(t4).schema || "public";
|
91378
91384
|
singlestoreSchema2[schema6][k3] = t4;
|
91379
91385
|
}
|
91380
|
-
if ((0, import_drizzle_orm11.is)(t4,
|
91386
|
+
if ((0, import_drizzle_orm11.is)(t4, import_drizzle_orm11.Relations)) {
|
91381
91387
|
relations5[k3] = t4;
|
91382
91388
|
}
|
91383
91389
|
});
|
@@ -91385,7 +91391,7 @@ var init_studio2 = __esm({
|
|
91385
91391
|
unregister();
|
91386
91392
|
return { schema: singlestoreSchema2, relations: relations5, files };
|
91387
91393
|
};
|
91388
|
-
getCustomDefaults = (schema6) => {
|
91394
|
+
getCustomDefaults = (schema6, casing2) => {
|
91389
91395
|
const customDefaults = [];
|
91390
91396
|
Object.entries(schema6).map(([schema7, tables]) => {
|
91391
91397
|
Object.entries(tables).map(([, table6]) => {
|
@@ -91404,7 +91410,7 @@ var init_studio2 = __esm({
|
|
91404
91410
|
customDefaults.push({
|
91405
91411
|
schema: schema7,
|
91406
91412
|
table: tableConfig.name,
|
91407
|
-
column: column11
|
91413
|
+
column: getColumnCasing(column11, casing2),
|
91408
91414
|
func: column11.defaultFn
|
91409
91415
|
});
|
91410
91416
|
}
|
@@ -91413,10 +91419,10 @@ var init_studio2 = __esm({
|
|
91413
91419
|
});
|
91414
91420
|
return customDefaults;
|
91415
91421
|
};
|
91416
|
-
drizzleForPostgres = async (credentials2, pgSchema2, relations5, schemaFiles) => {
|
91422
|
+
drizzleForPostgres = async (credentials2, pgSchema2, relations5, schemaFiles, casing2) => {
|
91417
91423
|
const { preparePostgresDB: preparePostgresDB2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
|
91418
91424
|
const db = await preparePostgresDB2(credentials2);
|
91419
|
-
const customDefaults = getCustomDefaults(pgSchema2);
|
91425
|
+
const customDefaults = getCustomDefaults(pgSchema2, casing2);
|
91420
91426
|
let dbUrl;
|
91421
91427
|
if ("driver" in credentials2) {
|
91422
91428
|
const { driver: driver2 } = credentials2;
|
@@ -91443,13 +91449,14 @@ var init_studio2 = __esm({
|
|
91443
91449
|
customDefaults,
|
91444
91450
|
schema: pgSchema2,
|
91445
91451
|
relations: relations5,
|
91446
|
-
schemaFiles
|
91452
|
+
schemaFiles,
|
91453
|
+
casing: casing2
|
91447
91454
|
};
|
91448
91455
|
};
|
91449
|
-
drizzleForMySQL = async (credentials2, mysqlSchema3, relations5, schemaFiles) => {
|
91456
|
+
drizzleForMySQL = async (credentials2, mysqlSchema3, relations5, schemaFiles, casing2) => {
|
91450
91457
|
const { connectToMySQL: connectToMySQL2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
|
91451
91458
|
const { proxy, transactionProxy, database, packageName } = await connectToMySQL2(credentials2);
|
91452
|
-
const customDefaults = getCustomDefaults(mysqlSchema3);
|
91459
|
+
const customDefaults = getCustomDefaults(mysqlSchema3, casing2);
|
91453
91460
|
let dbUrl;
|
91454
91461
|
if ("url" in credentials2) {
|
91455
91462
|
dbUrl = credentials2.url;
|
@@ -91467,13 +91474,14 @@ var init_studio2 = __esm({
|
|
91467
91474
|
customDefaults,
|
91468
91475
|
schema: mysqlSchema3,
|
91469
91476
|
relations: relations5,
|
91470
|
-
schemaFiles
|
91477
|
+
schemaFiles,
|
91478
|
+
casing: casing2
|
91471
91479
|
};
|
91472
91480
|
};
|
91473
|
-
drizzleForSQLite = async (credentials2, sqliteSchema2, relations5, schemaFiles) => {
|
91481
|
+
drizzleForSQLite = async (credentials2, sqliteSchema2, relations5, schemaFiles, casing2) => {
|
91474
91482
|
const { connectToSQLite: connectToSQLite2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
|
91475
91483
|
const sqliteDB = await connectToSQLite2(credentials2);
|
91476
|
-
const customDefaults = getCustomDefaults(sqliteSchema2);
|
91484
|
+
const customDefaults = getCustomDefaults(sqliteSchema2, casing2);
|
91477
91485
|
let dbUrl;
|
91478
91486
|
if ("driver" in credentials2) {
|
91479
91487
|
const { driver: driver2 } = credentials2;
|
@@ -91496,13 +91504,14 @@ var init_studio2 = __esm({
|
|
91496
91504
|
customDefaults,
|
91497
91505
|
schema: sqliteSchema2,
|
91498
91506
|
relations: relations5,
|
91499
|
-
schemaFiles
|
91507
|
+
schemaFiles,
|
91508
|
+
casing: casing2
|
91500
91509
|
};
|
91501
91510
|
};
|
91502
|
-
drizzleForLibSQL = async (credentials2, sqliteSchema2, relations5, schemaFiles) => {
|
91511
|
+
drizzleForLibSQL = async (credentials2, sqliteSchema2, relations5, schemaFiles, casing2) => {
|
91503
91512
|
const { connectToLibSQL: connectToLibSQL2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
|
91504
91513
|
const sqliteDB = await connectToLibSQL2(credentials2);
|
91505
|
-
const customDefaults = getCustomDefaults(sqliteSchema2);
|
91514
|
+
const customDefaults = getCustomDefaults(sqliteSchema2, casing2);
|
91506
91515
|
let dbUrl = `turso://${credentials2.url}/${credentials2.authToken}`;
|
91507
91516
|
const dbHash = (0, import_crypto9.createHash)("sha256").update(dbUrl).digest("hex");
|
91508
91517
|
return {
|
@@ -91515,13 +91524,14 @@ var init_studio2 = __esm({
|
|
91515
91524
|
customDefaults,
|
91516
91525
|
schema: sqliteSchema2,
|
91517
91526
|
relations: relations5,
|
91518
|
-
schemaFiles
|
91527
|
+
schemaFiles,
|
91528
|
+
casing: casing2
|
91519
91529
|
};
|
91520
91530
|
};
|
91521
|
-
drizzleForSingleStore = async (credentials2, singlestoreSchema2, relations5, schemaFiles) => {
|
91531
|
+
drizzleForSingleStore = async (credentials2, singlestoreSchema2, relations5, schemaFiles, casing2) => {
|
91522
91532
|
const { connectToSingleStore: connectToSingleStore2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
|
91523
91533
|
const { proxy, transactionProxy, database, packageName } = await connectToSingleStore2(credentials2);
|
91524
|
-
const customDefaults = getCustomDefaults(singlestoreSchema2);
|
91534
|
+
const customDefaults = getCustomDefaults(singlestoreSchema2, casing2);
|
91525
91535
|
let dbUrl;
|
91526
91536
|
if ("url" in credentials2) {
|
91527
91537
|
dbUrl = credentials2.url;
|
@@ -91539,14 +91549,15 @@ var init_studio2 = __esm({
|
|
91539
91549
|
customDefaults,
|
91540
91550
|
schema: singlestoreSchema2,
|
91541
91551
|
relations: relations5,
|
91542
|
-
schemaFiles
|
91552
|
+
schemaFiles,
|
91553
|
+
casing: casing2
|
91543
91554
|
};
|
91544
91555
|
};
|
91545
|
-
extractRelations = (tablesConfig) => {
|
91556
|
+
extractRelations = (tablesConfig, casing2) => {
|
91546
91557
|
const relations5 = Object.values(tablesConfig.tables).map(
|
91547
91558
|
(it) => Object.entries(it.relations).map(([name, relation]) => {
|
91548
91559
|
try {
|
91549
|
-
const normalized = (0,
|
91560
|
+
const normalized = (0, import_drizzle_orm11.normalizeRelation)(
|
91550
91561
|
tablesConfig.tables,
|
91551
91562
|
tablesConfig.tableNamesMap,
|
91552
91563
|
relation
|
@@ -91554,8 +91565,8 @@ var init_studio2 = __esm({
|
|
91554
91565
|
const rel = relation;
|
91555
91566
|
const refTableName = rel.referencedTableName;
|
91556
91567
|
const refTable = rel.referencedTable;
|
91557
|
-
const fields = normalized.fields.map((it2) => it2
|
91558
|
-
const refColumns = normalized.references.map((it2) => it2
|
91568
|
+
const fields = normalized.fields.map((it2) => getColumnCasing(it2, casing2)).flat();
|
91569
|
+
const refColumns = normalized.references.map((it2) => getColumnCasing(it2, casing2)).flat();
|
91559
91570
|
let refSchema;
|
91560
91571
|
if ((0, import_drizzle_orm11.is)(refTable, import_pg_core3.PgTable)) {
|
91561
91572
|
refSchema = (0, import_pg_core3.getTableConfig)(refTable).schema;
|
@@ -91569,9 +91580,9 @@ var init_studio2 = __esm({
|
|
91569
91580
|
throw new Error("unsupported dialect");
|
91570
91581
|
}
|
91571
91582
|
let type;
|
91572
|
-
if ((0, import_drizzle_orm11.is)(rel,
|
91583
|
+
if ((0, import_drizzle_orm11.is)(rel, import_drizzle_orm11.One)) {
|
91573
91584
|
type = "one";
|
91574
|
-
} else if ((0, import_drizzle_orm11.is)(rel,
|
91585
|
+
} else if ((0, import_drizzle_orm11.is)(rel, import_drizzle_orm11.Many)) {
|
91575
91586
|
type = "many";
|
91576
91587
|
} else {
|
91577
91588
|
throw new Error("unsupported relation type");
|
@@ -91605,14 +91616,26 @@ var init_studio2 = __esm({
|
|
91605
91616
|
params: external_exports.array(external_exports.any()).optional(),
|
91606
91617
|
typings: external_exports.string().array().optional(),
|
91607
91618
|
mode: external_exports.enum(["array", "object"]).default("object"),
|
91608
|
-
method: external_exports.union([
|
91619
|
+
method: external_exports.union([
|
91620
|
+
external_exports.literal("values"),
|
91621
|
+
external_exports.literal("get"),
|
91622
|
+
external_exports.literal("all"),
|
91623
|
+
external_exports.literal("run"),
|
91624
|
+
external_exports.literal("execute")
|
91625
|
+
])
|
91609
91626
|
})
|
91610
91627
|
});
|
91611
91628
|
transactionProxySchema = external_exports.object({
|
91612
91629
|
type: external_exports.literal("tproxy"),
|
91613
91630
|
data: external_exports.object({
|
91614
91631
|
sql: external_exports.string(),
|
91615
|
-
method: external_exports.union([
|
91632
|
+
method: external_exports.union([
|
91633
|
+
external_exports.literal("values"),
|
91634
|
+
external_exports.literal("get"),
|
91635
|
+
external_exports.literal("all"),
|
91636
|
+
external_exports.literal("run"),
|
91637
|
+
external_exports.literal("execute")
|
91638
|
+
]).optional()
|
91616
91639
|
}).array()
|
91617
91640
|
});
|
91618
91641
|
defaultsSchema = external_exports.object({
|
@@ -91625,7 +91648,12 @@ var init_studio2 = __esm({
|
|
91625
91648
|
})
|
91626
91649
|
).min(1)
|
91627
91650
|
});
|
91628
|
-
schema5 = external_exports.union([
|
91651
|
+
schema5 = external_exports.union([
|
91652
|
+
init,
|
91653
|
+
proxySchema,
|
91654
|
+
transactionProxySchema,
|
91655
|
+
defaultsSchema
|
91656
|
+
]);
|
91629
91657
|
jsonStringify = (data) => {
|
91630
91658
|
return JSON.stringify(data, (_key, value) => {
|
91631
91659
|
if (value instanceof Error) {
|
@@ -91653,6 +91681,7 @@ var init_studio2 = __esm({
|
|
91653
91681
|
schema: drizzleSchema,
|
91654
91682
|
relations: relations5,
|
91655
91683
|
dbHash,
|
91684
|
+
casing: casing2,
|
91656
91685
|
schemaFiles
|
91657
91686
|
}, app) => {
|
91658
91687
|
app = app !== void 0 ? app : new Hono2();
|
@@ -91672,15 +91701,20 @@ var init_studio2 = __esm({
|
|
91672
91701
|
const relationalSchema = {
|
91673
91702
|
...Object.fromEntries(
|
91674
91703
|
Object.entries(drizzleSchema).map(([schemaName, schema6]) => {
|
91675
|
-
const mappedTableEntries = Object.entries(schema6).map(
|
91676
|
-
|
91677
|
-
|
91704
|
+
const mappedTableEntries = Object.entries(schema6).map(
|
91705
|
+
([tableName, table6]) => {
|
91706
|
+
return [`__${schemaName}__.${tableName}`, table6];
|
91707
|
+
}
|
91708
|
+
);
|
91678
91709
|
return mappedTableEntries;
|
91679
91710
|
}).flat()
|
91680
91711
|
),
|
91681
91712
|
...relations5
|
91682
91713
|
};
|
91683
|
-
const relationsConfig = (0,
|
91714
|
+
const relationsConfig = (0, import_drizzle_orm11.extractTablesRelationalConfig)(
|
91715
|
+
relationalSchema,
|
91716
|
+
import_drizzle_orm11.createTableRelationsHelpers
|
91717
|
+
);
|
91684
91718
|
app.post("/", zValidator("json", schema5), async (c3) => {
|
91685
91719
|
const body = c3.req.valid("json");
|
91686
91720
|
const { type } = body;
|
@@ -91692,11 +91726,17 @@ var init_studio2 = __esm({
|
|
91692
91726
|
}));
|
91693
91727
|
let relations6 = [];
|
91694
91728
|
try {
|
91695
|
-
relations6 = extractRelations(relationsConfig);
|
91729
|
+
relations6 = extractRelations(relationsConfig, casing2);
|
91696
91730
|
} catch (error2) {
|
91697
|
-
console.warn(
|
91698
|
-
|
91699
|
-
|
91731
|
+
console.warn(
|
91732
|
+
"Failed to extract relations. This is likely due to ambiguous or misconfigured relations."
|
91733
|
+
);
|
91734
|
+
console.warn(
|
91735
|
+
"Please check your schema and ensure that all relations are correctly defined."
|
91736
|
+
);
|
91737
|
+
console.warn(
|
91738
|
+
"See: https://orm.drizzle.team/docs/relations#disambiguating-relations"
|
91739
|
+
);
|
91700
91740
|
console.warn("Error message:", error2.message);
|
91701
91741
|
}
|
91702
91742
|
return c3.json({
|
@@ -91729,7 +91769,9 @@ var init_studio2 = __esm({
|
|
91729
91769
|
return d3.schema === column11.schema && d3.table === column11.table && d3.column === column11.column;
|
91730
91770
|
});
|
91731
91771
|
if (!found) {
|
91732
|
-
throw new Error(
|
91772
|
+
throw new Error(
|
91773
|
+
`Custom default not found for ${column11.schema}.${column11.table}.${column11.column}`
|
91774
|
+
);
|
91733
91775
|
}
|
91734
91776
|
const value = found.func();
|
91735
91777
|
return {
|
@@ -94113,7 +94155,8 @@ var studio = command2({
|
|
94113
94155
|
schema: schemaPath,
|
94114
94156
|
port,
|
94115
94157
|
host,
|
94116
|
-
credentials: credentials2
|
94158
|
+
credentials: credentials2,
|
94159
|
+
casing: casing2
|
94117
94160
|
} = await prepareStudioConfig(opts);
|
94118
94161
|
const {
|
94119
94162
|
drizzleForPostgres: drizzleForPostgres2,
|
@@ -94150,23 +94193,24 @@ var studio = command2({
|
|
94150
94193
|
}
|
94151
94194
|
}
|
94152
94195
|
const { schema: schema6, relations: relations5, files } = schemaPath ? await preparePgSchema2(schemaPath) : { schema: {}, relations: {}, files: [] };
|
94153
|
-
setup = await drizzleForPostgres2(credentials2, schema6, relations5, files);
|
94196
|
+
setup = await drizzleForPostgres2(credentials2, schema6, relations5, files, casing2);
|
94154
94197
|
} else if (dialect6 === "mysql") {
|
94155
94198
|
const { schema: schema6, relations: relations5, files } = schemaPath ? await prepareMySqlSchema2(schemaPath) : { schema: {}, relations: {}, files: [] };
|
94156
|
-
setup = await drizzleForMySQL2(credentials2, schema6, relations5, files);
|
94199
|
+
setup = await drizzleForMySQL2(credentials2, schema6, relations5, files, casing2);
|
94157
94200
|
} else if (dialect6 === "sqlite") {
|
94158
94201
|
const { schema: schema6, relations: relations5, files } = schemaPath ? await prepareSQLiteSchema2(schemaPath) : { schema: {}, relations: {}, files: [] };
|
94159
|
-
setup = await drizzleForSQLite2(credentials2, schema6, relations5, files);
|
94202
|
+
setup = await drizzleForSQLite2(credentials2, schema6, relations5, files, casing2);
|
94160
94203
|
} else if (dialect6 === "turso") {
|
94161
94204
|
const { schema: schema6, relations: relations5, files } = schemaPath ? await prepareSQLiteSchema2(schemaPath) : { schema: {}, relations: {}, files: [] };
|
94162
|
-
setup = await drizzleForLibSQL2(credentials2, schema6, relations5, files);
|
94205
|
+
setup = await drizzleForLibSQL2(credentials2, schema6, relations5, files, casing2);
|
94163
94206
|
} else if (dialect6 === "singlestore") {
|
94164
94207
|
const { schema: schema6, relations: relations5, files } = schemaPath ? await prepareSingleStoreSchema2(schemaPath) : { schema: {}, relations: {}, files: [] };
|
94165
94208
|
setup = await drizzleForSingleStore2(
|
94166
94209
|
credentials2,
|
94167
94210
|
schema6,
|
94168
94211
|
relations5,
|
94169
|
-
files
|
94212
|
+
files,
|
94213
|
+
casing2
|
94170
94214
|
);
|
94171
94215
|
} else if (dialect6 === "gel") {
|
94172
94216
|
console.log(
|
@@ -94273,7 +94317,7 @@ init_utils5();
|
|
94273
94317
|
var version2 = async () => {
|
94274
94318
|
const { npmVersion } = await ormCoreVersions();
|
94275
94319
|
const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
|
94276
|
-
const envVersion = "0.31.4-
|
94320
|
+
const envVersion = "0.31.4-5e97a0a";
|
94277
94321
|
const kitVersion = envVersion ? `v${envVersion}` : "--";
|
94278
94322
|
const versions = `drizzle-kit: ${kitVersion}
|
94279
94323
|
${ormVersion}`;
|