drizzle-kit 1.0.0-beta.1-f77460a → 1.0.0-beta.1-fca6ce7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api.d.mts +1 -265
- package/api.d.ts +1 -265
- package/api.js +44396 -163362
- package/api.mjs +44375 -163331
- package/bin.cjs +28 -42
- package/package.json +1 -1
package/bin.cjs
CHANGED
|
@@ -18457,12 +18457,11 @@ __export(pgImports_exports, {
|
|
|
18457
18457
|
prepareFromExports: () => prepareFromExports2,
|
|
18458
18458
|
prepareFromPgImports: () => prepareFromPgImports
|
|
18459
18459
|
});
|
|
18460
|
-
var import_drizzle_orm3,
|
|
18460
|
+
var import_drizzle_orm3, import_pg_core, prepareFromExports2, prepareFromPgImports;
|
|
18461
18461
|
var init_pgImports = __esm({
|
|
18462
18462
|
"src/serializer/pgImports.ts"() {
|
|
18463
18463
|
"use strict";
|
|
18464
18464
|
import_drizzle_orm3 = require("drizzle-orm");
|
|
18465
|
-
import_relations = require("drizzle-orm/_relations");
|
|
18466
18465
|
import_pg_core = require("drizzle-orm/pg-core");
|
|
18467
18466
|
init_utils3();
|
|
18468
18467
|
prepareFromExports2 = (exports2) => {
|
|
@@ -18474,7 +18473,6 @@ var init_pgImports = __esm({
|
|
|
18474
18473
|
const policies = [];
|
|
18475
18474
|
const views = [];
|
|
18476
18475
|
const matViews = [];
|
|
18477
|
-
const relations5 = [];
|
|
18478
18476
|
const i0values = Object.values(exports2);
|
|
18479
18477
|
i0values.forEach((t4) => {
|
|
18480
18478
|
if ((0, import_pg_core.isPgEnum)(t4)) {
|
|
@@ -18502,11 +18500,8 @@ var init_pgImports = __esm({
|
|
|
18502
18500
|
if ((0, import_drizzle_orm3.is)(t4, import_pg_core.PgPolicy)) {
|
|
18503
18501
|
policies.push(t4);
|
|
18504
18502
|
}
|
|
18505
|
-
if ((0, import_drizzle_orm3.is)(t4, import_relations.Relations)) {
|
|
18506
|
-
relations5.push(t4);
|
|
18507
|
-
}
|
|
18508
18503
|
});
|
|
18509
|
-
return { tables, enums, schemas, sequences, views, matViews, roles, policies
|
|
18504
|
+
return { tables, enums, schemas, sequences, views, matViews, roles, policies };
|
|
18510
18505
|
};
|
|
18511
18506
|
prepareFromPgImports = async (imports) => {
|
|
18512
18507
|
const tables = [];
|
|
@@ -18517,7 +18512,6 @@ var init_pgImports = __esm({
|
|
|
18517
18512
|
const roles = [];
|
|
18518
18513
|
const policies = [];
|
|
18519
18514
|
const matViews = [];
|
|
18520
|
-
const relations5 = [];
|
|
18521
18515
|
const { unregister } = await safeRegister();
|
|
18522
18516
|
for (let i4 = 0; i4 < imports.length; i4++) {
|
|
18523
18517
|
const it = imports[i4];
|
|
@@ -18531,20 +18525,9 @@ var init_pgImports = __esm({
|
|
|
18531
18525
|
matViews.push(...prepared.matViews);
|
|
18532
18526
|
roles.push(...prepared.roles);
|
|
18533
18527
|
policies.push(...prepared.policies);
|
|
18534
|
-
relations5.push(...prepared.relations);
|
|
18535
18528
|
}
|
|
18536
18529
|
unregister();
|
|
18537
|
-
return {
|
|
18538
|
-
tables: Array.from(new Set(tables)),
|
|
18539
|
-
enums,
|
|
18540
|
-
schemas,
|
|
18541
|
-
sequences,
|
|
18542
|
-
views,
|
|
18543
|
-
matViews,
|
|
18544
|
-
roles,
|
|
18545
|
-
policies,
|
|
18546
|
-
relations: relations5
|
|
18547
|
-
};
|
|
18530
|
+
return { tables: Array.from(new Set(tables)), enums, schemas, sequences, views, matViews, roles, policies };
|
|
18548
18531
|
};
|
|
18549
18532
|
}
|
|
18550
18533
|
});
|
|
@@ -21514,7 +21497,7 @@ ${filenames.join("\n")}
|
|
|
21514
21497
|
});
|
|
21515
21498
|
|
|
21516
21499
|
// src/migrationPreparator.ts
|
|
21517
|
-
var import_crypto, import_fs5, prepareMySqlDbPushSnapshot, prepareSingleStoreDbPushSnapshot, prepareSQLiteDbPushSnapshot, prepareMySqlMigrationSnapshot, prepareSingleStoreMigrationSnapshot, prepareSqliteMigrationSnapshot, preparePgMigrationSnapshot, preparePrevSnapshot;
|
|
21500
|
+
var import_crypto, import_fs5, prepareMySqlDbPushSnapshot, prepareSingleStoreDbPushSnapshot, prepareSQLiteDbPushSnapshot, prepareMySqlMigrationSnapshot, prepareSingleStoreMigrationSnapshot, prepareSqliteMigrationSnapshot, fillPgSnapshot, preparePgMigrationSnapshot, preparePrevSnapshot;
|
|
21518
21501
|
var init_migrationPreparator = __esm({
|
|
21519
21502
|
"src/migrationPreparator.ts"() {
|
|
21520
21503
|
"use strict";
|
|
@@ -21612,6 +21595,13 @@ var init_migrationPreparator = __esm({
|
|
|
21612
21595
|
};
|
|
21613
21596
|
return { prev: prevSnapshot, cur: result, custom: custom2 };
|
|
21614
21597
|
};
|
|
21598
|
+
fillPgSnapshot = ({
|
|
21599
|
+
serialized,
|
|
21600
|
+
id,
|
|
21601
|
+
idPrev
|
|
21602
|
+
}) => {
|
|
21603
|
+
return { id, prevId: idPrev, ...serialized };
|
|
21604
|
+
};
|
|
21615
21605
|
preparePgMigrationSnapshot = async (snapshots, schemaPath, casing2) => {
|
|
21616
21606
|
const prevSnapshot = pgSchema.parse(preparePrevSnapshot(snapshots, dryPg));
|
|
21617
21607
|
const serialized = await serializePg(schemaPath, casing2);
|
|
@@ -21619,11 +21609,7 @@ var init_migrationPreparator = __esm({
|
|
|
21619
21609
|
const idPrev = prevSnapshot.id;
|
|
21620
21610
|
const result = { id, prevId: idPrev, ...serialized };
|
|
21621
21611
|
const { id: _ignoredId, prevId: _ignoredPrevId, ...prevRest } = prevSnapshot;
|
|
21622
|
-
const custom2 = {
|
|
21623
|
-
id,
|
|
21624
|
-
prevId: idPrev,
|
|
21625
|
-
...prevRest
|
|
21626
|
-
};
|
|
21612
|
+
const custom2 = fillPgSnapshot({ serialized: prevRest, id, idPrev });
|
|
21627
21613
|
return { prev: prevSnapshot, cur: result, custom: custom2 };
|
|
21628
21614
|
};
|
|
21629
21615
|
preparePrevSnapshot = (snapshots, defaultPrev) => {
|
|
@@ -82281,7 +82267,7 @@ var init_connections = __esm({
|
|
|
82281
82267
|
const { PGlite, types: types3 } = await import("@electric-sql/pglite");
|
|
82282
82268
|
const { drizzle } = await import("drizzle-orm/pglite");
|
|
82283
82269
|
const { migrate: migrate2 } = await import("drizzle-orm/pglite/migrator");
|
|
82284
|
-
const pglite =
|
|
82270
|
+
const pglite = new PGlite(normalisePGliteUrl(credentials2.url));
|
|
82285
82271
|
await pglite.waitReady;
|
|
82286
82272
|
const drzl = drizzle(pglite);
|
|
82287
82273
|
const migrateFn = async (config) => {
|
|
@@ -88509,12 +88495,12 @@ function generateIdentityParams2(identity) {
|
|
|
88509
88495
|
}
|
|
88510
88496
|
return `.generatedByDefaultAsIdentity(${paramsObj})`;
|
|
88511
88497
|
}
|
|
88512
|
-
var import_drizzle_orm10,
|
|
88498
|
+
var import_drizzle_orm10, import_relations, import_casing5, pgImportsList, timeConfig2, possibleIntervals, intervalStrToObj, intervalConfig, mapColumnDefault4, importsPatch2, relations4, escapeColumnKey4, withCasing3, dbColumnName4, paramNameFor2, schemaToTypeScript4, isCyclic4, isSelf4, buildArrayDefault2, mapDefault2, column9, dimensionsInArray2, createTableColumns4, createTableIndexes4, createTablePKs4, createTablePolicies2, createTableUniques4, createTableChecks4, createTableFKs4;
|
|
88513
88499
|
var init_introspect_pg = __esm({
|
|
88514
88500
|
"src/introspect-pg.ts"() {
|
|
88515
88501
|
"use strict";
|
|
88516
88502
|
import_drizzle_orm10 = require("drizzle-orm");
|
|
88517
|
-
|
|
88503
|
+
import_relations = require("drizzle-orm/_relations");
|
|
88518
88504
|
init_utils();
|
|
88519
88505
|
import_casing5 = require("drizzle-orm/casing");
|
|
88520
88506
|
init_global();
|
|
@@ -93160,7 +93146,7 @@ __export(studio_exports, {
|
|
|
93160
93146
|
prepareServer: () => prepareServer,
|
|
93161
93147
|
prepareSingleStoreSchema: () => prepareSingleStoreSchema
|
|
93162
93148
|
});
|
|
93163
|
-
var import_crypto9, import_drizzle_orm11,
|
|
93149
|
+
var import_crypto9, import_drizzle_orm11, import_relations2, 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;
|
|
93164
93150
|
var init_studio2 = __esm({
|
|
93165
93151
|
"src/serializer/studio.ts"() {
|
|
93166
93152
|
"use strict";
|
|
@@ -93168,7 +93154,7 @@ var init_studio2 = __esm({
|
|
|
93168
93154
|
init_esm2();
|
|
93169
93155
|
import_crypto9 = require("crypto");
|
|
93170
93156
|
import_drizzle_orm11 = require("drizzle-orm");
|
|
93171
|
-
|
|
93157
|
+
import_relations2 = require("drizzle-orm/_relations");
|
|
93172
93158
|
import_mysql_core3 = require("drizzle-orm/mysql-core");
|
|
93173
93159
|
import_pg_core3 = require("drizzle-orm/pg-core");
|
|
93174
93160
|
import_singlestore_core3 = require("drizzle-orm/singlestore-core");
|
|
@@ -93203,7 +93189,7 @@ var init_studio2 = __esm({
|
|
|
93203
93189
|
pgSchema2[schema6] = pgSchema2[schema6] || {};
|
|
93204
93190
|
pgSchema2[schema6][k3] = t4;
|
|
93205
93191
|
}
|
|
93206
|
-
if ((0, import_drizzle_orm11.is)(t4,
|
|
93192
|
+
if ((0, import_drizzle_orm11.is)(t4, import_relations2.Relations)) {
|
|
93207
93193
|
relations5[k3] = t4;
|
|
93208
93194
|
}
|
|
93209
93195
|
});
|
|
@@ -93232,7 +93218,7 @@ var init_studio2 = __esm({
|
|
|
93232
93218
|
const schema6 = (0, import_mysql_core3.getTableConfig)(t4).schema || "public";
|
|
93233
93219
|
mysqlSchema3[schema6][k3] = t4;
|
|
93234
93220
|
}
|
|
93235
|
-
if ((0, import_drizzle_orm11.is)(t4,
|
|
93221
|
+
if ((0, import_drizzle_orm11.is)(t4, import_relations2.Relations)) {
|
|
93236
93222
|
relations5[k3] = t4;
|
|
93237
93223
|
}
|
|
93238
93224
|
});
|
|
@@ -93261,7 +93247,7 @@ var init_studio2 = __esm({
|
|
|
93261
93247
|
const schema6 = "public";
|
|
93262
93248
|
sqliteSchema2[schema6][k3] = t4;
|
|
93263
93249
|
}
|
|
93264
|
-
if ((0, import_drizzle_orm11.is)(t4,
|
|
93250
|
+
if ((0, import_drizzle_orm11.is)(t4, import_relations2.Relations)) {
|
|
93265
93251
|
relations5[k3] = t4;
|
|
93266
93252
|
}
|
|
93267
93253
|
});
|
|
@@ -93290,7 +93276,7 @@ var init_studio2 = __esm({
|
|
|
93290
93276
|
const schema6 = (0, import_singlestore_core3.getTableConfig)(t4).schema || "public";
|
|
93291
93277
|
singlestoreSchema2[schema6][k3] = t4;
|
|
93292
93278
|
}
|
|
93293
|
-
if ((0, import_drizzle_orm11.is)(t4,
|
|
93279
|
+
if ((0, import_drizzle_orm11.is)(t4, import_relations2.Relations)) {
|
|
93294
93280
|
relations5[k3] = t4;
|
|
93295
93281
|
}
|
|
93296
93282
|
});
|
|
@@ -93336,7 +93322,7 @@ var init_studio2 = __esm({
|
|
|
93336
93322
|
if (driver2 === "aws-data-api") {
|
|
93337
93323
|
dbUrl = `aws-data-api://${credentials2.database}/${credentials2.secretArn}/${credentials2.resourceArn}`;
|
|
93338
93324
|
} else if (driver2 === "pglite") {
|
|
93339
|
-
dbUrl =
|
|
93325
|
+
dbUrl = credentials2.url;
|
|
93340
93326
|
} else {
|
|
93341
93327
|
assertUnreachable(driver2);
|
|
93342
93328
|
}
|
|
@@ -93464,7 +93450,7 @@ var init_studio2 = __esm({
|
|
|
93464
93450
|
const relations5 = Object.values(tablesConfig.tables).map(
|
|
93465
93451
|
(it) => Object.entries(it.relations).map(([name, relation]) => {
|
|
93466
93452
|
try {
|
|
93467
|
-
const normalized = (0,
|
|
93453
|
+
const normalized = (0, import_relations2.normalizeRelation)(
|
|
93468
93454
|
tablesConfig.tables,
|
|
93469
93455
|
tablesConfig.tableNamesMap,
|
|
93470
93456
|
relation
|
|
@@ -93487,9 +93473,9 @@ var init_studio2 = __esm({
|
|
|
93487
93473
|
throw new Error("unsupported dialect");
|
|
93488
93474
|
}
|
|
93489
93475
|
let type;
|
|
93490
|
-
if ((0, import_drizzle_orm11.is)(rel,
|
|
93476
|
+
if ((0, import_drizzle_orm11.is)(rel, import_relations2.One)) {
|
|
93491
93477
|
type = "one";
|
|
93492
|
-
} else if ((0, import_drizzle_orm11.is)(rel,
|
|
93478
|
+
} else if ((0, import_drizzle_orm11.is)(rel, import_relations2.Many)) {
|
|
93493
93479
|
type = "many";
|
|
93494
93480
|
} else {
|
|
93495
93481
|
throw new Error("unsupported relation type");
|
|
@@ -93618,9 +93604,9 @@ var init_studio2 = __esm({
|
|
|
93618
93604
|
),
|
|
93619
93605
|
...relations5
|
|
93620
93606
|
};
|
|
93621
|
-
const relationsConfig = (0,
|
|
93607
|
+
const relationsConfig = (0, import_relations2.extractTablesRelationalConfig)(
|
|
93622
93608
|
relationalSchema,
|
|
93623
|
-
|
|
93609
|
+
import_relations2.createTableRelationsHelpers
|
|
93624
93610
|
);
|
|
93625
93611
|
app.post("/", zValidator("json", schema5), async (c3) => {
|
|
93626
93612
|
const body = c3.req.valid("json");
|
|
@@ -96224,7 +96210,7 @@ init_utils5();
|
|
|
96224
96210
|
var version2 = async () => {
|
|
96225
96211
|
const { npmVersion } = await ormCoreVersions();
|
|
96226
96212
|
const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
|
|
96227
|
-
const envVersion = "1.0.0-beta.1-
|
|
96213
|
+
const envVersion = "1.0.0-beta.1-fca6ce7";
|
|
96228
96214
|
const kitVersion = envVersion ? `v${envVersion}` : "--";
|
|
96229
96215
|
const versions = `drizzle-kit: ${kitVersion}
|
|
96230
96216
|
${ormVersion}`;
|