drizzle-kit 0.20.17-5938f5d → 0.20.17-7446198
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/@types/utils.d.ts +1 -0
- package/bin.cjs +62690 -34323
- package/cli/commands/migrate.d.ts +4 -4
- package/cli/commands/mysqlIntrospect.d.ts +1 -6
- package/cli/commands/pgIntrospect.d.ts +1 -1
- package/cli/commands/sqliteIntrospect.d.ts +0 -1
- package/cli/commands/sqlitePushUtils.d.ts +2 -2
- package/cli/commands/utils.d.ts +125 -3
- package/cli/connections.d.ts +18 -0
- package/cli/validations/cli.d.ts +65 -65
- package/cli/validations/common.d.ts +13 -13
- package/cli/validations/mysql.d.ts +3 -9
- package/cli/validations/outputs.d.ts +2 -2
- package/cli/validations/pg.d.ts +18 -3
- package/cli/validations/sqlite.d.ts +0 -12
- package/cli/validations/studio.d.ts +92 -0
- package/cli/views.d.ts +7 -0
- package/index.d.mts +12 -56
- package/index.d.ts +12 -56
- package/package.json +5 -2
- package/payload.js +1337 -19691
- package/payload.mjs +1334 -19688
- package/schemaValidator.d.ts +13 -13
- package/serializer/mysqlSchema.d.ts +19 -333
- package/serializer/pgSchema.d.ts +14 -14
- package/serializer/studio.d.ts +53 -0
- package/snapshotsDiffer.d.ts +1 -2
- package/utils-studio.js +191 -2641
- package/utils-studio.mjs +191 -2641
- package/utils.d.ts +6 -0
- package/utils.js +8 -18
- package/utils.mjs +8 -18
package/serializer/pgSchema.d.ts
CHANGED
|
@@ -2063,7 +2063,7 @@ export declare const pgSchemaExternal: import("zod").ZodObject<{
|
|
|
2063
2063
|
}>;
|
|
2064
2064
|
export declare const pgSchemaInternal: import("zod").ZodObject<{
|
|
2065
2065
|
version: import("zod").ZodLiteral<"6">;
|
|
2066
|
-
dialect: import("zod").ZodLiteral<"
|
|
2066
|
+
dialect: import("zod").ZodLiteral<"postgresql">;
|
|
2067
2067
|
tables: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
2068
2068
|
name: import("zod").ZodString;
|
|
2069
2069
|
schema: import("zod").ZodString;
|
|
@@ -2352,7 +2352,7 @@ export declare const pgSchemaInternal: import("zod").ZodObject<{
|
|
|
2352
2352
|
}>;
|
|
2353
2353
|
}>;
|
|
2354
2354
|
version: "6";
|
|
2355
|
-
dialect: "
|
|
2355
|
+
dialect: "postgresql";
|
|
2356
2356
|
schemas: Record<string, string>;
|
|
2357
2357
|
_meta: {
|
|
2358
2358
|
columns: Record<string, string>;
|
|
@@ -2414,7 +2414,7 @@ export declare const pgSchemaInternal: import("zod").ZodObject<{
|
|
|
2414
2414
|
}> | undefined;
|
|
2415
2415
|
}>;
|
|
2416
2416
|
version: "6";
|
|
2417
|
-
dialect: "
|
|
2417
|
+
dialect: "postgresql";
|
|
2418
2418
|
schemas: Record<string, string>;
|
|
2419
2419
|
_meta: {
|
|
2420
2420
|
columns: Record<string, string>;
|
|
@@ -2438,7 +2438,7 @@ export declare const pgSchemaInternal: import("zod").ZodObject<{
|
|
|
2438
2438
|
}>;
|
|
2439
2439
|
export declare const pgSchemaSquashedV4: import("zod").ZodObject<{
|
|
2440
2440
|
version: import("zod").ZodLiteral<"4">;
|
|
2441
|
-
dialect: import("zod").
|
|
2441
|
+
dialect: import("zod").ZodLiteral<"pg">;
|
|
2442
2442
|
tables: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
2443
2443
|
name: import("zod").ZodString;
|
|
2444
2444
|
schema: import("zod").ZodString;
|
|
@@ -2572,7 +2572,7 @@ export declare const pgSchemaSquashedV4: import("zod").ZodObject<{
|
|
|
2572
2572
|
}>;
|
|
2573
2573
|
export declare const pgSchemaSquashed: import("zod").ZodObject<{
|
|
2574
2574
|
version: import("zod").ZodLiteral<"6">;
|
|
2575
|
-
dialect: import("zod").
|
|
2575
|
+
dialect: import("zod").ZodLiteral<"postgresql">;
|
|
2576
2576
|
tables: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
2577
2577
|
name: import("zod").ZodString;
|
|
2578
2578
|
schema: import("zod").ZodString;
|
|
@@ -2683,7 +2683,7 @@ export declare const pgSchemaSquashed: import("zod").ZodObject<{
|
|
|
2683
2683
|
uniqueConstraints: Record<string, string>;
|
|
2684
2684
|
}>;
|
|
2685
2685
|
version: "6";
|
|
2686
|
-
dialect: "
|
|
2686
|
+
dialect: "postgresql";
|
|
2687
2687
|
schemas: Record<string, string>;
|
|
2688
2688
|
enums: Record<string, {
|
|
2689
2689
|
name: string;
|
|
@@ -2711,7 +2711,7 @@ export declare const pgSchemaSquashed: import("zod").ZodObject<{
|
|
|
2711
2711
|
uniqueConstraints: Record<string, string>;
|
|
2712
2712
|
}>;
|
|
2713
2713
|
version: "6";
|
|
2714
|
-
dialect: "
|
|
2714
|
+
dialect: "postgresql";
|
|
2715
2715
|
schemas: Record<string, string>;
|
|
2716
2716
|
enums: Record<string, {
|
|
2717
2717
|
name: string;
|
|
@@ -3554,7 +3554,7 @@ export declare const pgSchemaV5: import("zod").ZodObject<import("zod").objectUti
|
|
|
3554
3554
|
}>;
|
|
3555
3555
|
export declare const pgSchema: import("zod").ZodObject<import("zod").objectUtil.extendShape<{
|
|
3556
3556
|
version: import("zod").ZodLiteral<"6">;
|
|
3557
|
-
dialect: import("zod").ZodLiteral<"
|
|
3557
|
+
dialect: import("zod").ZodLiteral<"postgresql">;
|
|
3558
3558
|
tables: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
3559
3559
|
name: import("zod").ZodString;
|
|
3560
3560
|
schema: import("zod").ZodString;
|
|
@@ -3848,7 +3848,7 @@ export declare const pgSchema: import("zod").ZodObject<import("zod").objectUtil.
|
|
|
3848
3848
|
id: string;
|
|
3849
3849
|
prevId: string;
|
|
3850
3850
|
version: "6";
|
|
3851
|
-
dialect: "
|
|
3851
|
+
dialect: "postgresql";
|
|
3852
3852
|
schemas: Record<string, string>;
|
|
3853
3853
|
_meta: {
|
|
3854
3854
|
columns: Record<string, string>;
|
|
@@ -3912,7 +3912,7 @@ export declare const pgSchema: import("zod").ZodObject<import("zod").objectUtil.
|
|
|
3912
3912
|
id: string;
|
|
3913
3913
|
prevId: string;
|
|
3914
3914
|
version: "6";
|
|
3915
|
-
dialect: "
|
|
3915
|
+
dialect: "postgresql";
|
|
3916
3916
|
schemas: Record<string, string>;
|
|
3917
3917
|
_meta: {
|
|
3918
3918
|
columns: Record<string, string>;
|
|
@@ -4332,7 +4332,7 @@ export declare const backwardCompatiblePgSchema: import("zod").ZodUnion<[import(
|
|
|
4332
4332
|
} | undefined;
|
|
4333
4333
|
}>, import("zod").ZodObject<import("zod").objectUtil.extendShape<{
|
|
4334
4334
|
version: import("zod").ZodLiteral<"6">;
|
|
4335
|
-
dialect: import("zod").ZodLiteral<"
|
|
4335
|
+
dialect: import("zod").ZodLiteral<"postgresql">;
|
|
4336
4336
|
tables: import("zod").ZodRecord<import("zod").ZodString, import("zod").ZodObject<{
|
|
4337
4337
|
name: import("zod").ZodString;
|
|
4338
4338
|
schema: import("zod").ZodString;
|
|
@@ -4626,7 +4626,7 @@ export declare const backwardCompatiblePgSchema: import("zod").ZodUnion<[import(
|
|
|
4626
4626
|
id: string;
|
|
4627
4627
|
prevId: string;
|
|
4628
4628
|
version: "6";
|
|
4629
|
-
dialect: "
|
|
4629
|
+
dialect: "postgresql";
|
|
4630
4630
|
schemas: Record<string, string>;
|
|
4631
4631
|
_meta: {
|
|
4632
4632
|
columns: Record<string, string>;
|
|
@@ -4690,7 +4690,7 @@ export declare const backwardCompatiblePgSchema: import("zod").ZodUnion<[import(
|
|
|
4690
4690
|
id: string;
|
|
4691
4691
|
prevId: string;
|
|
4692
4692
|
version: "6";
|
|
4693
|
-
dialect: "
|
|
4693
|
+
dialect: "postgresql";
|
|
4694
4694
|
schemas: Record<string, string>;
|
|
4695
4695
|
_meta: {
|
|
4696
4696
|
columns: Record<string, string>;
|
|
@@ -4767,7 +4767,7 @@ export declare const dryPg: {
|
|
|
4767
4767
|
id: string;
|
|
4768
4768
|
prevId: string;
|
|
4769
4769
|
version: "6";
|
|
4770
|
-
dialect: "
|
|
4770
|
+
dialect: "postgresql";
|
|
4771
4771
|
schemas: Record<string, string>;
|
|
4772
4772
|
_meta: {
|
|
4773
4773
|
columns: Record<string, string>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { Hono } from "hono";
|
|
2
|
+
import type { PostgresCredentials } from "../cli/validations/pg";
|
|
3
|
+
import type { MysqlCredentials } from "../cli/validations/mysql";
|
|
4
|
+
import type { SqliteCredentials } from "../cli/validations/sqlite";
|
|
5
|
+
import { AnyPgTable } from "drizzle-orm/pg-core";
|
|
6
|
+
import { Relations } from "drizzle-orm";
|
|
7
|
+
import { AnyMySqlTable } from "drizzle-orm/mysql-core";
|
|
8
|
+
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
|
9
|
+
type CustomDefault = {
|
|
10
|
+
schema: string;
|
|
11
|
+
table: string;
|
|
12
|
+
column: string;
|
|
13
|
+
func: () => unknown;
|
|
14
|
+
};
|
|
15
|
+
export type Setup = {
|
|
16
|
+
dialect: "postgresql" | "mysql" | "sqlite";
|
|
17
|
+
driver?: "aws-data-api";
|
|
18
|
+
proxy: (params: ProxyParams) => Promise<any[] | any>;
|
|
19
|
+
customDefaults: CustomDefault[];
|
|
20
|
+
};
|
|
21
|
+
export type ProxyParams = {
|
|
22
|
+
sql: string;
|
|
23
|
+
params: any[];
|
|
24
|
+
typings?: any[];
|
|
25
|
+
mode: "array" | "object";
|
|
26
|
+
method: "values" | "get" | "all" | "run" | "execute";
|
|
27
|
+
};
|
|
28
|
+
export declare const preparePgSchema: (path: string | string[]) => Promise<{
|
|
29
|
+
schema: Record<string, Record<string, AnyPgTable>>;
|
|
30
|
+
relations: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const prepareMySqlSchema: (path: string | string[]) => Promise<{
|
|
33
|
+
schema: Record<string, Record<string, AnyMySqlTable>>;
|
|
34
|
+
relations: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
|
|
35
|
+
}>;
|
|
36
|
+
export declare const prepareSQLiteSchema: (path: string | string[]) => Promise<{
|
|
37
|
+
schema: Record<string, Record<string, AnySQLiteTable>>;
|
|
38
|
+
relations: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
|
|
39
|
+
}>;
|
|
40
|
+
export declare const drizzleForPostgres: (credentials: PostgresCredentials, pgSchema: Record<string, Record<string, AnyPgTable>>, relations: Record<string, Relations>) => Promise<Setup>;
|
|
41
|
+
export declare const drizzleForMySQL: (credentials: MysqlCredentials, mysqlSchema: Record<string, Record<string, AnyMySqlTable>>, relations: Record<string, Relations>) => Promise<Setup>;
|
|
42
|
+
export declare const drizzleForSQLite: (credentials: SqliteCredentials, sqliteSchema: Record<string, Record<string, AnySQLiteTable>>, relations: Record<string, Relations>) => Promise<Setup>;
|
|
43
|
+
export type Server = {
|
|
44
|
+
start: (params: {
|
|
45
|
+
host: string;
|
|
46
|
+
port: number;
|
|
47
|
+
key?: string;
|
|
48
|
+
cert?: string;
|
|
49
|
+
cb: (err: Error | null, address: string) => void;
|
|
50
|
+
}) => void;
|
|
51
|
+
};
|
|
52
|
+
export declare const prepareServer: ({ dialect, driver, proxy, customDefaults }: Setup, app?: Hono) => Promise<Server>;
|
|
53
|
+
export {};
|
package/snapshotsDiffer.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TypeOf, ZodTypeAny } from "zod";
|
|
2
2
|
import { JsonStatement } from "./jsonStatements";
|
|
3
|
-
import {
|
|
3
|
+
import { SQLiteSchemaSquashed } from "./serializer/sqliteSchema";
|
|
4
4
|
import { MySqlSchema, MySqlSchemaSquashed } from "./serializer/mysqlSchema";
|
|
5
5
|
import { PgSchema, PgSchemaSquashed } from "./serializer/pgSchema";
|
|
6
6
|
import { Named } from "./cli/commands/migrate";
|
|
@@ -3906,7 +3906,6 @@ export interface ColumnsResolverOutput<T extends {
|
|
|
3906
3906
|
}[];
|
|
3907
3907
|
deleted: T[];
|
|
3908
3908
|
}
|
|
3909
|
-
export type SchemaFrom<D> = D extends "pg" ? PgSchema : D extends "mysql" ? MySqlSchema : D extends "sqlite" ? SQLiteSchema : undefined;
|
|
3910
3909
|
export declare const applyPgSnapshotsDiff: (json1: PgSchemaSquashed, json2: PgSchemaSquashed, schemasResolver: (input: ResolverInput<Named>) => Promise<ResolverOutput<Named>>, enumsResolver: (input: ResolverInput<Enum>) => Promise<ResolverOutputWithMoved<Enum>>, tablesResolver: (input: ResolverInput<Table>) => Promise<ResolverOutputWithMoved<Table>>, columnsResolver: (input: ColumnsResolverInput<Column>) => Promise<ColumnsResolverOutput<Column>>, prevFull: PgSchema, curFull: PgSchema) => Promise<{
|
|
3911
3910
|
statements: JsonStatement[];
|
|
3912
3911
|
sqlStatements: string[];
|