drizzle-kit 0.20.18 → 0.21.0-178d0dc
Sign up to get free protection for your applications and to get access to all the features.
- package/bin.cjs +104692 -56730
- package/index.d.mts +232 -68
- package/index.d.ts +232 -68
- package/index.js +1 -0
- package/package.json +44 -72
- package/payload.d.mts +1052 -18
- package/payload.d.ts +1052 -18
- package/payload.js +22129 -34534
- package/payload.mjs +22174 -34562
- package/utils-studio.js +4580 -805
- package/utils-studio.mjs +4556 -784
- package/utils.js +4410 -6940
- package/utils.mjs +4852 -7382
- package/@types/utils.d.ts +0 -12
- package/cli/commands/migrate.d.ts +0 -270
- package/cli/commands/mysqlIntrospect.d.ts +0 -119
- package/cli/commands/mysqlPushUtils.d.ts +0 -18
- package/cli/commands/mysqlUp.d.ts +0 -4
- package/cli/commands/pgConnect.d.ts +0 -5
- package/cli/commands/pgIntrospect.d.ts +0 -123
- package/cli/commands/pgPushUtils.d.ts +0 -14
- package/cli/commands/pgUp.d.ts +0 -4
- package/cli/commands/sqliteIntrospect.d.ts +0 -107
- package/cli/commands/sqlitePushUtils.d.ts +0 -21
- package/cli/commands/sqliteUtils.d.ts +0 -162
- package/cli/commands/upFolders.d.ts +0 -27
- package/cli/commands/utils.d.ts +0 -274
- package/cli/selector-ui.d.ts +0 -13
- package/cli/validations/common.d.ts +0 -13
- package/cli/validations/mysql.d.ts +0 -365
- package/cli/validations/outputs.d.ts +0 -40
- package/cli/validations/pg.d.ts +0 -438
- package/cli/views.d.ts +0 -61
- package/drivers/index.d.ts +0 -39
- package/global.d.ts +0 -4
- package/introspect-mysql.d.ts +0 -9
- package/introspect-pg.d.ts +0 -12
- package/introspect-sqlite.d.ts +0 -10
- package/jsonDiffer.d.ts +0 -76
- package/jsonStatements.d.ts +0 -349
- package/migrationPreparator.d.ts +0 -35
- package/schemaValidator.d.ts +0 -1313
- package/serializer/index.d.ts +0 -9
- package/serializer/mysqlImports.d.ts +0 -11
- package/serializer/mysqlSchema.d.ts +0 -3833
- package/serializer/mysqlSerializer.d.ts +0 -7
- package/serializer/pgImports.d.ts +0 -11
- package/serializer/pgSchema.d.ts +0 -4333
- package/serializer/pgSerializer.d.ts +0 -7
- package/serializer/schemaToDrizzle.d.ts +0 -7
- package/serializer/sqliteImports.d.ts +0 -9
- package/serializer/sqliteSchema.d.ts +0 -3227
- package/serializer/sqliteSerializer.d.ts +0 -6
- package/snapshotsDiffer.d.ts +0 -2660
- package/sqlgenerator.d.ts +0 -33
- package/utils/words.d.ts +0 -7
- package/utils-studio.d.mts +0 -5
- package/utils-studio.d.ts +0 -5
- package/utils.d.ts +0 -199
package/index.d.mts
CHANGED
@@ -1,79 +1,137 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
1
|
+
import { SslOptions } from 'mysql2';
|
2
|
+
import * as zod from 'zod';
|
3
|
+
import { TypeOf } from 'zod';
|
4
|
+
|
5
|
+
declare const driver: zod.ZodUnion<[zod.ZodUnion<[zod.ZodLiteral<"better-sqlite">, zod.ZodLiteral<"turso">, zod.ZodLiteral<"libsql">, zod.ZodLiteral<"d1">, zod.ZodLiteral<"expo">]>, zod.ZodLiteral<"aws-data-api">, zod.ZodLiteral<"mysql2">]>;
|
6
|
+
type Driver = TypeOf<typeof driver>;
|
7
|
+
|
8
|
+
declare const dialect: zod.ZodEnum<["postgresql", "mysql", "sqlite"]>;
|
9
|
+
type Dialect = TypeOf<typeof dialect>;
|
10
|
+
|
11
|
+
type Verify<T, U extends T> = U;
|
12
|
+
/**
|
13
|
+
* **You are currently using version 0.21.0+ of drizzle-kit. If you have just upgraded to this version, please make sure to read the changelog to understand what changes have been made and what
|
14
|
+
* adjustments may be necessary for you. See https://orm.drizzle.team/kit-docs/upgrade-21#how-to-migrate-to-0210**
|
15
|
+
*
|
16
|
+
*
|
17
|
+
* **Config** usage:
|
18
|
+
*
|
19
|
+
* `dialect` - mandatory and is responsible for explicitly providing a databse dialect you are using for all the commands
|
20
|
+
* *Possible values*: `postgresql`, `mysql`, `sqlite`
|
21
|
+
*
|
22
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#dialect
|
23
|
+
*
|
24
|
+
* ---
|
25
|
+
* `schema` - param lets you define where your schema file/files live.
|
26
|
+
* You can have as many separate schema files as you want and define paths to them using glob or array of globs syntax.
|
27
|
+
*
|
28
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#schema
|
29
|
+
*
|
30
|
+
* ---
|
31
|
+
* `out` - allows you to define the folder for your migrations and a folder, where drizzle will introspect the schema and relations
|
32
|
+
*
|
33
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#out
|
34
|
+
*
|
35
|
+
* ---
|
36
|
+
* `driver` - optional param that is responsible for explicitly providing a driver to use when accessing a database
|
37
|
+
* *Possible values*: `aws-data-api`, `d1-http`, `expo`, `turso`
|
38
|
+
* If you don't use AWS Data API, D1, Turso or Expo - ypu don't need this driver. You can check a driver strategy choice here: https://orm.drizzle.team/kit-docs/upgrade-21
|
39
|
+
*
|
40
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#driver
|
41
|
+
*
|
42
|
+
* ---
|
43
|
+
*
|
44
|
+
* `dbCredentials` - an object to define your connection to the database. For more info please check the docs
|
45
|
+
*
|
46
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#dbcredentials
|
47
|
+
*
|
48
|
+
* ---
|
49
|
+
*
|
50
|
+
* `migrations` - param let’s use specify custom table and schema(PostgreSQL only) for migrations.
|
51
|
+
* By default, all information about executed migrations will be stored in the database inside
|
52
|
+
* the `__drizzle_migrations` table, and for PostgreSQL, inside the drizzle schema.
|
53
|
+
* However, you can configure where to store those records.
|
54
|
+
*
|
55
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#migrations
|
56
|
+
*
|
57
|
+
* ---
|
58
|
+
*
|
59
|
+
* `breakpoints` - param lets you enable/disable SQL statement breakpoints in generated migrations.
|
60
|
+
* It’s optional and true by default, it’s necessary to properly apply migrations on databases,
|
61
|
+
* that do not support multiple DDL alternation statements in one transaction(MySQL, SQLite) and
|
62
|
+
* Drizzle ORM has to apply them sequentially one by one.
|
63
|
+
*
|
64
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#breakpoints
|
65
|
+
*
|
66
|
+
* ---
|
67
|
+
*
|
68
|
+
* `tablesFilters` - param lets you filter tables with glob syntax for db push command.
|
69
|
+
* It’s useful when you have only one database avaialable for several separate projects with separate sql schemas.
|
70
|
+
*
|
71
|
+
* How to define multi-project tables with Drizzle ORM — see https://orm.drizzle.team/docs/goodies#multi-project-schema
|
72
|
+
*
|
73
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#tablesfilters
|
74
|
+
*
|
75
|
+
* ---
|
76
|
+
*
|
77
|
+
* `schemaFilter` - parameter allows you to define which schema in PostgreSQL should be used for either introspect or push commands.
|
78
|
+
* This parameter accepts a single schema as a string or an array of schemas as strings.
|
79
|
+
* No glob pattern is supported here. By default, drizzle will use the public schema for both commands,
|
80
|
+
* but you can add any schema you need.
|
81
|
+
*
|
82
|
+
* For example, having schemaFilter: ["my_schema"] will only look for tables in both the database and
|
83
|
+
* drizzle schema that are a part of the my_schema schema.
|
84
|
+
*
|
85
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#schemafilter
|
86
|
+
*
|
87
|
+
* ---
|
88
|
+
*
|
89
|
+
* `verbose` - command is used for drizzle-kit push commands and prints all statements that will be executed.
|
90
|
+
*
|
91
|
+
* > Note: This command will only print the statements that should be executed.
|
92
|
+
* To approve them before applying, please refer to the `strict` command.
|
93
|
+
*
|
94
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#verbose
|
95
|
+
*
|
96
|
+
* ---
|
97
|
+
*
|
98
|
+
* `strict` - command is used for drizzle-kit push commands and will always ask for your confirmation,
|
99
|
+
* either to execute all statements needed to sync your schema with the database or not.
|
100
|
+
*
|
101
|
+
*
|
102
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#strict
|
103
|
+
*
|
104
|
+
*/
|
105
|
+
type Config = {
|
106
|
+
dialect: Dialect;
|
107
|
+
out?: string;
|
108
|
+
breakpoints?: boolean;
|
109
|
+
tablesFilter?: string | string[];
|
110
|
+
schemaFilter?: string | string[];
|
52
111
|
schema?: string | string[];
|
53
|
-
verbose?: boolean
|
54
|
-
strict?: boolean
|
55
|
-
|
112
|
+
verbose?: boolean;
|
113
|
+
strict?: boolean;
|
114
|
+
migrations?: {
|
115
|
+
table?: string;
|
116
|
+
schema?: string;
|
117
|
+
};
|
56
118
|
introspect?: {
|
57
119
|
casing: "camel" | "preserve";
|
58
120
|
};
|
59
121
|
} & ({
|
60
|
-
|
122
|
+
dialect: Verify<Dialect, "sqlite">;
|
123
|
+
driver: Verify<Driver, "turso">;
|
61
124
|
dbCredentials: {
|
62
125
|
url: string;
|
63
126
|
authToken?: string;
|
64
127
|
};
|
65
128
|
} | {
|
66
|
-
|
67
|
-
dbCredentials: {
|
68
|
-
url: string;
|
69
|
-
};
|
70
|
-
} | {
|
71
|
-
driver: "libsql";
|
129
|
+
dialect: "sqlite";
|
72
130
|
dbCredentials: {
|
73
131
|
url: string;
|
74
132
|
};
|
75
133
|
} | {
|
76
|
-
|
134
|
+
dialect: Verify<Dialect, "postgresql">;
|
77
135
|
dbCredentials: {
|
78
136
|
host: string;
|
79
137
|
port?: number;
|
@@ -82,26 +140,132 @@ export type Config = {
|
|
82
140
|
database: string;
|
83
141
|
ssl?: boolean;
|
84
142
|
} | {
|
85
|
-
|
143
|
+
url: string;
|
86
144
|
};
|
87
145
|
} | {
|
88
|
-
|
146
|
+
dialect: Verify<Dialect, "postgresql">;
|
147
|
+
driver: Verify<Driver, "aws-data-api">;
|
148
|
+
dbCredentials: {
|
149
|
+
database: string;
|
150
|
+
secretArn: string;
|
151
|
+
resourceArn: string;
|
152
|
+
};
|
153
|
+
} | {
|
154
|
+
dialect: Verify<Dialect, "mysql">;
|
89
155
|
dbCredentials: {
|
90
156
|
host: string;
|
91
157
|
port?: number;
|
92
158
|
user?: string;
|
93
159
|
password?: string;
|
94
160
|
database: string;
|
161
|
+
ssl?: string | SslOptions;
|
95
162
|
} | {
|
96
|
-
|
163
|
+
url: string;
|
97
164
|
};
|
98
165
|
} | {
|
99
|
-
|
166
|
+
dialect: Verify<Dialect, "sqlite">;
|
167
|
+
driver: Verify<Driver, "d1">;
|
100
168
|
dbCredentials: {
|
101
169
|
wranglerConfigPath: string;
|
102
170
|
dbName: string;
|
103
171
|
};
|
104
172
|
} | {
|
105
|
-
|
173
|
+
dialect: Verify<Dialect, "sqlite">;
|
174
|
+
driver: Verify<Driver, "expo">;
|
106
175
|
} | {});
|
107
|
-
|
176
|
+
/**
|
177
|
+
* **You are currently using version 0.21.0+ of drizzle-kit. If you have just upgraded to this version, please make sure to read the changelog to understand what changes have been made and what
|
178
|
+
* adjustments may be necessary for you. See https://orm.drizzle.team/kit-docs/upgrade-21#how-to-migrate-to-0210**
|
179
|
+
*
|
180
|
+
*
|
181
|
+
* **Config** usage:
|
182
|
+
*
|
183
|
+
* `dialect` - mandatory and is responsible for explicitly providing a databse dialect you are using for all the commands
|
184
|
+
* *Possible values*: `postgresql`, `mysql`, `sqlite`
|
185
|
+
*
|
186
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#dialect
|
187
|
+
*
|
188
|
+
* ---
|
189
|
+
* `schema` - param lets you define where your schema file/files live.
|
190
|
+
* You can have as many separate schema files as you want and define paths to them using glob or array of globs syntax.
|
191
|
+
*
|
192
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#schema
|
193
|
+
*
|
194
|
+
* ---
|
195
|
+
* `out` - allows you to define the folder for your migrations and a folder, where drizzle will introspect the schema and relations
|
196
|
+
*
|
197
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#out
|
198
|
+
*
|
199
|
+
* ---
|
200
|
+
* `driver` - optional param that is responsible for explicitly providing a driver to use when accessing a database
|
201
|
+
* *Possible values*: `aws-data-api`, `d1-http`, `expo`, `turso`
|
202
|
+
* If you don't use AWS Data API, D1, Turso or Expo - ypu don't need this driver. You can check a driver strategy choice here: https://orm.drizzle.team/kit-docs/upgrade-21
|
203
|
+
*
|
204
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#driver
|
205
|
+
*
|
206
|
+
* ---
|
207
|
+
*
|
208
|
+
* `dbCredentials` - an object to define your connection to the database. For more info please check the docs
|
209
|
+
*
|
210
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#dbcredentials
|
211
|
+
*
|
212
|
+
* ---
|
213
|
+
*
|
214
|
+
* `migrations` - param let’s use specify custom table and schema(PostgreSQL only) for migrations.
|
215
|
+
* By default, all information about executed migrations will be stored in the database inside
|
216
|
+
* the `__drizzle_migrations` table, and for PostgreSQL, inside the drizzle schema.
|
217
|
+
* However, you can configure where to store those records.
|
218
|
+
*
|
219
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#migrations
|
220
|
+
*
|
221
|
+
* ---
|
222
|
+
*
|
223
|
+
* `breakpoints` - param lets you enable/disable SQL statement breakpoints in generated migrations.
|
224
|
+
* It’s optional and true by default, it’s necessary to properly apply migrations on databases,
|
225
|
+
* that do not support multiple DDL alternation statements in one transaction(MySQL, SQLite) and
|
226
|
+
* Drizzle ORM has to apply them sequentially one by one.
|
227
|
+
*
|
228
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#breakpoints
|
229
|
+
*
|
230
|
+
* ---
|
231
|
+
*
|
232
|
+
* `tablesFilters` - param lets you filter tables with glob syntax for db push command.
|
233
|
+
* It’s useful when you have only one database avaialable for several separate projects with separate sql schemas.
|
234
|
+
*
|
235
|
+
* How to define multi-project tables with Drizzle ORM — see https://orm.drizzle.team/docs/goodies#multi-project-schema
|
236
|
+
*
|
237
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#tablesfilters
|
238
|
+
*
|
239
|
+
* ---
|
240
|
+
*
|
241
|
+
* `schemaFilter` - parameter allows you to define which schema in PostgreSQL should be used for either introspect or push commands.
|
242
|
+
* This parameter accepts a single schema as a string or an array of schemas as strings.
|
243
|
+
* No glob pattern is supported here. By default, drizzle will use the public schema for both commands,
|
244
|
+
* but you can add any schema you need.
|
245
|
+
*
|
246
|
+
* For example, having schemaFilter: ["my_schema"] will only look for tables in both the database and
|
247
|
+
* drizzle schema that are a part of the my_schema schema.
|
248
|
+
*
|
249
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#schemafilter
|
250
|
+
*
|
251
|
+
* ---
|
252
|
+
*
|
253
|
+
* `verbose` - command is used for drizzle-kit push commands and prints all statements that will be executed.
|
254
|
+
*
|
255
|
+
* > Note: This command will only print the statements that should be executed.
|
256
|
+
* To approve them before applying, please refer to the `strict` command.
|
257
|
+
*
|
258
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#verbose
|
259
|
+
*
|
260
|
+
* ---
|
261
|
+
*
|
262
|
+
* `strict` - command is used for drizzle-kit push commands and will always ask for your confirmation,
|
263
|
+
* either to execute all statements needed to sync your schema with the database or not.
|
264
|
+
*
|
265
|
+
*
|
266
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#strict
|
267
|
+
*
|
268
|
+
*/
|
269
|
+
declare function defineConfig(config: Config): Config;
|
270
|
+
|
271
|
+
export { type Config, defineConfig };
|
package/index.d.ts
CHANGED
@@ -1,79 +1,137 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
1
|
+
import { SslOptions } from 'mysql2';
|
2
|
+
import * as zod from 'zod';
|
3
|
+
import { TypeOf } from 'zod';
|
4
|
+
|
5
|
+
declare const driver: zod.ZodUnion<[zod.ZodUnion<[zod.ZodLiteral<"better-sqlite">, zod.ZodLiteral<"turso">, zod.ZodLiteral<"libsql">, zod.ZodLiteral<"d1">, zod.ZodLiteral<"expo">]>, zod.ZodLiteral<"aws-data-api">, zod.ZodLiteral<"mysql2">]>;
|
6
|
+
type Driver = TypeOf<typeof driver>;
|
7
|
+
|
8
|
+
declare const dialect: zod.ZodEnum<["postgresql", "mysql", "sqlite"]>;
|
9
|
+
type Dialect = TypeOf<typeof dialect>;
|
10
|
+
|
11
|
+
type Verify<T, U extends T> = U;
|
12
|
+
/**
|
13
|
+
* **You are currently using version 0.21.0+ of drizzle-kit. If you have just upgraded to this version, please make sure to read the changelog to understand what changes have been made and what
|
14
|
+
* adjustments may be necessary for you. See https://orm.drizzle.team/kit-docs/upgrade-21#how-to-migrate-to-0210**
|
15
|
+
*
|
16
|
+
*
|
17
|
+
* **Config** usage:
|
18
|
+
*
|
19
|
+
* `dialect` - mandatory and is responsible for explicitly providing a databse dialect you are using for all the commands
|
20
|
+
* *Possible values*: `postgresql`, `mysql`, `sqlite`
|
21
|
+
*
|
22
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#dialect
|
23
|
+
*
|
24
|
+
* ---
|
25
|
+
* `schema` - param lets you define where your schema file/files live.
|
26
|
+
* You can have as many separate schema files as you want and define paths to them using glob or array of globs syntax.
|
27
|
+
*
|
28
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#schema
|
29
|
+
*
|
30
|
+
* ---
|
31
|
+
* `out` - allows you to define the folder for your migrations and a folder, where drizzle will introspect the schema and relations
|
32
|
+
*
|
33
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#out
|
34
|
+
*
|
35
|
+
* ---
|
36
|
+
* `driver` - optional param that is responsible for explicitly providing a driver to use when accessing a database
|
37
|
+
* *Possible values*: `aws-data-api`, `d1-http`, `expo`, `turso`
|
38
|
+
* If you don't use AWS Data API, D1, Turso or Expo - ypu don't need this driver. You can check a driver strategy choice here: https://orm.drizzle.team/kit-docs/upgrade-21
|
39
|
+
*
|
40
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#driver
|
41
|
+
*
|
42
|
+
* ---
|
43
|
+
*
|
44
|
+
* `dbCredentials` - an object to define your connection to the database. For more info please check the docs
|
45
|
+
*
|
46
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#dbcredentials
|
47
|
+
*
|
48
|
+
* ---
|
49
|
+
*
|
50
|
+
* `migrations` - param let’s use specify custom table and schema(PostgreSQL only) for migrations.
|
51
|
+
* By default, all information about executed migrations will be stored in the database inside
|
52
|
+
* the `__drizzle_migrations` table, and for PostgreSQL, inside the drizzle schema.
|
53
|
+
* However, you can configure where to store those records.
|
54
|
+
*
|
55
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#migrations
|
56
|
+
*
|
57
|
+
* ---
|
58
|
+
*
|
59
|
+
* `breakpoints` - param lets you enable/disable SQL statement breakpoints in generated migrations.
|
60
|
+
* It’s optional and true by default, it’s necessary to properly apply migrations on databases,
|
61
|
+
* that do not support multiple DDL alternation statements in one transaction(MySQL, SQLite) and
|
62
|
+
* Drizzle ORM has to apply them sequentially one by one.
|
63
|
+
*
|
64
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#breakpoints
|
65
|
+
*
|
66
|
+
* ---
|
67
|
+
*
|
68
|
+
* `tablesFilters` - param lets you filter tables with glob syntax for db push command.
|
69
|
+
* It’s useful when you have only one database avaialable for several separate projects with separate sql schemas.
|
70
|
+
*
|
71
|
+
* How to define multi-project tables with Drizzle ORM — see https://orm.drizzle.team/docs/goodies#multi-project-schema
|
72
|
+
*
|
73
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#tablesfilters
|
74
|
+
*
|
75
|
+
* ---
|
76
|
+
*
|
77
|
+
* `schemaFilter` - parameter allows you to define which schema in PostgreSQL should be used for either introspect or push commands.
|
78
|
+
* This parameter accepts a single schema as a string or an array of schemas as strings.
|
79
|
+
* No glob pattern is supported here. By default, drizzle will use the public schema for both commands,
|
80
|
+
* but you can add any schema you need.
|
81
|
+
*
|
82
|
+
* For example, having schemaFilter: ["my_schema"] will only look for tables in both the database and
|
83
|
+
* drizzle schema that are a part of the my_schema schema.
|
84
|
+
*
|
85
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#schemafilter
|
86
|
+
*
|
87
|
+
* ---
|
88
|
+
*
|
89
|
+
* `verbose` - command is used for drizzle-kit push commands and prints all statements that will be executed.
|
90
|
+
*
|
91
|
+
* > Note: This command will only print the statements that should be executed.
|
92
|
+
* To approve them before applying, please refer to the `strict` command.
|
93
|
+
*
|
94
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#verbose
|
95
|
+
*
|
96
|
+
* ---
|
97
|
+
*
|
98
|
+
* `strict` - command is used for drizzle-kit push commands and will always ask for your confirmation,
|
99
|
+
* either to execute all statements needed to sync your schema with the database or not.
|
100
|
+
*
|
101
|
+
*
|
102
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#strict
|
103
|
+
*
|
104
|
+
*/
|
105
|
+
type Config = {
|
106
|
+
dialect: Dialect;
|
107
|
+
out?: string;
|
108
|
+
breakpoints?: boolean;
|
109
|
+
tablesFilter?: string | string[];
|
110
|
+
schemaFilter?: string | string[];
|
52
111
|
schema?: string | string[];
|
53
|
-
verbose?: boolean
|
54
|
-
strict?: boolean
|
55
|
-
|
112
|
+
verbose?: boolean;
|
113
|
+
strict?: boolean;
|
114
|
+
migrations?: {
|
115
|
+
table?: string;
|
116
|
+
schema?: string;
|
117
|
+
};
|
56
118
|
introspect?: {
|
57
119
|
casing: "camel" | "preserve";
|
58
120
|
};
|
59
121
|
} & ({
|
60
|
-
|
122
|
+
dialect: Verify<Dialect, "sqlite">;
|
123
|
+
driver: Verify<Driver, "turso">;
|
61
124
|
dbCredentials: {
|
62
125
|
url: string;
|
63
126
|
authToken?: string;
|
64
127
|
};
|
65
128
|
} | {
|
66
|
-
|
67
|
-
dbCredentials: {
|
68
|
-
url: string;
|
69
|
-
};
|
70
|
-
} | {
|
71
|
-
driver: "libsql";
|
129
|
+
dialect: "sqlite";
|
72
130
|
dbCredentials: {
|
73
131
|
url: string;
|
74
132
|
};
|
75
133
|
} | {
|
76
|
-
|
134
|
+
dialect: Verify<Dialect, "postgresql">;
|
77
135
|
dbCredentials: {
|
78
136
|
host: string;
|
79
137
|
port?: number;
|
@@ -82,26 +140,132 @@ export type Config = {
|
|
82
140
|
database: string;
|
83
141
|
ssl?: boolean;
|
84
142
|
} | {
|
85
|
-
|
143
|
+
url: string;
|
86
144
|
};
|
87
145
|
} | {
|
88
|
-
|
146
|
+
dialect: Verify<Dialect, "postgresql">;
|
147
|
+
driver: Verify<Driver, "aws-data-api">;
|
148
|
+
dbCredentials: {
|
149
|
+
database: string;
|
150
|
+
secretArn: string;
|
151
|
+
resourceArn: string;
|
152
|
+
};
|
153
|
+
} | {
|
154
|
+
dialect: Verify<Dialect, "mysql">;
|
89
155
|
dbCredentials: {
|
90
156
|
host: string;
|
91
157
|
port?: number;
|
92
158
|
user?: string;
|
93
159
|
password?: string;
|
94
160
|
database: string;
|
161
|
+
ssl?: string | SslOptions;
|
95
162
|
} | {
|
96
|
-
|
163
|
+
url: string;
|
97
164
|
};
|
98
165
|
} | {
|
99
|
-
|
166
|
+
dialect: Verify<Dialect, "sqlite">;
|
167
|
+
driver: Verify<Driver, "d1">;
|
100
168
|
dbCredentials: {
|
101
169
|
wranglerConfigPath: string;
|
102
170
|
dbName: string;
|
103
171
|
};
|
104
172
|
} | {
|
105
|
-
|
173
|
+
dialect: Verify<Dialect, "sqlite">;
|
174
|
+
driver: Verify<Driver, "expo">;
|
106
175
|
} | {});
|
107
|
-
|
176
|
+
/**
|
177
|
+
* **You are currently using version 0.21.0+ of drizzle-kit. If you have just upgraded to this version, please make sure to read the changelog to understand what changes have been made and what
|
178
|
+
* adjustments may be necessary for you. See https://orm.drizzle.team/kit-docs/upgrade-21#how-to-migrate-to-0210**
|
179
|
+
*
|
180
|
+
*
|
181
|
+
* **Config** usage:
|
182
|
+
*
|
183
|
+
* `dialect` - mandatory and is responsible for explicitly providing a databse dialect you are using for all the commands
|
184
|
+
* *Possible values*: `postgresql`, `mysql`, `sqlite`
|
185
|
+
*
|
186
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#dialect
|
187
|
+
*
|
188
|
+
* ---
|
189
|
+
* `schema` - param lets you define where your schema file/files live.
|
190
|
+
* You can have as many separate schema files as you want and define paths to them using glob or array of globs syntax.
|
191
|
+
*
|
192
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#schema
|
193
|
+
*
|
194
|
+
* ---
|
195
|
+
* `out` - allows you to define the folder for your migrations and a folder, where drizzle will introspect the schema and relations
|
196
|
+
*
|
197
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#out
|
198
|
+
*
|
199
|
+
* ---
|
200
|
+
* `driver` - optional param that is responsible for explicitly providing a driver to use when accessing a database
|
201
|
+
* *Possible values*: `aws-data-api`, `d1-http`, `expo`, `turso`
|
202
|
+
* If you don't use AWS Data API, D1, Turso or Expo - ypu don't need this driver. You can check a driver strategy choice here: https://orm.drizzle.team/kit-docs/upgrade-21
|
203
|
+
*
|
204
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#driver
|
205
|
+
*
|
206
|
+
* ---
|
207
|
+
*
|
208
|
+
* `dbCredentials` - an object to define your connection to the database. For more info please check the docs
|
209
|
+
*
|
210
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#dbcredentials
|
211
|
+
*
|
212
|
+
* ---
|
213
|
+
*
|
214
|
+
* `migrations` - param let’s use specify custom table and schema(PostgreSQL only) for migrations.
|
215
|
+
* By default, all information about executed migrations will be stored in the database inside
|
216
|
+
* the `__drizzle_migrations` table, and for PostgreSQL, inside the drizzle schema.
|
217
|
+
* However, you can configure where to store those records.
|
218
|
+
*
|
219
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#migrations
|
220
|
+
*
|
221
|
+
* ---
|
222
|
+
*
|
223
|
+
* `breakpoints` - param lets you enable/disable SQL statement breakpoints in generated migrations.
|
224
|
+
* It’s optional and true by default, it’s necessary to properly apply migrations on databases,
|
225
|
+
* that do not support multiple DDL alternation statements in one transaction(MySQL, SQLite) and
|
226
|
+
* Drizzle ORM has to apply them sequentially one by one.
|
227
|
+
*
|
228
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#breakpoints
|
229
|
+
*
|
230
|
+
* ---
|
231
|
+
*
|
232
|
+
* `tablesFilters` - param lets you filter tables with glob syntax for db push command.
|
233
|
+
* It’s useful when you have only one database avaialable for several separate projects with separate sql schemas.
|
234
|
+
*
|
235
|
+
* How to define multi-project tables with Drizzle ORM — see https://orm.drizzle.team/docs/goodies#multi-project-schema
|
236
|
+
*
|
237
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#tablesfilters
|
238
|
+
*
|
239
|
+
* ---
|
240
|
+
*
|
241
|
+
* `schemaFilter` - parameter allows you to define which schema in PostgreSQL should be used for either introspect or push commands.
|
242
|
+
* This parameter accepts a single schema as a string or an array of schemas as strings.
|
243
|
+
* No glob pattern is supported here. By default, drizzle will use the public schema for both commands,
|
244
|
+
* but you can add any schema you need.
|
245
|
+
*
|
246
|
+
* For example, having schemaFilter: ["my_schema"] will only look for tables in both the database and
|
247
|
+
* drizzle schema that are a part of the my_schema schema.
|
248
|
+
*
|
249
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#schemafilter
|
250
|
+
*
|
251
|
+
* ---
|
252
|
+
*
|
253
|
+
* `verbose` - command is used for drizzle-kit push commands and prints all statements that will be executed.
|
254
|
+
*
|
255
|
+
* > Note: This command will only print the statements that should be executed.
|
256
|
+
* To approve them before applying, please refer to the `strict` command.
|
257
|
+
*
|
258
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#verbose
|
259
|
+
*
|
260
|
+
* ---
|
261
|
+
*
|
262
|
+
* `strict` - command is used for drizzle-kit push commands and will always ask for your confirmation,
|
263
|
+
* either to execute all statements needed to sync your schema with the database or not.
|
264
|
+
*
|
265
|
+
*
|
266
|
+
* See https://orm.drizzle.team/kit-docs/config-reference#strict
|
267
|
+
*
|
268
|
+
*/
|
269
|
+
declare function defineConfig(config: Config): Config;
|
270
|
+
|
271
|
+
export { type Config, defineConfig };
|