drizzle-kit 0.20.14-a77266f → 0.20.14-c82ab68
Sign up to get free protection for your applications and to get access to all the features.
- package/bin.cjs +7311 -7010
- package/cli/commands/migrate.d.ts +24 -24
- package/cli/commands/mysqlIntrospect.d.ts +8 -8
- package/cli/commands/mysqlPushUtils.d.ts +2 -2
- package/cli/commands/mysqlUp.d.ts +2 -2
- package/cli/commands/pgConnect.d.ts +1 -1
- package/cli/commands/pgIntrospect.d.ts +12 -9
- package/cli/commands/pgPushUtils.d.ts +2 -2
- package/cli/commands/pgUp.d.ts +2 -2
- package/cli/commands/sqliteIntrospect.d.ts +9 -9
- package/cli/commands/sqlitePushUtils.d.ts +3 -3
- package/cli/commands/upFolders.d.ts +1 -1
- package/cli/commands/utils.d.ts +14 -259
- package/cli/validations/cli.d.ts +104 -0
- package/cli/validations/common.d.ts +205 -7
- package/cli/validations/mysql.d.ts +6 -1
- package/cli/validations/pg.d.ts +6 -1
- package/cli/validations/sqlite.d.ts +382 -0
- package/cli/views.d.ts +1 -1
- package/global.d.ts +1 -1
- package/index.d.mts +8 -6
- package/index.d.ts +8 -6
- package/index.js +1 -0
- package/introspect-mysql.d.ts +1 -1
- package/introspect-pg.d.ts +5 -2
- package/introspect-sqlite.d.ts +1 -1
- package/jsonStatements.d.ts +1 -1
- package/package.json +3 -1
- package/payload.js +2574 -1898
- package/payload.mjs +2570 -1895
- package/schemaValidator.d.ts +40 -40
- package/serializer/mysqlSchema.d.ts +1991 -753
- package/serializer/mysqlSerializer.d.ts +2 -2
- package/serializer/pgSchema.d.ts +1113 -788
- package/serializer/sqliteSchema.d.ts +144 -570
- package/serializer/sqliteSerializer.d.ts +2 -2
- package/snapshotsDiffer.d.ts +24 -20
- package/utils-studio.js +390 -15
- package/utils-studio.mjs +389 -15
- package/utils.d.ts +12 -12
- package/utils.js +849 -735
- package/utils.mjs +849 -736
- package/cli/commands/sqliteUtils.d.ts +0 -162
@@ -1,9 +1,9 @@
|
|
1
1
|
import { CommonSchema, CommonSquashedSchema, Dialect } from "../../schemaValidator";
|
2
2
|
import { schema } from "../views";
|
3
|
-
import { PgSchema } from "
|
4
|
-
import { SQLiteSchema } from "
|
5
|
-
import { MySqlSchema } from "
|
6
|
-
import { Journal } from "
|
3
|
+
import { PgSchema } from "../../serializer/pgSchema";
|
4
|
+
import { SQLiteSchema } from "../../serializer/sqliteSchema";
|
5
|
+
import { MySqlSchema } from "../../serializer/mysqlSchema";
|
6
|
+
import { Journal } from "../../utils";
|
7
7
|
import { GenerateConfig } from "./utils";
|
8
8
|
export type Named = {
|
9
9
|
name: string;
|
@@ -26,10 +26,6 @@ export declare const prepareMySQLPush: (config: {
|
|
26
26
|
} | undefined>;
|
27
27
|
} | undefined>;
|
28
28
|
} | undefined;
|
29
|
-
id: string;
|
30
|
-
prevId: string;
|
31
|
-
version: "5";
|
32
|
-
dialect: "mysql";
|
33
29
|
tables: Record<string, {
|
34
30
|
schema?: string | undefined;
|
35
31
|
name: string;
|
@@ -68,6 +64,10 @@ export declare const prepareMySQLPush: (config: {
|
|
68
64
|
columns: string[];
|
69
65
|
}>;
|
70
66
|
}>;
|
67
|
+
id: string;
|
68
|
+
prevId: string;
|
69
|
+
version: "6";
|
70
|
+
dialect: "mysql";
|
71
71
|
schemas: Record<string, string>;
|
72
72
|
_meta: {
|
73
73
|
columns: Record<string, string>;
|
@@ -83,10 +83,6 @@ export declare const prepareMySQLPush: (config: {
|
|
83
83
|
} | undefined>;
|
84
84
|
} | undefined>;
|
85
85
|
} | undefined;
|
86
|
-
id: string;
|
87
|
-
prevId: string;
|
88
|
-
version: "5";
|
89
|
-
dialect: "mysql";
|
90
86
|
tables: Record<string, {
|
91
87
|
schema?: string | undefined;
|
92
88
|
name: string;
|
@@ -125,6 +121,10 @@ export declare const prepareMySQLPush: (config: {
|
|
125
121
|
columns: string[];
|
126
122
|
}>;
|
127
123
|
}>;
|
124
|
+
id: string;
|
125
|
+
prevId: string;
|
126
|
+
version: "6";
|
127
|
+
dialect: "mysql";
|
128
128
|
schemas: Record<string, string>;
|
129
129
|
_meta: {
|
130
130
|
columns: Record<string, string>;
|
@@ -132,7 +132,7 @@ export declare const prepareMySQLPush: (config: {
|
|
132
132
|
schemas: Record<string, string>;
|
133
133
|
};
|
134
134
|
};
|
135
|
-
}
|
135
|
+
}>;
|
136
136
|
export declare const prepareSQLitePush: (config: {
|
137
137
|
schema: string | string[];
|
138
138
|
}, snapshot: SQLiteSchema) => Promise<{
|
@@ -140,8 +140,6 @@ export declare const prepareSQLitePush: (config: {
|
|
140
140
|
statements: import("../../jsonStatements").JsonStatement[];
|
141
141
|
squashedPrev: {
|
142
142
|
enums?: any;
|
143
|
-
version: "5";
|
144
|
-
dialect: "sqlite";
|
145
143
|
tables: Record<string, {
|
146
144
|
name: string;
|
147
145
|
columns: Record<string, {
|
@@ -157,11 +155,11 @@ export declare const prepareSQLitePush: (config: {
|
|
157
155
|
compositePrimaryKeys: Record<string, string>;
|
158
156
|
uniqueConstraints: Record<string, string>;
|
159
157
|
}>;
|
158
|
+
version: "5";
|
159
|
+
dialect: "sqlite";
|
160
160
|
};
|
161
161
|
squashedCur: {
|
162
162
|
enums?: any;
|
163
|
-
version: "5";
|
164
|
-
dialect: "sqlite";
|
165
163
|
tables: Record<string, {
|
166
164
|
name: string;
|
167
165
|
columns: Record<string, {
|
@@ -177,21 +175,21 @@ export declare const prepareSQLitePush: (config: {
|
|
177
175
|
compositePrimaryKeys: Record<string, string>;
|
178
176
|
uniqueConstraints: Record<string, string>;
|
179
177
|
}>;
|
178
|
+
version: "5";
|
179
|
+
dialect: "sqlite";
|
180
180
|
};
|
181
181
|
meta: {
|
182
182
|
schemas: {};
|
183
183
|
tables: {};
|
184
184
|
columns: {};
|
185
185
|
} | undefined;
|
186
|
-
}
|
186
|
+
}>;
|
187
187
|
export declare const preparePgPush: (config: {
|
188
188
|
schema: string | string[];
|
189
189
|
}, snapshot: PgSchema, schemaFilter: string[]) => Promise<{
|
190
190
|
sqlStatements: string[];
|
191
191
|
statements: import("../../jsonStatements").JsonStatement[];
|
192
192
|
squashedPrev: {
|
193
|
-
version: "5";
|
194
|
-
dialect: "pg";
|
195
193
|
tables: Record<string, {
|
196
194
|
name: string;
|
197
195
|
columns: Record<string, {
|
@@ -210,6 +208,8 @@ export declare const preparePgPush: (config: {
|
|
210
208
|
compositePrimaryKeys: Record<string, string>;
|
211
209
|
uniqueConstraints: Record<string, string>;
|
212
210
|
}>;
|
211
|
+
version: "6";
|
212
|
+
dialect: "pg";
|
213
213
|
schemas: Record<string, string>;
|
214
214
|
enums: Record<string, {
|
215
215
|
name: string;
|
@@ -217,8 +217,6 @@ export declare const preparePgPush: (config: {
|
|
217
217
|
}>;
|
218
218
|
};
|
219
219
|
squashedCur: {
|
220
|
-
version: "5";
|
221
|
-
dialect: "pg";
|
222
220
|
tables: Record<string, {
|
223
221
|
name: string;
|
224
222
|
columns: Record<string, {
|
@@ -237,16 +235,18 @@ export declare const preparePgPush: (config: {
|
|
237
235
|
compositePrimaryKeys: Record<string, string>;
|
238
236
|
uniqueConstraints: Record<string, string>;
|
239
237
|
}>;
|
238
|
+
version: "6";
|
239
|
+
dialect: "pg";
|
240
240
|
schemas: Record<string, string>;
|
241
241
|
enums: Record<string, {
|
242
242
|
name: string;
|
243
243
|
values: Record<string, string>;
|
244
244
|
}>;
|
245
245
|
};
|
246
|
-
}
|
246
|
+
}>;
|
247
247
|
export declare const prepareAndMigrateMySql: (config: GenerateConfig) => Promise<void>;
|
248
248
|
export declare const prepareAndMigrateSqlite: (config: GenerateConfig) => Promise<void>;
|
249
|
-
export declare const prepareSQL: (prev: CommonSquashedSchema, cur: CommonSquashedSchema, dialect: Dialect, prevFull
|
249
|
+
export declare const prepareSQL: (prev: CommonSquashedSchema, cur: CommonSquashedSchema, dialect: Dialect, prevFull: PgSchema | MySqlSchema | SQLiteSchema, curFull: PgSchema | MySqlSchema | SQLiteSchema) => Promise<{
|
250
250
|
statements: import("../../jsonStatements").JsonStatement[];
|
251
251
|
sqlStatements: string[];
|
252
252
|
_meta: {
|
@@ -6,10 +6,6 @@ export declare const connectToMySQL: (config: MySQLConnectionConfig) => Promise<
|
|
6
6
|
}>;
|
7
7
|
export declare const mysqlIntrospect: (config: MySQLConfigIntrospect, filters: string[]) => Promise<{
|
8
8
|
schema: {
|
9
|
-
id: string;
|
10
|
-
prevId: string;
|
11
|
-
version: "5";
|
12
|
-
dialect: "mysql";
|
13
9
|
tables: Record<string, {
|
14
10
|
schema?: string | undefined;
|
15
11
|
name: string;
|
@@ -48,6 +44,10 @@ export declare const mysqlIntrospect: (config: MySQLConfigIntrospect, filters: s
|
|
48
44
|
columns: string[];
|
49
45
|
}>;
|
50
46
|
}>;
|
47
|
+
id: string;
|
48
|
+
prevId: string;
|
49
|
+
version: "6";
|
50
|
+
dialect: "mysql";
|
51
51
|
schemas: Record<string, string>;
|
52
52
|
_meta: {
|
53
53
|
columns: Record<string, string>;
|
@@ -67,10 +67,6 @@ export declare const mysqlPushIntrospect: (connection: {
|
|
67
67
|
databaseName: string;
|
68
68
|
}, filters: string[]) => Promise<{
|
69
69
|
schema: {
|
70
|
-
id: string;
|
71
|
-
prevId: string;
|
72
|
-
version: "5";
|
73
|
-
dialect: "mysql";
|
74
70
|
tables: Record<string, {
|
75
71
|
schema?: string | undefined;
|
76
72
|
name: string;
|
@@ -109,6 +105,10 @@ export declare const mysqlPushIntrospect: (connection: {
|
|
109
105
|
columns: string[];
|
110
106
|
}>;
|
111
107
|
}>;
|
108
|
+
id: string;
|
109
|
+
prevId: string;
|
110
|
+
version: "6";
|
111
|
+
dialect: "mysql";
|
112
112
|
schemas: Record<string, string>;
|
113
113
|
_meta: {
|
114
114
|
columns: Record<string, string>;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { DrizzleDbClient } from "src/drivers";
|
2
|
-
import { JsonStatement } from "
|
3
|
-
import { mysqlSchema } from "
|
2
|
+
import { JsonStatement } from "../../jsonStatements";
|
3
|
+
import { mysqlSchema } from "../../serializer/mysqlSchema";
|
4
4
|
import { TypeOf } from "zod";
|
5
5
|
export declare const filterStatements: (statements: JsonStatement[], currentSchema: TypeOf<typeof mysqlSchema>, prevSchema: TypeOf<typeof mysqlSchema>) => JsonStatement[];
|
6
6
|
export declare const logSuggestionsAndReturn: ({ connection, statements, json2, }: {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import { MySqlSchemaV4, MySqlSchemaV5 } from "../../serializer/mysqlSchema";
|
2
2
|
export declare const upMysqlHandler: (out: string) => void;
|
3
|
-
export declare const upMySqlHandlerV4toV5: (obj: MySqlSchemaV4) =>
|
3
|
+
export declare const upMySqlHandlerV4toV5: (obj: MySqlSchemaV4) => MySqlSchemaV5;
|
4
4
|
export declare const upMysqlHandlerV4: (out: string) => void;
|
@@ -1,14 +1,10 @@
|
|
1
1
|
import type { PgConfigIntrospect } from "../validations/pg";
|
2
|
-
import type { DrizzleDbClient } from "
|
2
|
+
import type { DrizzleDbClient } from "../../drivers";
|
3
3
|
export declare const pgSchemas: (client: DrizzleDbClient) => Promise<string[]>;
|
4
4
|
export declare const pgPushIntrospect: (connection: {
|
5
5
|
client: DrizzleDbClient;
|
6
6
|
}, filters: string[], schemaFilters: string[]) => Promise<{
|
7
7
|
schema: {
|
8
|
-
id: string;
|
9
|
-
prevId: string;
|
10
|
-
version: "5";
|
11
|
-
dialect: "pg";
|
12
8
|
tables: Record<string, {
|
13
9
|
name: string;
|
14
10
|
columns: Record<string, {
|
@@ -47,6 +43,10 @@ export declare const pgPushIntrospect: (connection: {
|
|
47
43
|
nullsNotDistinct: boolean;
|
48
44
|
}>;
|
49
45
|
}>;
|
46
|
+
id: string;
|
47
|
+
prevId: string;
|
48
|
+
version: "6";
|
49
|
+
dialect: "pg";
|
50
50
|
schemas: Record<string, string>;
|
51
51
|
_meta: {
|
52
52
|
columns: Record<string, string>;
|
@@ -61,10 +61,6 @@ export declare const pgPushIntrospect: (connection: {
|
|
61
61
|
}>;
|
62
62
|
export declare const pgIntrospect: (config: PgConfigIntrospect, filters: string[], schemaFilters: string[]) => Promise<{
|
63
63
|
schema: {
|
64
|
-
id: string;
|
65
|
-
prevId: string;
|
66
|
-
version: "5";
|
67
|
-
dialect: "pg";
|
68
64
|
tables: Record<string, {
|
69
65
|
name: string;
|
70
66
|
columns: Record<string, {
|
@@ -103,6 +99,10 @@ export declare const pgIntrospect: (config: PgConfigIntrospect, filters: string[
|
|
103
99
|
nullsNotDistinct: boolean;
|
104
100
|
}>;
|
105
101
|
}>;
|
102
|
+
id: string;
|
103
|
+
prevId: string;
|
104
|
+
version: "6";
|
105
|
+
dialect: "pg";
|
106
106
|
schemas: Record<string, string>;
|
107
107
|
_meta: {
|
108
108
|
columns: Record<string, string>;
|
@@ -120,4 +120,7 @@ export declare const pgIntrospect: (config: PgConfigIntrospect, filters: string[
|
|
120
120
|
decalrations: string;
|
121
121
|
schemaEntry: string;
|
122
122
|
};
|
123
|
+
relationsTs: {
|
124
|
+
file: string;
|
125
|
+
};
|
123
126
|
}>;
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { DrizzleDbClient } from "
|
2
|
-
import { JsonStatement } from "
|
1
|
+
import { DrizzleDbClient } from "../../drivers";
|
2
|
+
import { JsonStatement } from "../../jsonStatements";
|
3
3
|
export declare const pgSuggestions: ({ connection, statements, }: {
|
4
4
|
statements: JsonStatement[];
|
5
5
|
connection: DrizzleDbClient;
|
package/cli/commands/pgUp.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
2
|
-
export declare const upPgHandlerV4toV5: (obj: PgSchemaV4) => PgSchema;
|
1
|
+
import { PgSchemaV4, PgSchemaV5 } from "../../serializer/pgSchema";
|
3
2
|
export declare const upPgHandler: (out: string) => void;
|
3
|
+
export declare const upPgHandlerV4toV5: (obj: PgSchemaV4) => PgSchemaV5;
|
4
4
|
export declare const upPgHandlerV4: (out: string) => void;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { SQLiteCliConfig, SQLiteConnectionConfig } from "
|
1
|
+
import type { SQLiteCliConfig, SQLiteConnectionConfig } from "../validations/sqlite";
|
2
2
|
import type { DrizzleDbClient } from "../../drivers";
|
3
3
|
export declare const connectToSQLite: (config: SQLiteConnectionConfig) => Promise<{
|
4
4
|
client: import("../../drivers").BetterSqlite;
|
@@ -7,10 +7,6 @@ export declare const connectToSQLite: (config: SQLiteConnectionConfig) => Promis
|
|
7
7
|
}>;
|
8
8
|
export declare const sqliteIntrospect: (config: SQLiteCliConfig, filters: string[]) => Promise<{
|
9
9
|
schema: {
|
10
|
-
id: string;
|
11
|
-
prevId: string;
|
12
|
-
version: "5";
|
13
|
-
dialect: "sqlite";
|
14
10
|
tables: Record<string, {
|
15
11
|
name: string;
|
16
12
|
columns: Record<string, {
|
@@ -45,6 +41,10 @@ export declare const sqliteIntrospect: (config: SQLiteCliConfig, filters: string
|
|
45
41
|
columns: string[];
|
46
42
|
}>;
|
47
43
|
}>;
|
44
|
+
id: string;
|
45
|
+
prevId: string;
|
46
|
+
version: "5";
|
47
|
+
dialect: "sqlite";
|
48
48
|
_meta: {
|
49
49
|
columns: Record<string, string>;
|
50
50
|
tables: Record<string, string>;
|
@@ -60,10 +60,6 @@ export declare const sqliteIntrospect: (config: SQLiteCliConfig, filters: string
|
|
60
60
|
}>;
|
61
61
|
export declare const sqlitePushIntrospect: (client: DrizzleDbClient, filters: string[]) => Promise<{
|
62
62
|
schema: {
|
63
|
-
id: string;
|
64
|
-
prevId: string;
|
65
|
-
version: "5";
|
66
|
-
dialect: "sqlite";
|
67
63
|
tables: Record<string, {
|
68
64
|
name: string;
|
69
65
|
columns: Record<string, {
|
@@ -98,6 +94,10 @@ export declare const sqlitePushIntrospect: (client: DrizzleDbClient, filters: st
|
|
98
94
|
columns: string[];
|
99
95
|
}>;
|
100
96
|
}>;
|
97
|
+
id: string;
|
98
|
+
prevId: string;
|
99
|
+
version: "5";
|
100
|
+
dialect: "sqlite";
|
101
101
|
_meta: {
|
102
102
|
columns: Record<string, string>;
|
103
103
|
tables: Record<string, string>;
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { DrizzleDbClient } from "
|
2
|
-
import { JsonStatement } from "
|
3
|
-
import { SQLiteSchemaInternal, SQLiteSchemaSquashed } from "
|
1
|
+
import { DrizzleDbClient } from "../../drivers";
|
2
|
+
import { JsonStatement } from "../../jsonStatements";
|
3
|
+
import { SQLiteSchemaInternal, SQLiteSchemaSquashed } from "../../serializer/sqliteSchema";
|
4
4
|
export declare const _moveDataStatements: (tableName: string, json: SQLiteSchemaSquashed, dataLoss?: boolean) => string[];
|
5
5
|
export declare const getOldTableName: (tableName: string, meta: SQLiteSchemaInternal["_meta"]) => string;
|
6
6
|
export declare const getNewTableName: (tableName: string, meta: SQLiteSchemaInternal["_meta"]) => string;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { Dialect } from "
|
1
|
+
import { Dialect } from "../../schemaValidator";
|
2
2
|
import { Named, NamedWithSchema } from "./migrate";
|
3
3
|
export declare const resolveSchemas: <T extends Named>(missingSchemas: T[], newSchemas: T[], predicate: (leftMissing: T[], created: T) => T | undefined) => {
|
4
4
|
created: T[];
|
package/cli/commands/utils.d.ts
CHANGED
@@ -1,274 +1,29 @@
|
|
1
|
-
import {
|
1
|
+
import { MySQLPushConfig } from "../validations/mysql";
|
2
|
+
import { PgPushConfig } from "../validations/pg";
|
3
|
+
import { SQLitePushConfig } from "../validations/sqlite";
|
4
|
+
import { CliConfig } from "../validations/common";
|
5
|
+
import { Dialect } from "src/schemaValidator";
|
6
|
+
import { CliCheckConfig, CliConfigGenerate, CliParamsPush } from "../validations/cli";
|
2
7
|
export declare const safeRegister: () => Promise<{
|
3
8
|
unregister: () => void;
|
4
9
|
}>;
|
5
10
|
export type GenerateConfig = {
|
11
|
+
dialect: Dialect;
|
6
12
|
schema: string | string[];
|
7
13
|
out: string;
|
8
14
|
breakpoints: boolean;
|
9
15
|
custom: boolean;
|
10
16
|
bundle: boolean;
|
11
17
|
};
|
12
|
-
export declare const prepareGenerateConfig: (options:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
custom: boolean;
|
18
|
-
}) => Promise<GenerateConfig>;
|
19
|
-
export declare const assertOutFolder: (it: {
|
20
|
-
config?: string;
|
21
|
-
} | {
|
22
|
-
out: string;
|
23
|
-
}) => Promise<string>;
|
24
|
-
export declare const driver: import("zod").ZodUnion<[import("zod").ZodLiteral<"better-sqlite">, import("zod").ZodLiteral<"turso">, import("zod").ZodLiteral<"libsql">, import("zod").ZodLiteral<"d1">, import("zod").ZodLiteral<"expo">, import("zod").ZodLiteral<"pg">, import("zod").ZodLiteral<"mysql2">]>;
|
25
|
-
export declare const configCommonSchema: import("zod").ZodObject<{
|
26
|
-
schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
|
27
|
-
out: import("zod").ZodOptional<import("zod").ZodString>;
|
28
|
-
breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
29
|
-
driver: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodLiteral<"better-sqlite">, import("zod").ZodLiteral<"turso">, import("zod").ZodLiteral<"libsql">, import("zod").ZodLiteral<"d1">, import("zod").ZodLiteral<"expo">, import("zod").ZodLiteral<"pg">, import("zod").ZodLiteral<"mysql2">]>>;
|
30
|
-
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
31
|
-
schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
32
|
-
}, "strip", import("zod").ZodTypeAny, {
|
33
|
-
out?: string | undefined;
|
34
|
-
driver?: "turso" | "better-sqlite" | "libsql" | "d1" | "pg" | "mysql2" | "expo" | undefined;
|
35
|
-
tablesFilter?: string | string[] | undefined;
|
36
|
-
schema: string | string[];
|
37
|
-
breakpoints: boolean;
|
38
|
-
schemaFilter: string | string[];
|
39
|
-
}, {
|
40
|
-
out?: string | undefined;
|
41
|
-
breakpoints?: boolean | undefined;
|
42
|
-
driver?: "turso" | "better-sqlite" | "libsql" | "d1" | "pg" | "mysql2" | "expo" | undefined;
|
43
|
-
tablesFilter?: string | string[] | undefined;
|
44
|
-
schemaFilter?: string | string[] | undefined;
|
45
|
-
schema: string | string[];
|
18
|
+
export declare const prepareGenerateConfig: (options: CliConfigGenerate) => Promise<GenerateConfig>;
|
19
|
+
export declare const preparePushConfig: (options: CliParamsPush) => Promise<{
|
20
|
+
config: MySQLPushConfig | PgPushConfig | SQLitePushConfig;
|
21
|
+
schemaFiles: string[];
|
22
|
+
tablesFilter: string[];
|
46
23
|
}>;
|
47
|
-
export declare const
|
48
|
-
casing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
|
49
|
-
}, "strip", import("zod").ZodTypeAny, {
|
50
|
-
casing: "camel" | "preserve";
|
51
|
-
}, {
|
52
|
-
casing?: "camel" | "preserve" | undefined;
|
53
|
-
}>>;
|
54
|
-
export declare const configIntrospectSchema: import("zod").ZodObject<{
|
55
|
-
schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
56
|
-
out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
57
|
-
breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
58
|
-
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
59
|
-
schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
60
|
-
introspect: import("zod").ZodDefault<import("zod").ZodObject<{
|
61
|
-
casing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
|
62
|
-
}, "strip", import("zod").ZodTypeAny, {
|
63
|
-
casing: "camel" | "preserve";
|
64
|
-
}, {
|
65
|
-
casing?: "camel" | "preserve" | undefined;
|
66
|
-
}>>;
|
67
|
-
}, "strip", import("zod").ZodTypeAny, {
|
68
|
-
schema?: string | string[] | undefined;
|
69
|
-
tablesFilter?: string | string[] | undefined;
|
24
|
+
export declare const assertOutFolder: (it: CliCheckConfig) => Promise<{
|
70
25
|
out: string;
|
71
|
-
|
72
|
-
schemaFilter: string | string[];
|
73
|
-
introspect: {
|
74
|
-
casing: "camel" | "preserve";
|
75
|
-
};
|
76
|
-
}, {
|
77
|
-
schema?: string | string[] | undefined;
|
78
|
-
out?: string | undefined;
|
79
|
-
breakpoints?: boolean | undefined;
|
80
|
-
tablesFilter?: string | string[] | undefined;
|
81
|
-
schemaFilter?: string | string[] | undefined;
|
82
|
-
introspect?: {
|
83
|
-
casing?: "camel" | "preserve" | undefined;
|
84
|
-
} | undefined;
|
85
|
-
}>;
|
86
|
-
export type ConfigIntrospectSchema = TypeOf<typeof configIntrospectSchema>;
|
87
|
-
export type ConfigIntrospectCasing = TypeOf<typeof introspectCasing>;
|
88
|
-
export declare const configIntrospectCliSchema: import("zod").ZodObject<{
|
89
|
-
schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
90
|
-
out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
91
|
-
breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
92
|
-
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
93
|
-
schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
94
|
-
introspectCasing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
|
95
|
-
}, "strip", import("zod").ZodTypeAny, {
|
96
|
-
schema?: string | string[] | undefined;
|
97
|
-
tablesFilter?: string | string[] | undefined;
|
98
|
-
out: string;
|
99
|
-
breakpoints: boolean;
|
100
|
-
schemaFilter: string | string[];
|
101
|
-
introspectCasing: "camel" | "preserve";
|
102
|
-
}, {
|
103
|
-
schema?: string | string[] | undefined;
|
104
|
-
out?: string | undefined;
|
105
|
-
breakpoints?: boolean | undefined;
|
106
|
-
tablesFilter?: string | string[] | undefined;
|
107
|
-
schemaFilter?: string | string[] | undefined;
|
108
|
-
introspectCasing?: "camel" | "preserve" | undefined;
|
26
|
+
dialect: Dialect;
|
109
27
|
}>;
|
110
|
-
export declare const configGenerateSchema: import("zod").ZodObject<{
|
111
|
-
schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
|
112
|
-
out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
113
|
-
breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
114
|
-
}, "strip", import("zod").ZodTypeAny, {
|
115
|
-
schema: string | string[];
|
116
|
-
out: string;
|
117
|
-
breakpoints: boolean;
|
118
|
-
}, {
|
119
|
-
out?: string | undefined;
|
120
|
-
breakpoints?: boolean | undefined;
|
121
|
-
schema: string | string[];
|
122
|
-
}>;
|
123
|
-
export type GenerateSchema = TypeOf<typeof configGenerateSchema>;
|
124
|
-
export declare const configPushSchema: import("zod").ZodObject<{
|
125
|
-
schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
|
126
|
-
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
127
|
-
schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
128
|
-
verbose: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
129
|
-
strict: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
130
|
-
}, "strip", import("zod").ZodTypeAny, {
|
131
|
-
tablesFilter?: string | string[] | undefined;
|
132
|
-
strict: boolean;
|
133
|
-
schema: string | string[];
|
134
|
-
schemaFilter: string | string[];
|
135
|
-
verbose: boolean;
|
136
|
-
}, {
|
137
|
-
strict?: boolean | undefined;
|
138
|
-
tablesFilter?: string | string[] | undefined;
|
139
|
-
schemaFilter?: string | string[] | undefined;
|
140
|
-
verbose?: boolean | undefined;
|
141
|
-
schema: string | string[];
|
142
|
-
}>;
|
143
|
-
export declare const mysqlConnectionSchema: import("zod").ZodUnion<[import("zod").ZodObject<{
|
144
|
-
host: import("zod").ZodString;
|
145
|
-
port: import("zod").ZodOptional<import("zod").ZodNumber>;
|
146
|
-
user: import("zod").ZodDefault<import("zod").ZodString>;
|
147
|
-
password: import("zod").ZodOptional<import("zod").ZodString>;
|
148
|
-
database: import("zod").ZodString;
|
149
|
-
}, "strip", import("zod").ZodTypeAny, {
|
150
|
-
port?: number | undefined;
|
151
|
-
password?: string | undefined;
|
152
|
-
host: string;
|
153
|
-
user: string;
|
154
|
-
database: string;
|
155
|
-
}, {
|
156
|
-
port?: number | undefined;
|
157
|
-
user?: string | undefined;
|
158
|
-
password?: string | undefined;
|
159
|
-
host: string;
|
160
|
-
database: string;
|
161
|
-
}>, import("zod").ZodObject<{
|
162
|
-
connectionString: import("zod").ZodString;
|
163
|
-
}, "strip", import("zod").ZodTypeAny, {
|
164
|
-
connectionString: string;
|
165
|
-
}, {
|
166
|
-
connectionString: string;
|
167
|
-
}>, import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>]>;
|
168
|
-
export declare const mySqlCliConfigSchema: import("zod").ZodIntersection<import("zod").ZodObject<{
|
169
|
-
schema: import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>;
|
170
|
-
out: import("zod").ZodOptional<import("zod").ZodString>;
|
171
|
-
breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
172
|
-
driver: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodLiteral<"better-sqlite">, import("zod").ZodLiteral<"turso">, import("zod").ZodLiteral<"libsql">, import("zod").ZodLiteral<"d1">, import("zod").ZodLiteral<"expo">, import("zod").ZodLiteral<"pg">, import("zod").ZodLiteral<"mysql2">]>>;
|
173
|
-
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
174
|
-
schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
175
|
-
}, "strip", import("zod").ZodTypeAny, {
|
176
|
-
out?: string | undefined;
|
177
|
-
driver?: "turso" | "better-sqlite" | "libsql" | "d1" | "pg" | "mysql2" | "expo" | undefined;
|
178
|
-
tablesFilter?: string | string[] | undefined;
|
179
|
-
schema: string | string[];
|
180
|
-
breakpoints: boolean;
|
181
|
-
schemaFilter: string | string[];
|
182
|
-
}, {
|
183
|
-
out?: string | undefined;
|
184
|
-
breakpoints?: boolean | undefined;
|
185
|
-
driver?: "turso" | "better-sqlite" | "libsql" | "d1" | "pg" | "mysql2" | "expo" | undefined;
|
186
|
-
tablesFilter?: string | string[] | undefined;
|
187
|
-
schemaFilter?: string | string[] | undefined;
|
188
|
-
schema: string | string[];
|
189
|
-
}>, import("zod").ZodUnion<[import("zod").ZodObject<{
|
190
|
-
host: import("zod").ZodString;
|
191
|
-
port: import("zod").ZodOptional<import("zod").ZodNumber>;
|
192
|
-
user: import("zod").ZodDefault<import("zod").ZodString>;
|
193
|
-
password: import("zod").ZodOptional<import("zod").ZodString>;
|
194
|
-
database: import("zod").ZodString;
|
195
|
-
}, "strip", import("zod").ZodTypeAny, {
|
196
|
-
port?: number | undefined;
|
197
|
-
password?: string | undefined;
|
198
|
-
host: string;
|
199
|
-
user: string;
|
200
|
-
database: string;
|
201
|
-
}, {
|
202
|
-
port?: number | undefined;
|
203
|
-
user?: string | undefined;
|
204
|
-
password?: string | undefined;
|
205
|
-
host: string;
|
206
|
-
database: string;
|
207
|
-
}>, import("zod").ZodObject<{
|
208
|
-
connectionString: import("zod").ZodString;
|
209
|
-
}, "strip", import("zod").ZodTypeAny, {
|
210
|
-
connectionString: string;
|
211
|
-
}, {
|
212
|
-
connectionString: string;
|
213
|
-
}>, import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>]>>;
|
214
|
-
export declare const mySqlIntrospectConfigSchema: import("zod").ZodIntersection<import("zod").ZodObject<{
|
215
|
-
schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
216
|
-
out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
217
|
-
breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
218
|
-
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
219
|
-
schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
220
|
-
introspect: import("zod").ZodDefault<import("zod").ZodObject<{
|
221
|
-
casing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
|
222
|
-
}, "strip", import("zod").ZodTypeAny, {
|
223
|
-
casing: "camel" | "preserve";
|
224
|
-
}, {
|
225
|
-
casing?: "camel" | "preserve" | undefined;
|
226
|
-
}>>;
|
227
|
-
}, "strip", import("zod").ZodTypeAny, {
|
228
|
-
schema?: string | string[] | undefined;
|
229
|
-
tablesFilter?: string | string[] | undefined;
|
230
|
-
out: string;
|
231
|
-
breakpoints: boolean;
|
232
|
-
schemaFilter: string | string[];
|
233
|
-
introspect: {
|
234
|
-
casing: "camel" | "preserve";
|
235
|
-
};
|
236
|
-
}, {
|
237
|
-
schema?: string | string[] | undefined;
|
238
|
-
out?: string | undefined;
|
239
|
-
breakpoints?: boolean | undefined;
|
240
|
-
tablesFilter?: string | string[] | undefined;
|
241
|
-
schemaFilter?: string | string[] | undefined;
|
242
|
-
introspect?: {
|
243
|
-
casing?: "camel" | "preserve" | undefined;
|
244
|
-
} | undefined;
|
245
|
-
}>, import("zod").ZodUnion<[import("zod").ZodObject<{
|
246
|
-
host: import("zod").ZodString;
|
247
|
-
port: import("zod").ZodOptional<import("zod").ZodNumber>;
|
248
|
-
user: import("zod").ZodDefault<import("zod").ZodString>;
|
249
|
-
password: import("zod").ZodOptional<import("zod").ZodString>;
|
250
|
-
database: import("zod").ZodString;
|
251
|
-
}, "strip", import("zod").ZodTypeAny, {
|
252
|
-
port?: number | undefined;
|
253
|
-
password?: string | undefined;
|
254
|
-
host: string;
|
255
|
-
user: string;
|
256
|
-
database: string;
|
257
|
-
}, {
|
258
|
-
port?: number | undefined;
|
259
|
-
user?: string | undefined;
|
260
|
-
password?: string | undefined;
|
261
|
-
host: string;
|
262
|
-
database: string;
|
263
|
-
}>, import("zod").ZodObject<{
|
264
|
-
connectionString: import("zod").ZodString;
|
265
|
-
}, "strip", import("zod").ZodTypeAny, {
|
266
|
-
connectionString: string;
|
267
|
-
}, {
|
268
|
-
connectionString: string;
|
269
|
-
}>, import("zod").ZodObject<{}, "strip", import("zod").ZodTypeAny, {}, {}>]>>;
|
270
|
-
export type MySqlCliConfig = TypeOf<typeof mySqlCliConfigSchema>;
|
271
|
-
export type CliConfig = MySqlCliConfig;
|
272
|
-
export type Driver = TypeOf<typeof driver>;
|
273
28
|
export declare const drizzleConfigFromFile: (configPath?: string) => Promise<CliConfig>;
|
274
29
|
export declare const readDrizzleConfig: (configPath?: string) => Promise<any>;
|