drizzle-kit 0.20.4-c212886 → 0.20.4-d3a9581

Sign up to get free protection for your applications and to get access to all the features.
package/utils.d.ts CHANGED
@@ -1,5 +1,8 @@
1
- import type { Dialect } from "./schemaValidator";
1
+ import { Dialect } from "./schemaValidator";
2
2
  import { NamedWithSchema } from "./cli/commands/migrate";
3
+ import { PgDatabase } from "drizzle-orm/pg-core";
4
+ import { PgSchema as PgSchemaKit } from "./serializer/pgSchema";
5
+ import { DbConnection } from ".";
3
6
  export declare const assertV1OutFolder: (out: string, dialect: Dialect | "{dialect}") => void;
4
7
  export type Journal = {
5
8
  version: string;
@@ -19,6 +22,7 @@ export declare const prepareOutFolder: (out: string, dialect: Dialect) => {
19
22
  snapshots: string[];
20
23
  journal: any;
21
24
  };
25
+ export declare const mapValues: <IN, OUT>(obj: Record<string, IN>, map: (input: IN) => OUT) => Record<string, OUT>;
22
26
  export declare const validateWithReport: (snapshots: string[], dialect: Dialect) => {
23
27
  malformed: string[];
24
28
  nonLatest: string[];
@@ -195,3 +199,13 @@ export declare const statementsForDiffs: (in1: any, in2: any) => Promise<{
195
199
  columns: {};
196
200
  } | undefined;
197
201
  }>;
202
+ export type DrizzleSnapshotJSON = PgSchemaKit;
203
+ export declare const generateDrizzleJson: (imports: Record<string, unknown>, prevId?: string) => PgSchemaKit;
204
+ export declare const generateMigration: (prev: DrizzleSnapshotJSON, cur: DrizzleSnapshotJSON) => Promise<string[]>;
205
+ export declare const pushSchema: (imports: Record<string, unknown>, db: PgDatabase<any>) => Promise<{
206
+ hasDataLoss: boolean;
207
+ warnings: string[];
208
+ statementsToExecute: string[];
209
+ apply: () => Promise<void>;
210
+ }>;
211
+ export declare const prepareFrom: (connection: DbConnection) => Promise<Record<string, any>>;