drizzle-kit 0.22.7 → 0.22.9-92953ac

Sign up to get free protection for your applications and to get access to all the features.
package/bin.cjs CHANGED
@@ -27624,7 +27624,7 @@ var init_jsonStatements = __esm({
27624
27624
  tableName,
27625
27625
  data: it,
27626
27626
  schema: schema5,
27627
- constraintName: json1.tables[`${schema5}.${tableName}`].compositePrimaryKeys[PgSquasher.unsquashPK(it).name].name
27627
+ constraintName: json1.tables[`${schema5 || "public"}.${tableName}`].compositePrimaryKeys[PgSquasher.unsquashPK(it).name].name
27628
27628
  };
27629
27629
  });
27630
27630
  };
@@ -129537,7 +129537,7 @@ var printVersions = async () => {
129537
129537
  var versions = async () => {
129538
129538
  const { npmVersion } = await ormCoreVersions();
129539
129539
  const ormVersion = npmVersion ? `drizzle-orm: v${npmVersion}` : "";
129540
- const envVersion = "0.22.7";
129540
+ const envVersion = "0.22.9";
129541
129541
  const kitVersion = envVersion ? `v${envVersion}` : "--";
129542
129542
  const versions2 = `drizzle-kit: ${kitVersion}
129543
129543
  ${ormVersion}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.22.7",
3
+ "version": "0.22.9-92953ac",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Drizzle Team",
6
6
  "license": "MIT",
package/payload.d.mts CHANGED
@@ -2,7 +2,7 @@ import { PgDatabase } from 'drizzle-orm/pg-core';
2
2
  import * as zod from 'zod';
3
3
  import { TypeOf } from 'zod';
4
4
  import { MySql2Database } from 'drizzle-orm/mysql2';
5
- import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
5
+ import { LibSQLDatabase } from 'drizzle-orm/libsql';
6
6
 
7
7
  declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
8
8
  version: zod.ZodLiteral<"7">;
@@ -1138,9 +1138,9 @@ type MySqlSchema = TypeOf<typeof schema>;
1138
1138
  type DrizzleSnapshotJSON = PgSchema;
1139
1139
  type DrizzleSQLiteSnapshotJSON = SQLiteSchema;
1140
1140
  type DrizzleMySQLSnapshotJSON = MySqlSchema;
1141
- declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => PgSchema;
1141
+ declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string, schemaFilters?: string[]) => PgSchema;
1142
1142
  declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
1143
- declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>) => Promise<{
1143
+ declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>, schemaFilters?: string[]) => Promise<{
1144
1144
  hasDataLoss: boolean;
1145
1145
  warnings: string[];
1146
1146
  statementsToExecute: string[];
@@ -1148,7 +1148,7 @@ declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: Pg
1148
1148
  }>;
1149
1149
  declare const generateSQLiteDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<SQLiteSchema>;
1150
1150
  declare const generateSQLiteMigration: (prev: DrizzleSQLiteSnapshotJSON, cur: DrizzleSQLiteSnapshotJSON) => Promise<string[]>;
1151
- declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstance: BetterSQLite3Database<any>) => Promise<{
1151
+ declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstance: LibSQLDatabase<any>) => Promise<{
1152
1152
  hasDataLoss: boolean;
1153
1153
  warnings: string[];
1154
1154
  statementsToExecute: string[];
package/payload.d.ts CHANGED
@@ -2,7 +2,7 @@ import { PgDatabase } from 'drizzle-orm/pg-core';
2
2
  import * as zod from 'zod';
3
3
  import { TypeOf } from 'zod';
4
4
  import { MySql2Database } from 'drizzle-orm/mysql2';
5
- import { BetterSQLite3Database } from 'drizzle-orm/better-sqlite3';
5
+ import { LibSQLDatabase } from 'drizzle-orm/libsql';
6
6
 
7
7
  declare const pgSchema: zod.ZodObject<zod.objectUtil.extendShape<{
8
8
  version: zod.ZodLiteral<"7">;
@@ -1138,9 +1138,9 @@ type MySqlSchema = TypeOf<typeof schema>;
1138
1138
  type DrizzleSnapshotJSON = PgSchema;
1139
1139
  type DrizzleSQLiteSnapshotJSON = SQLiteSchema;
1140
1140
  type DrizzleMySQLSnapshotJSON = MySqlSchema;
1141
- declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => PgSchema;
1141
+ declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string, schemaFilters?: string[]) => PgSchema;
1142
1142
  declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
1143
- declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>) => Promise<{
1143
+ declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: PgDatabase<any>, schemaFilters?: string[]) => Promise<{
1144
1144
  hasDataLoss: boolean;
1145
1145
  warnings: string[];
1146
1146
  statementsToExecute: string[];
@@ -1148,7 +1148,7 @@ declare const pushSchema: (imports: Record<string, unknown>, drizzleInstance: Pg
1148
1148
  }>;
1149
1149
  declare const generateSQLiteDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => Promise<SQLiteSchema>;
1150
1150
  declare const generateSQLiteMigration: (prev: DrizzleSQLiteSnapshotJSON, cur: DrizzleSQLiteSnapshotJSON) => Promise<string[]>;
1151
- declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstance: BetterSQLite3Database<any>) => Promise<{
1151
+ declare const pushSQLiteSchema: (imports: Record<string, unknown>, drizzleInstance: LibSQLDatabase<any>) => Promise<{
1152
1152
  hasDataLoss: boolean;
1153
1153
  warnings: string[];
1154
1154
  statementsToExecute: string[];
package/payload.js CHANGED
@@ -21755,7 +21755,7 @@ var init_jsonStatements = __esm({
21755
21755
  tableName,
21756
21756
  data: it,
21757
21757
  schema: schema4,
21758
- constraintName: json1.tables[`${schema4}.${tableName}`].compositePrimaryKeys[PgSquasher.unsquashPK(it).name].name
21758
+ constraintName: json1.tables[`${schema4 || "public"}.${tableName}`].compositePrimaryKeys[PgSquasher.unsquashPK(it).name].name
21759
21759
  };
21760
21760
  });
21761
21761
  };
@@ -34086,13 +34086,14 @@ var updateUpToV6 = (json) => {
34086
34086
  };
34087
34087
 
34088
34088
  // src/payload.ts
34089
- var generateDrizzleJson = (imports, prevId) => {
34089
+ var generateDrizzleJson = (imports, prevId, schemaFilters) => {
34090
34090
  const prepared = prepareFromExports(imports);
34091
34091
  const id = (0, import_crypto.randomUUID)();
34092
34092
  const snapshot = generatePgSnapshot(
34093
34093
  prepared.tables,
34094
34094
  prepared.enums,
34095
- prepared.schemas
34095
+ prepared.schemas,
34096
+ schemaFilters
34096
34097
  );
34097
34098
  return fillPgSnapshot({
34098
34099
  serialized: snapshot,
@@ -34118,7 +34119,7 @@ var generateMigration = async (prev, cur) => {
34118
34119
  );
34119
34120
  return sqlStatements;
34120
34121
  };
34121
- var pushSchema = async (imports, drizzleInstance) => {
34122
+ var pushSchema = async (imports, drizzleInstance, schemaFilters) => {
34122
34123
  const { applyPgSnapshotsDiff: applyPgSnapshotsDiff2 } = await Promise.resolve().then(() => (init_snapshotsDiffer(), snapshotsDiffer_exports));
34123
34124
  const { sql: sql2 } = await Promise.resolve().then(() => (init_drizzle_orm(), drizzle_orm_exports));
34124
34125
  const db = {
@@ -34128,7 +34129,11 @@ var pushSchema = async (imports, drizzleInstance) => {
34128
34129
  }
34129
34130
  };
34130
34131
  const cur = generateDrizzleJson(imports);
34131
- const { schema: prev } = await pgPushIntrospect(db, [], ["public"]);
34132
+ const { schema: prev } = await pgPushIntrospect(
34133
+ db,
34134
+ [],
34135
+ schemaFilters ?? ["public"]
34136
+ );
34132
34137
  const validatedPrev = pgSchema.parse(prev);
34133
34138
  const validatedCur = pgSchema.parse(cur);
34134
34139
  const squashedPrev = squashPgScheme(validatedPrev, "push");
package/payload.mjs CHANGED
@@ -21761,7 +21761,7 @@ var init_jsonStatements = __esm({
21761
21761
  tableName,
21762
21762
  data: it,
21763
21763
  schema: schema4,
21764
- constraintName: json1.tables[`${schema4}.${tableName}`].compositePrimaryKeys[PgSquasher.unsquashPK(it).name].name
21764
+ constraintName: json1.tables[`${schema4 || "public"}.${tableName}`].compositePrimaryKeys[PgSquasher.unsquashPK(it).name].name
21765
21765
  };
21766
21766
  });
21767
21767
  };
@@ -34078,13 +34078,14 @@ var updateUpToV6 = (json) => {
34078
34078
  };
34079
34079
 
34080
34080
  // src/payload.ts
34081
- var generateDrizzleJson = (imports, prevId) => {
34081
+ var generateDrizzleJson = (imports, prevId, schemaFilters) => {
34082
34082
  const prepared = prepareFromExports(imports);
34083
34083
  const id = randomUUID();
34084
34084
  const snapshot = generatePgSnapshot(
34085
34085
  prepared.tables,
34086
34086
  prepared.enums,
34087
- prepared.schemas
34087
+ prepared.schemas,
34088
+ schemaFilters
34088
34089
  );
34089
34090
  return fillPgSnapshot({
34090
34091
  serialized: snapshot,
@@ -34110,7 +34111,7 @@ var generateMigration = async (prev, cur) => {
34110
34111
  );
34111
34112
  return sqlStatements;
34112
34113
  };
34113
- var pushSchema = async (imports, drizzleInstance) => {
34114
+ var pushSchema = async (imports, drizzleInstance, schemaFilters) => {
34114
34115
  const { applyPgSnapshotsDiff: applyPgSnapshotsDiff2 } = await Promise.resolve().then(() => (init_snapshotsDiffer(), snapshotsDiffer_exports));
34115
34116
  const { sql: sql2 } = await Promise.resolve().then(() => (init_drizzle_orm(), drizzle_orm_exports));
34116
34117
  const db = {
@@ -34120,7 +34121,11 @@ var pushSchema = async (imports, drizzleInstance) => {
34120
34121
  }
34121
34122
  };
34122
34123
  const cur = generateDrizzleJson(imports);
34123
- const { schema: prev } = await pgPushIntrospect(db, [], ["public"]);
34124
+ const { schema: prev } = await pgPushIntrospect(
34125
+ db,
34126
+ [],
34127
+ schemaFilters ?? ["public"]
34128
+ );
34124
34129
  const validatedPrev = pgSchema.parse(prev);
34125
34130
  const validatedCur = pgSchema.parse(cur);
34126
34131
  const squashedPrev = squashPgScheme(validatedPrev, "push");