drizzle-kit 0.20.17-d1b2821 → 0.20.17-e0821c1
Sign up to get free protection for your applications and to get access to all the features.
- package/bin.cjs +16287 -15103
- package/cli/commands/migrate.d.ts +39 -39
- package/cli/commands/mysqlIntrospect.d.ts +8 -8
- package/cli/commands/pgIntrospect.d.ts +7 -7
- package/cli/commands/sqliteIntrospect.d.ts +12 -12
- package/cli/commands/utils.d.ts +123 -1
- package/cli/connections.d.ts +7 -2
- package/cli/validations/cli.d.ts +51 -51
- package/cli/validations/common.d.ts +32 -32
- package/cli/validations/mysql.d.ts +4 -4
- package/cli/validations/pg.d.ts +4 -4
- package/cli/validations/studio.d.ts +92 -0
- package/cli/views.d.ts +6 -0
- package/index.d.mts +5 -3
- package/index.d.ts +5 -3
- package/package.json +2 -2
- package/payload.js +1096 -430
- package/payload.mjs +899 -233
- package/schemaValidator.d.ts +215 -215
- package/serializer/mysqlSchema.d.ts +892 -892
- package/serializer/pgSchema.d.ts +734 -734
- package/serializer/sqliteSchema.d.ts +457 -457
- package/serializer/studio.d.ts +19 -2
- package/snapshotsDiffer.d.ts +314 -314
- package/utils-studio.js +943 -835
- package/utils-studio.mjs +916 -808
- package/utils.js +839 -214
- package/utils.mjs +814 -189
package/serializer/studio.d.ts
CHANGED
@@ -3,7 +3,7 @@ import type { PostgresCredentials } from "../cli/validations/pg";
|
|
3
3
|
import type { MysqlCredentials } from "../cli/validations/mysql";
|
4
4
|
import type { SqliteCredentials } from "../cli/validations/sqlite";
|
5
5
|
import { AnyPgTable } from "drizzle-orm/pg-core";
|
6
|
-
import { Relations } from "drizzle-orm";
|
6
|
+
import { AnyTable, Relations, TablesRelationalConfig } from "drizzle-orm";
|
7
7
|
import { AnyMySqlTable } from "drizzle-orm/mysql-core";
|
8
8
|
import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
|
9
9
|
type CustomDefault = {
|
@@ -14,12 +14,16 @@ type CustomDefault = {
|
|
14
14
|
};
|
15
15
|
export type Setup = {
|
16
16
|
dialect: "postgresql" | "mysql" | "sqlite";
|
17
|
+
driver?: "aws-data-api";
|
17
18
|
proxy: (params: ProxyParams) => Promise<any[] | any>;
|
18
19
|
customDefaults: CustomDefault[];
|
20
|
+
schema: Record<string, Record<string, AnyTable<any>>>;
|
21
|
+
relations: Record<string, Relations>;
|
19
22
|
};
|
20
23
|
export type ProxyParams = {
|
21
24
|
sql: string;
|
22
25
|
params: any[];
|
26
|
+
typings?: any[];
|
23
27
|
mode: "array" | "object";
|
24
28
|
method: "values" | "get" | "all" | "run" | "execute";
|
25
29
|
};
|
@@ -38,6 +42,19 @@ export declare const prepareSQLiteSchema: (path: string | string[]) => Promise<{
|
|
38
42
|
export declare const drizzleForPostgres: (credentials: PostgresCredentials, pgSchema: Record<string, Record<string, AnyPgTable>>, relations: Record<string, Relations>) => Promise<Setup>;
|
39
43
|
export declare const drizzleForMySQL: (credentials: MysqlCredentials, mysqlSchema: Record<string, Record<string, AnyMySqlTable>>, relations: Record<string, Relations>) => Promise<Setup>;
|
40
44
|
export declare const drizzleForSQLite: (credentials: SqliteCredentials, sqliteSchema: Record<string, Record<string, AnySQLiteTable>>, relations: Record<string, Relations>) => Promise<Setup>;
|
45
|
+
export declare const extractRelations: (tablesConfig: {
|
46
|
+
tables: TablesRelationalConfig;
|
47
|
+
tableNamesMap: Record<string, string>;
|
48
|
+
}) => {
|
49
|
+
name: string;
|
50
|
+
type: "many" | "one";
|
51
|
+
table: string;
|
52
|
+
schema: string;
|
53
|
+
columns: string[];
|
54
|
+
refTable: string;
|
55
|
+
refSchema: string;
|
56
|
+
refColumns: string[];
|
57
|
+
}[];
|
41
58
|
export type Server = {
|
42
59
|
start: (params: {
|
43
60
|
host: string;
|
@@ -47,5 +64,5 @@ export type Server = {
|
|
47
64
|
cb: (err: Error | null, address: string) => void;
|
48
65
|
}) => void;
|
49
66
|
};
|
50
|
-
export declare const prepareServer: ({ dialect, proxy, customDefaults }: Setup, app?: Hono) => Promise<Server>;
|
67
|
+
export declare const prepareServer: ({ dialect, driver, proxy, customDefaults, schema: drizzleSchema, relations }: Setup, app?: Hono) => Promise<Server>;
|
51
68
|
export {};
|