drizzle-kit 0.20.0-f39d8bc → 0.20.0
Sign up to get free protection for your applications and to get access to all the features.
- package/@types/utils.d.ts +12 -0
- package/cli/commands/migrate.d.ts +260 -0
- package/cli/commands/mysqlUp.d.ts +4 -0
- package/cli/commands/pgConnect.d.ts +5 -0
- package/cli/commands/pgIntrospect.d.ts +116 -0
- package/cli/commands/pgPushUtils.d.ts +14 -0
- package/cli/commands/pgUp.d.ts +4 -0
- package/cli/commands/sqliteIntrospect.d.ts +102 -0
- package/cli/commands/sqliteUtils.d.ts +162 -0
- package/cli/commands/upFolders.d.ts +27 -0
- package/cli/commands/utils.d.ts +265 -0
- package/cli/selector-ui.d.ts +13 -0
- package/cli/utils.d.ts +11 -0
- package/cli/validations/common.d.ts +13 -0
- package/cli/validations/mysql.d.ts +365 -0
- package/cli/validations/outputs.d.ts +40 -0
- package/cli/validations/pg.d.ts +438 -0
- package/cli/validations/sqlite.d.ts +220 -0
- package/cli/validations/studio.d.ts +593 -0
- package/cli/views.d.ts +61 -0
- package/drivers/index.d.ts +25 -0
- package/global.d.ts +3 -0
- package/index.cjs +31555 -39668
- package/index.d.ts +48 -1
- package/introspect.d.ts +4 -0
- package/jsonDiffer.d.ts +76 -0
- package/jsonStatements.d.ts +349 -0
- package/migrationPreparator.d.ts +35 -0
- package/orm-extenstions/d1-driver/driver.d.ts +8 -0
- package/orm-extenstions/d1-driver/session.d.ts +51 -0
- package/orm-extenstions/d1-driver/wrangler-client.d.ts +3 -0
- package/package.json +9 -7
- package/schemaValidator.d.ts +1306 -0
- package/serializer/index.d.ts +9 -0
- package/serializer/mysqlImports.d.ts +6 -0
- package/serializer/mysqlSchema.d.ts +3833 -0
- package/serializer/mysqlSerializer.d.ts +7 -0
- package/serializer/pgImports.d.ts +11 -0
- package/serializer/pgSchema.d.ts +4244 -0
- package/serializer/pgSerializer.d.ts +9 -0
- package/serializer/sqliteImports.d.ts +5 -0
- package/serializer/sqliteSchema.d.ts +3227 -0
- package/serializer/sqliteSerializer.d.ts +8 -0
- package/serializer/studioUtils.d.ts +53 -0
- package/snapshotsDiffer.d.ts +2660 -0
- package/sqlgenerator.d.ts +33 -0
- package/sqlite-introspect.d.ts +5 -0
- package/utils/words.d.ts +7 -0
- package/utils-studio.d.ts +5 -0
- package/utils-studio.js +3367 -0
- package/utils.d.ts +212 -0
- package/utils.js +52590 -11754
- package/loader.mjs +0 -57
@@ -0,0 +1,260 @@
|
|
1
|
+
import { CommonSchema, CommonSquashedSchema, Dialect } from "../../schemaValidator";
|
2
|
+
import { schema } from "../views";
|
3
|
+
import { PgSchema } from "src/serializer/pgSchema";
|
4
|
+
import { SQLiteSchema } from "src/serializer/sqliteSchema";
|
5
|
+
import { MySqlSchema } from "src/serializer/mysqlSchema";
|
6
|
+
import { Journal } from "src/utils";
|
7
|
+
import { GenerateConfig } from "./utils";
|
8
|
+
export type Named = {
|
9
|
+
name: string;
|
10
|
+
};
|
11
|
+
export type NamedWithSchema = {
|
12
|
+
name: string;
|
13
|
+
schema?: string;
|
14
|
+
};
|
15
|
+
export declare const prepareAndMigratePg: (config: GenerateConfig) => Promise<void>;
|
16
|
+
export declare const prepareMySQLPush: (config: {
|
17
|
+
schema: string | string[];
|
18
|
+
}, snapshot: MySqlSchema) => Promise<{
|
19
|
+
sqlStatements: string[];
|
20
|
+
statements: import("../../jsonStatements").JsonStatement[];
|
21
|
+
validatedCur: {
|
22
|
+
internal?: {
|
23
|
+
tables: Record<string, {
|
24
|
+
columns: Record<string, {
|
25
|
+
isDefaultAnExpression?: boolean | undefined;
|
26
|
+
} | undefined>;
|
27
|
+
} | undefined>;
|
28
|
+
} | undefined;
|
29
|
+
id: string;
|
30
|
+
prevId: string;
|
31
|
+
version: "5";
|
32
|
+
dialect: "mysql";
|
33
|
+
tables: Record<string, {
|
34
|
+
schema?: string | undefined;
|
35
|
+
name: string;
|
36
|
+
columns: Record<string, {
|
37
|
+
default?: any;
|
38
|
+
onUpdate?: any;
|
39
|
+
autoincrement?: boolean | undefined;
|
40
|
+
name: string;
|
41
|
+
type: string;
|
42
|
+
primaryKey: boolean;
|
43
|
+
notNull: boolean;
|
44
|
+
}>;
|
45
|
+
indexes: Record<string, {
|
46
|
+
using?: "btree" | "hash" | undefined;
|
47
|
+
algorithm?: "default" | "inplace" | "copy" | undefined;
|
48
|
+
lock?: "default" | "none" | "shared" | "exclusive" | undefined;
|
49
|
+
name: string;
|
50
|
+
columns: string[];
|
51
|
+
isUnique: boolean;
|
52
|
+
}>;
|
53
|
+
foreignKeys: Record<string, {
|
54
|
+
onUpdate?: string | undefined;
|
55
|
+
onDelete?: string | undefined;
|
56
|
+
name: string;
|
57
|
+
tableFrom: string;
|
58
|
+
columnsFrom: string[];
|
59
|
+
tableTo: string;
|
60
|
+
columnsTo: string[];
|
61
|
+
}>;
|
62
|
+
compositePrimaryKeys: Record<string, {
|
63
|
+
name: string;
|
64
|
+
columns: string[];
|
65
|
+
}>;
|
66
|
+
uniqueConstraints: Record<string, {
|
67
|
+
name: string;
|
68
|
+
columns: string[];
|
69
|
+
}>;
|
70
|
+
}>;
|
71
|
+
schemas: Record<string, string>;
|
72
|
+
_meta: {
|
73
|
+
columns: Record<string, string>;
|
74
|
+
tables: Record<string, string>;
|
75
|
+
schemas: Record<string, string>;
|
76
|
+
};
|
77
|
+
};
|
78
|
+
validatedPrev: {
|
79
|
+
internal?: {
|
80
|
+
tables: Record<string, {
|
81
|
+
columns: Record<string, {
|
82
|
+
isDefaultAnExpression?: boolean | undefined;
|
83
|
+
} | undefined>;
|
84
|
+
} | undefined>;
|
85
|
+
} | undefined;
|
86
|
+
id: string;
|
87
|
+
prevId: string;
|
88
|
+
version: "5";
|
89
|
+
dialect: "mysql";
|
90
|
+
tables: Record<string, {
|
91
|
+
schema?: string | undefined;
|
92
|
+
name: string;
|
93
|
+
columns: Record<string, {
|
94
|
+
default?: any;
|
95
|
+
onUpdate?: any;
|
96
|
+
autoincrement?: boolean | undefined;
|
97
|
+
name: string;
|
98
|
+
type: string;
|
99
|
+
primaryKey: boolean;
|
100
|
+
notNull: boolean;
|
101
|
+
}>;
|
102
|
+
indexes: Record<string, {
|
103
|
+
using?: "btree" | "hash" | undefined;
|
104
|
+
algorithm?: "default" | "inplace" | "copy" | undefined;
|
105
|
+
lock?: "default" | "none" | "shared" | "exclusive" | undefined;
|
106
|
+
name: string;
|
107
|
+
columns: string[];
|
108
|
+
isUnique: boolean;
|
109
|
+
}>;
|
110
|
+
foreignKeys: Record<string, {
|
111
|
+
onUpdate?: string | undefined;
|
112
|
+
onDelete?: string | undefined;
|
113
|
+
name: string;
|
114
|
+
tableFrom: string;
|
115
|
+
columnsFrom: string[];
|
116
|
+
tableTo: string;
|
117
|
+
columnsTo: string[];
|
118
|
+
}>;
|
119
|
+
compositePrimaryKeys: Record<string, {
|
120
|
+
name: string;
|
121
|
+
columns: string[];
|
122
|
+
}>;
|
123
|
+
uniqueConstraints: Record<string, {
|
124
|
+
name: string;
|
125
|
+
columns: string[];
|
126
|
+
}>;
|
127
|
+
}>;
|
128
|
+
schemas: Record<string, string>;
|
129
|
+
_meta: {
|
130
|
+
columns: Record<string, string>;
|
131
|
+
tables: Record<string, string>;
|
132
|
+
schemas: Record<string, string>;
|
133
|
+
};
|
134
|
+
};
|
135
|
+
} | undefined>;
|
136
|
+
export declare const prepareSQLitePush: (config: {
|
137
|
+
schema: string | string[];
|
138
|
+
}, snapshot: SQLiteSchema) => Promise<{
|
139
|
+
sqlStatements: string[];
|
140
|
+
statements: import("../../jsonStatements").JsonStatement[];
|
141
|
+
squashedPrev: {
|
142
|
+
enums?: any;
|
143
|
+
version: "5";
|
144
|
+
dialect: "sqlite";
|
145
|
+
tables: Record<string, {
|
146
|
+
name: string;
|
147
|
+
columns: Record<string, {
|
148
|
+
default?: any;
|
149
|
+
autoincrement?: boolean | undefined;
|
150
|
+
name: string;
|
151
|
+
type: string;
|
152
|
+
primaryKey: boolean;
|
153
|
+
notNull: boolean;
|
154
|
+
}>;
|
155
|
+
indexes: Record<string, string>;
|
156
|
+
foreignKeys: Record<string, string>;
|
157
|
+
compositePrimaryKeys: Record<string, string>;
|
158
|
+
uniqueConstraints: Record<string, string>;
|
159
|
+
}>;
|
160
|
+
};
|
161
|
+
squashedCur: {
|
162
|
+
enums?: any;
|
163
|
+
version: "5";
|
164
|
+
dialect: "sqlite";
|
165
|
+
tables: Record<string, {
|
166
|
+
name: string;
|
167
|
+
columns: Record<string, {
|
168
|
+
default?: any;
|
169
|
+
autoincrement?: boolean | undefined;
|
170
|
+
name: string;
|
171
|
+
type: string;
|
172
|
+
primaryKey: boolean;
|
173
|
+
notNull: boolean;
|
174
|
+
}>;
|
175
|
+
indexes: Record<string, string>;
|
176
|
+
foreignKeys: Record<string, string>;
|
177
|
+
compositePrimaryKeys: Record<string, string>;
|
178
|
+
uniqueConstraints: Record<string, string>;
|
179
|
+
}>;
|
180
|
+
};
|
181
|
+
meta: {
|
182
|
+
schemas: {};
|
183
|
+
tables: {};
|
184
|
+
columns: {};
|
185
|
+
} | undefined;
|
186
|
+
} | undefined>;
|
187
|
+
export declare const preparePgPush: (config: {
|
188
|
+
schema: string | string[];
|
189
|
+
}, snapshot: PgSchema, schemaFilter: string[]) => Promise<{
|
190
|
+
sqlStatements: string[];
|
191
|
+
statements: import("../../jsonStatements").JsonStatement[];
|
192
|
+
squashedPrev: {
|
193
|
+
version: "5";
|
194
|
+
dialect: "pg";
|
195
|
+
tables: Record<string, {
|
196
|
+
name: string;
|
197
|
+
columns: Record<string, {
|
198
|
+
isUnique?: any;
|
199
|
+
default?: any;
|
200
|
+
uniqueName?: string | undefined;
|
201
|
+
nullsNotDistinct?: boolean | undefined;
|
202
|
+
name: string;
|
203
|
+
type: string;
|
204
|
+
primaryKey: boolean;
|
205
|
+
notNull: boolean;
|
206
|
+
}>;
|
207
|
+
indexes: Record<string, string>;
|
208
|
+
foreignKeys: Record<string, string>;
|
209
|
+
schema: string;
|
210
|
+
compositePrimaryKeys: Record<string, string>;
|
211
|
+
uniqueConstraints: Record<string, string>;
|
212
|
+
}>;
|
213
|
+
schemas: Record<string, string>;
|
214
|
+
enums: Record<string, {
|
215
|
+
name: string;
|
216
|
+
values: Record<string, string>;
|
217
|
+
}>;
|
218
|
+
};
|
219
|
+
squashedCur: {
|
220
|
+
version: "5";
|
221
|
+
dialect: "pg";
|
222
|
+
tables: Record<string, {
|
223
|
+
name: string;
|
224
|
+
columns: Record<string, {
|
225
|
+
isUnique?: any;
|
226
|
+
default?: any;
|
227
|
+
uniqueName?: string | undefined;
|
228
|
+
nullsNotDistinct?: boolean | undefined;
|
229
|
+
name: string;
|
230
|
+
type: string;
|
231
|
+
primaryKey: boolean;
|
232
|
+
notNull: boolean;
|
233
|
+
}>;
|
234
|
+
indexes: Record<string, string>;
|
235
|
+
foreignKeys: Record<string, string>;
|
236
|
+
schema: string;
|
237
|
+
compositePrimaryKeys: Record<string, string>;
|
238
|
+
uniqueConstraints: Record<string, string>;
|
239
|
+
}>;
|
240
|
+
schemas: Record<string, string>;
|
241
|
+
enums: Record<string, {
|
242
|
+
name: string;
|
243
|
+
values: Record<string, string>;
|
244
|
+
}>;
|
245
|
+
};
|
246
|
+
} | undefined>;
|
247
|
+
export declare const prepareAndMigrateMySql: (config: GenerateConfig) => Promise<void>;
|
248
|
+
export declare const prepareAndMigrateSqlite: (config: GenerateConfig) => Promise<void>;
|
249
|
+
export declare const prepareSQL: (prev: CommonSquashedSchema, cur: CommonSquashedSchema, dialect: Dialect, prevFull?: any, curFull?: any) => Promise<{
|
250
|
+
statements: import("../../jsonStatements").JsonStatement[];
|
251
|
+
sqlStatements: string[];
|
252
|
+
_meta: {
|
253
|
+
schemas: {};
|
254
|
+
tables: {};
|
255
|
+
columns: {};
|
256
|
+
} | undefined;
|
257
|
+
}>;
|
258
|
+
export declare const BREAKPOINT = "--> statement-breakpoint\n";
|
259
|
+
export declare const writeResult: (cur: CommonSchema, sqlStatements: string[], journal: Journal, _meta: any, outFolder: string, breakpoints: boolean, type?: "introspect" | "custom" | "none") => void;
|
260
|
+
export declare const prepareSnapshotFolderName: () => string;
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { MySqlSchema, MySqlSchemaV4 } from "src/serializer/mysqlSchema";
|
2
|
+
export declare const upMysqlHandler: (out: string) => void;
|
3
|
+
export declare const upMySqlHandlerV4toV5: (obj: MySqlSchemaV4) => MySqlSchema;
|
4
|
+
export declare const upMysqlHandlerV4: (out: string) => void;
|
@@ -0,0 +1,116 @@
|
|
1
|
+
import type { PgConfigIntrospect } from "../validations/pg";
|
2
|
+
import type { DrizzleDbClient } from "src/drivers";
|
3
|
+
export declare const pgSchemas: (client: DrizzleDbClient) => Promise<string[]>;
|
4
|
+
export declare const pgPushIntrospect: (connection: {
|
5
|
+
client: DrizzleDbClient;
|
6
|
+
}, filters: string[], schemaFilters: string[]) => Promise<{
|
7
|
+
schema: {
|
8
|
+
id: string;
|
9
|
+
prevId: string;
|
10
|
+
version: "5";
|
11
|
+
dialect: "pg";
|
12
|
+
tables: Record<string, {
|
13
|
+
name: string;
|
14
|
+
columns: Record<string, {
|
15
|
+
isUnique?: any;
|
16
|
+
default?: any;
|
17
|
+
uniqueName?: string | undefined;
|
18
|
+
nullsNotDistinct?: boolean | undefined;
|
19
|
+
name: string;
|
20
|
+
type: string;
|
21
|
+
primaryKey: boolean;
|
22
|
+
notNull: boolean;
|
23
|
+
}>;
|
24
|
+
indexes: Record<string, {
|
25
|
+
name: string;
|
26
|
+
columns: string[];
|
27
|
+
isUnique: boolean;
|
28
|
+
}>;
|
29
|
+
foreignKeys: Record<string, {
|
30
|
+
onUpdate?: string | undefined;
|
31
|
+
onDelete?: string | undefined;
|
32
|
+
name: string;
|
33
|
+
tableFrom: string;
|
34
|
+
columnsFrom: string[];
|
35
|
+
tableTo: string;
|
36
|
+
columnsTo: string[];
|
37
|
+
}>;
|
38
|
+
schema: string;
|
39
|
+
compositePrimaryKeys: Record<string, {
|
40
|
+
name: string;
|
41
|
+
columns: string[];
|
42
|
+
}>;
|
43
|
+
uniqueConstraints: Record<string, {
|
44
|
+
name: string;
|
45
|
+
columns: string[];
|
46
|
+
nullsNotDistinct: boolean;
|
47
|
+
}>;
|
48
|
+
}>;
|
49
|
+
schemas: Record<string, string>;
|
50
|
+
_meta: {
|
51
|
+
columns: Record<string, string>;
|
52
|
+
tables: Record<string, string>;
|
53
|
+
schemas: Record<string, string>;
|
54
|
+
};
|
55
|
+
enums: Record<string, {
|
56
|
+
name: string;
|
57
|
+
values: Record<string, string>;
|
58
|
+
}>;
|
59
|
+
};
|
60
|
+
}>;
|
61
|
+
export declare const pgIntrospect: (config: PgConfigIntrospect, filters: string[], schemaFilters: string[]) => Promise<{
|
62
|
+
schema: {
|
63
|
+
id: string;
|
64
|
+
prevId: string;
|
65
|
+
version: "5";
|
66
|
+
dialect: "pg";
|
67
|
+
tables: Record<string, {
|
68
|
+
name: string;
|
69
|
+
columns: Record<string, {
|
70
|
+
isUnique?: any;
|
71
|
+
default?: any;
|
72
|
+
uniqueName?: string | undefined;
|
73
|
+
nullsNotDistinct?: boolean | undefined;
|
74
|
+
name: string;
|
75
|
+
type: string;
|
76
|
+
primaryKey: boolean;
|
77
|
+
notNull: boolean;
|
78
|
+
}>;
|
79
|
+
indexes: Record<string, {
|
80
|
+
name: string;
|
81
|
+
columns: string[];
|
82
|
+
isUnique: boolean;
|
83
|
+
}>;
|
84
|
+
foreignKeys: Record<string, {
|
85
|
+
onUpdate?: string | undefined;
|
86
|
+
onDelete?: string | undefined;
|
87
|
+
name: string;
|
88
|
+
tableFrom: string;
|
89
|
+
columnsFrom: string[];
|
90
|
+
tableTo: string;
|
91
|
+
columnsTo: string[];
|
92
|
+
}>;
|
93
|
+
schema: string;
|
94
|
+
compositePrimaryKeys: Record<string, {
|
95
|
+
name: string;
|
96
|
+
columns: string[];
|
97
|
+
}>;
|
98
|
+
uniqueConstraints: Record<string, {
|
99
|
+
name: string;
|
100
|
+
columns: string[];
|
101
|
+
nullsNotDistinct: boolean;
|
102
|
+
}>;
|
103
|
+
}>;
|
104
|
+
schemas: Record<string, string>;
|
105
|
+
_meta: {
|
106
|
+
columns: Record<string, string>;
|
107
|
+
tables: Record<string, string>;
|
108
|
+
schemas: Record<string, string>;
|
109
|
+
};
|
110
|
+
enums: Record<string, {
|
111
|
+
name: string;
|
112
|
+
values: Record<string, string>;
|
113
|
+
}>;
|
114
|
+
};
|
115
|
+
ts: string;
|
116
|
+
}>;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { DrizzleDbClient } from "src/drivers";
|
2
|
+
import { JsonStatement } from "src/jsonStatements";
|
3
|
+
export declare const pgSuggestions: ({ connection, statements, }: {
|
4
|
+
statements: JsonStatement[];
|
5
|
+
connection: DrizzleDbClient;
|
6
|
+
}) => Promise<{
|
7
|
+
statementsToExecute: string[];
|
8
|
+
shouldAskForApprove: boolean;
|
9
|
+
infoToPrint: string[];
|
10
|
+
columnsToRemove: string[];
|
11
|
+
schemasToRemove: string[];
|
12
|
+
tablesToTruncate: string[];
|
13
|
+
tablesToRemove: string[];
|
14
|
+
}>;
|
@@ -0,0 +1,102 @@
|
|
1
|
+
import type { SQLiteCliConfig, SQLiteConnectionConfig } from "./sqliteUtils";
|
2
|
+
import type { DrizzleDbClient } from "../../drivers";
|
3
|
+
export declare const connectToSQLite: (config: SQLiteConnectionConfig) => Promise<{
|
4
|
+
client: import("../../drivers").BetterSqlite;
|
5
|
+
} | {
|
6
|
+
client?: undefined;
|
7
|
+
}>;
|
8
|
+
export declare const sqliteIntrospect: (config: SQLiteCliConfig, filters: string[]) => Promise<{
|
9
|
+
schema: {
|
10
|
+
id: string;
|
11
|
+
prevId: string;
|
12
|
+
version: "5";
|
13
|
+
dialect: "sqlite";
|
14
|
+
tables: Record<string, {
|
15
|
+
name: string;
|
16
|
+
columns: Record<string, {
|
17
|
+
default?: any;
|
18
|
+
autoincrement?: boolean | undefined;
|
19
|
+
name: string;
|
20
|
+
type: string;
|
21
|
+
primaryKey: boolean;
|
22
|
+
notNull: boolean;
|
23
|
+
}>;
|
24
|
+
indexes: Record<string, {
|
25
|
+
where?: string | undefined;
|
26
|
+
name: string;
|
27
|
+
columns: string[];
|
28
|
+
isUnique: boolean;
|
29
|
+
}>;
|
30
|
+
foreignKeys: Record<string, {
|
31
|
+
onUpdate?: string | undefined;
|
32
|
+
onDelete?: string | undefined;
|
33
|
+
name: string;
|
34
|
+
tableFrom: string;
|
35
|
+
columnsFrom: string[];
|
36
|
+
tableTo: string;
|
37
|
+
columnsTo: string[];
|
38
|
+
}>;
|
39
|
+
compositePrimaryKeys: Record<string, {
|
40
|
+
name: string;
|
41
|
+
columns: string[];
|
42
|
+
}>;
|
43
|
+
uniqueConstraints: Record<string, {
|
44
|
+
name: string;
|
45
|
+
columns: string[];
|
46
|
+
}>;
|
47
|
+
}>;
|
48
|
+
_meta: {
|
49
|
+
columns: Record<string, string>;
|
50
|
+
tables: Record<string, string>;
|
51
|
+
};
|
52
|
+
enums: {};
|
53
|
+
};
|
54
|
+
ts: string;
|
55
|
+
}>;
|
56
|
+
export declare const sqlitePushIntrospect: (client: DrizzleDbClient, filters: string[]) => Promise<{
|
57
|
+
schema: {
|
58
|
+
id: string;
|
59
|
+
prevId: string;
|
60
|
+
version: "5";
|
61
|
+
dialect: "sqlite";
|
62
|
+
tables: Record<string, {
|
63
|
+
name: string;
|
64
|
+
columns: Record<string, {
|
65
|
+
default?: any;
|
66
|
+
autoincrement?: boolean | undefined;
|
67
|
+
name: string;
|
68
|
+
type: string;
|
69
|
+
primaryKey: boolean;
|
70
|
+
notNull: boolean;
|
71
|
+
}>;
|
72
|
+
indexes: Record<string, {
|
73
|
+
where?: string | undefined;
|
74
|
+
name: string;
|
75
|
+
columns: string[];
|
76
|
+
isUnique: boolean;
|
77
|
+
}>;
|
78
|
+
foreignKeys: Record<string, {
|
79
|
+
onUpdate?: string | undefined;
|
80
|
+
onDelete?: string | undefined;
|
81
|
+
name: string;
|
82
|
+
tableFrom: string;
|
83
|
+
columnsFrom: string[];
|
84
|
+
tableTo: string;
|
85
|
+
columnsTo: string[];
|
86
|
+
}>;
|
87
|
+
compositePrimaryKeys: Record<string, {
|
88
|
+
name: string;
|
89
|
+
columns: string[];
|
90
|
+
}>;
|
91
|
+
uniqueConstraints: Record<string, {
|
92
|
+
name: string;
|
93
|
+
columns: string[];
|
94
|
+
}>;
|
95
|
+
}>;
|
96
|
+
_meta: {
|
97
|
+
columns: Record<string, string>;
|
98
|
+
tables: Record<string, string>;
|
99
|
+
};
|
100
|
+
enums: {};
|
101
|
+
};
|
102
|
+
}>;
|
@@ -0,0 +1,162 @@
|
|
1
|
+
import { TypeOf } from "zod";
|
2
|
+
import { configIntrospectSchema } from "./utils";
|
3
|
+
export declare const sqliteConnectionSchema: import("zod").ZodUnion<[import("zod").ZodObject<{
|
4
|
+
driver: import("zod").ZodLiteral<"turso">;
|
5
|
+
dbCredentials: import("zod").ZodObject<{
|
6
|
+
url: import("zod").ZodString;
|
7
|
+
authToken: import("zod").ZodOptional<import("zod").ZodString>;
|
8
|
+
}, "strip", import("zod").ZodTypeAny, {
|
9
|
+
authToken?: string | undefined;
|
10
|
+
url: string;
|
11
|
+
}, {
|
12
|
+
authToken?: string | undefined;
|
13
|
+
url: string;
|
14
|
+
}>;
|
15
|
+
}, "strip", import("zod").ZodTypeAny, {
|
16
|
+
driver: "turso";
|
17
|
+
dbCredentials: {
|
18
|
+
authToken?: string | undefined;
|
19
|
+
url: string;
|
20
|
+
};
|
21
|
+
}, {
|
22
|
+
driver: "turso";
|
23
|
+
dbCredentials: {
|
24
|
+
authToken?: string | undefined;
|
25
|
+
url: string;
|
26
|
+
};
|
27
|
+
}>, import("zod").ZodObject<{
|
28
|
+
driver: import("zod").ZodLiteral<"libsql">;
|
29
|
+
dbCredentials: import("zod").ZodObject<{
|
30
|
+
url: import("zod").ZodString;
|
31
|
+
}, "strip", import("zod").ZodTypeAny, {
|
32
|
+
url: string;
|
33
|
+
}, {
|
34
|
+
url: string;
|
35
|
+
}>;
|
36
|
+
}, "strip", import("zod").ZodTypeAny, {
|
37
|
+
driver: "libsql";
|
38
|
+
dbCredentials: {
|
39
|
+
url: string;
|
40
|
+
};
|
41
|
+
}, {
|
42
|
+
driver: "libsql";
|
43
|
+
dbCredentials: {
|
44
|
+
url: string;
|
45
|
+
};
|
46
|
+
}>, import("zod").ZodObject<{
|
47
|
+
driver: import("zod").ZodLiteral<"better-sqlite">;
|
48
|
+
dbCredentials: import("zod").ZodObject<{
|
49
|
+
url: import("zod").ZodString;
|
50
|
+
}, "strip", import("zod").ZodTypeAny, {
|
51
|
+
url: string;
|
52
|
+
}, {
|
53
|
+
url: string;
|
54
|
+
}>;
|
55
|
+
}, "strip", import("zod").ZodTypeAny, {
|
56
|
+
driver: "better-sqlite";
|
57
|
+
dbCredentials: {
|
58
|
+
url: string;
|
59
|
+
};
|
60
|
+
}, {
|
61
|
+
driver: "better-sqlite";
|
62
|
+
dbCredentials: {
|
63
|
+
url: string;
|
64
|
+
};
|
65
|
+
}>]>;
|
66
|
+
export declare const sqliteCliConfigSchema: import("zod").ZodIntersection<import("zod").ZodObject<{
|
67
|
+
schema: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
68
|
+
out: import("zod").ZodDefault<import("zod").ZodOptional<import("zod").ZodString>>;
|
69
|
+
breakpoints: import("zod").ZodDefault<import("zod").ZodBoolean>;
|
70
|
+
tablesFilter: import("zod").ZodOptional<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
71
|
+
schemaFilter: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodString, import("zod").ZodArray<import("zod").ZodString, "many">]>>;
|
72
|
+
introspect: import("zod").ZodDefault<import("zod").ZodObject<{
|
73
|
+
casing: import("zod").ZodDefault<import("zod").ZodUnion<[import("zod").ZodLiteral<"camel">, import("zod").ZodLiteral<"preserve">]>>;
|
74
|
+
}, "strip", import("zod").ZodTypeAny, {
|
75
|
+
casing: "camel" | "preserve";
|
76
|
+
}, {
|
77
|
+
casing?: "camel" | "preserve" | undefined;
|
78
|
+
}>>;
|
79
|
+
}, "strip", import("zod").ZodTypeAny, {
|
80
|
+
schema?: string | string[] | undefined;
|
81
|
+
tablesFilter?: string | string[] | undefined;
|
82
|
+
out: string;
|
83
|
+
breakpoints: boolean;
|
84
|
+
schemaFilter: string | string[];
|
85
|
+
introspect: {
|
86
|
+
casing: "camel" | "preserve";
|
87
|
+
};
|
88
|
+
}, {
|
89
|
+
schema?: string | string[] | undefined;
|
90
|
+
out?: string | undefined;
|
91
|
+
breakpoints?: boolean | undefined;
|
92
|
+
tablesFilter?: string | string[] | undefined;
|
93
|
+
schemaFilter?: string | string[] | undefined;
|
94
|
+
introspect?: {
|
95
|
+
casing?: "camel" | "preserve" | undefined;
|
96
|
+
} | undefined;
|
97
|
+
}>, import("zod").ZodUnion<[import("zod").ZodObject<{
|
98
|
+
driver: import("zod").ZodLiteral<"turso">;
|
99
|
+
dbCredentials: import("zod").ZodObject<{
|
100
|
+
url: import("zod").ZodString;
|
101
|
+
authToken: import("zod").ZodOptional<import("zod").ZodString>;
|
102
|
+
}, "strip", import("zod").ZodTypeAny, {
|
103
|
+
authToken?: string | undefined;
|
104
|
+
url: string;
|
105
|
+
}, {
|
106
|
+
authToken?: string | undefined;
|
107
|
+
url: string;
|
108
|
+
}>;
|
109
|
+
}, "strip", import("zod").ZodTypeAny, {
|
110
|
+
driver: "turso";
|
111
|
+
dbCredentials: {
|
112
|
+
authToken?: string | undefined;
|
113
|
+
url: string;
|
114
|
+
};
|
115
|
+
}, {
|
116
|
+
driver: "turso";
|
117
|
+
dbCredentials: {
|
118
|
+
authToken?: string | undefined;
|
119
|
+
url: string;
|
120
|
+
};
|
121
|
+
}>, import("zod").ZodObject<{
|
122
|
+
driver: import("zod").ZodLiteral<"libsql">;
|
123
|
+
dbCredentials: import("zod").ZodObject<{
|
124
|
+
url: import("zod").ZodString;
|
125
|
+
}, "strip", import("zod").ZodTypeAny, {
|
126
|
+
url: string;
|
127
|
+
}, {
|
128
|
+
url: string;
|
129
|
+
}>;
|
130
|
+
}, "strip", import("zod").ZodTypeAny, {
|
131
|
+
driver: "libsql";
|
132
|
+
dbCredentials: {
|
133
|
+
url: string;
|
134
|
+
};
|
135
|
+
}, {
|
136
|
+
driver: "libsql";
|
137
|
+
dbCredentials: {
|
138
|
+
url: string;
|
139
|
+
};
|
140
|
+
}>, import("zod").ZodObject<{
|
141
|
+
driver: import("zod").ZodLiteral<"better-sqlite">;
|
142
|
+
dbCredentials: import("zod").ZodObject<{
|
143
|
+
url: import("zod").ZodString;
|
144
|
+
}, "strip", import("zod").ZodTypeAny, {
|
145
|
+
url: string;
|
146
|
+
}, {
|
147
|
+
url: string;
|
148
|
+
}>;
|
149
|
+
}, "strip", import("zod").ZodTypeAny, {
|
150
|
+
driver: "better-sqlite";
|
151
|
+
dbCredentials: {
|
152
|
+
url: string;
|
153
|
+
};
|
154
|
+
}, {
|
155
|
+
driver: "better-sqlite";
|
156
|
+
dbCredentials: {
|
157
|
+
url: string;
|
158
|
+
};
|
159
|
+
}>]>>;
|
160
|
+
export type SQLiteCliConfig = TypeOf<typeof sqliteCliConfigSchema>;
|
161
|
+
export type SQLiteConnectionConfig = TypeOf<typeof sqliteConnectionSchema>;
|
162
|
+
export { configIntrospectSchema };
|