drizzle-kit 0.20.18 → 0.21.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. package/bin.cjs +104694 -56732
  2. package/index.d.mts +232 -68
  3. package/index.d.ts +232 -68
  4. package/index.js +1 -0
  5. package/package.json +44 -72
  6. package/payload.d.mts +1052 -18
  7. package/payload.d.ts +1052 -18
  8. package/payload.js +22129 -34534
  9. package/payload.mjs +22174 -34562
  10. package/utils-studio.js +4580 -805
  11. package/utils-studio.mjs +4556 -784
  12. package/utils.js +4410 -6940
  13. package/utils.mjs +4852 -7382
  14. package/@types/utils.d.ts +0 -12
  15. package/cli/commands/migrate.d.ts +0 -270
  16. package/cli/commands/mysqlIntrospect.d.ts +0 -119
  17. package/cli/commands/mysqlPushUtils.d.ts +0 -18
  18. package/cli/commands/mysqlUp.d.ts +0 -4
  19. package/cli/commands/pgConnect.d.ts +0 -5
  20. package/cli/commands/pgIntrospect.d.ts +0 -123
  21. package/cli/commands/pgPushUtils.d.ts +0 -14
  22. package/cli/commands/pgUp.d.ts +0 -4
  23. package/cli/commands/sqliteIntrospect.d.ts +0 -107
  24. package/cli/commands/sqlitePushUtils.d.ts +0 -21
  25. package/cli/commands/sqliteUtils.d.ts +0 -162
  26. package/cli/commands/upFolders.d.ts +0 -27
  27. package/cli/commands/utils.d.ts +0 -274
  28. package/cli/selector-ui.d.ts +0 -13
  29. package/cli/validations/common.d.ts +0 -13
  30. package/cli/validations/mysql.d.ts +0 -365
  31. package/cli/validations/outputs.d.ts +0 -40
  32. package/cli/validations/pg.d.ts +0 -438
  33. package/cli/views.d.ts +0 -61
  34. package/drivers/index.d.ts +0 -39
  35. package/global.d.ts +0 -4
  36. package/introspect-mysql.d.ts +0 -9
  37. package/introspect-pg.d.ts +0 -12
  38. package/introspect-sqlite.d.ts +0 -10
  39. package/jsonDiffer.d.ts +0 -76
  40. package/jsonStatements.d.ts +0 -349
  41. package/migrationPreparator.d.ts +0 -35
  42. package/schemaValidator.d.ts +0 -1313
  43. package/serializer/index.d.ts +0 -9
  44. package/serializer/mysqlImports.d.ts +0 -11
  45. package/serializer/mysqlSchema.d.ts +0 -3833
  46. package/serializer/mysqlSerializer.d.ts +0 -7
  47. package/serializer/pgImports.d.ts +0 -11
  48. package/serializer/pgSchema.d.ts +0 -4333
  49. package/serializer/pgSerializer.d.ts +0 -7
  50. package/serializer/schemaToDrizzle.d.ts +0 -7
  51. package/serializer/sqliteImports.d.ts +0 -9
  52. package/serializer/sqliteSchema.d.ts +0 -3227
  53. package/serializer/sqliteSerializer.d.ts +0 -6
  54. package/snapshotsDiffer.d.ts +0 -2660
  55. package/sqlgenerator.d.ts +0 -33
  56. package/utils/words.d.ts +0 -7
  57. package/utils-studio.d.mts +0 -5
  58. package/utils-studio.d.ts +0 -5
  59. package/utils.d.ts +0 -199
package/index.d.mts CHANGED
@@ -1,79 +1,137 @@
1
- export type DbConnection = {
2
- driver: "turso";
3
- dbCredentials: {
4
- url: string;
5
- authToken?: string;
6
- };
7
- } | {
8
- driver: "better-sqlite";
9
- dbCredentials: {
10
- url: string;
11
- };
12
- } | {
13
- driver: "libsql";
14
- dbCredentials: {
15
- url: string;
16
- };
17
- } | {
18
- driver: "d1";
19
- dbCredentials: {
20
- wranglerConfigPath: string;
21
- dbName: string;
22
- };
23
- } | {
24
- driver: "pg";
25
- dbCredentials: {
26
- host: string;
27
- port?: number;
28
- user?: string;
29
- password?: string;
30
- database: string;
31
- ssl?: boolean;
32
- } | {
33
- connectionString: string;
34
- };
35
- } | {
36
- driver: "mysql2";
37
- dbCredentials: {
38
- host: string;
39
- port?: number;
40
- user?: string;
41
- password?: string;
42
- database: string;
43
- } | {
44
- uri: string;
45
- };
46
- };
47
- export type Config = {
48
- out?: string | undefined;
49
- breakpoints?: boolean | undefined;
50
- tablesFilter?: string | string[] | undefined;
51
- schemaFilter?: string | string[] | undefined;
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 | undefined;
54
- strict?: boolean | undefined;
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
- driver: "turso";
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
- driver: "better-sqlite";
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
- driver: "pg";
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
- connectionString: string;
143
+ url: string;
86
144
  };
87
145
  } | {
88
- driver: "mysql2";
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
- uri: string;
163
+ url: string;
97
164
  };
98
165
  } | {
99
- driver: "d1";
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
- driver: "expo";
173
+ dialect: Verify<Dialect, "sqlite">;
174
+ driver: Verify<Driver, "expo">;
106
175
  } | {});
107
- export declare function defineConfig(config: Config): Config;
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
- export type DbConnection = {
2
- driver: "turso";
3
- dbCredentials: {
4
- url: string;
5
- authToken?: string;
6
- };
7
- } | {
8
- driver: "better-sqlite";
9
- dbCredentials: {
10
- url: string;
11
- };
12
- } | {
13
- driver: "libsql";
14
- dbCredentials: {
15
- url: string;
16
- };
17
- } | {
18
- driver: "d1";
19
- dbCredentials: {
20
- wranglerConfigPath: string;
21
- dbName: string;
22
- };
23
- } | {
24
- driver: "pg";
25
- dbCredentials: {
26
- host: string;
27
- port?: number;
28
- user?: string;
29
- password?: string;
30
- database: string;
31
- ssl?: boolean;
32
- } | {
33
- connectionString: string;
34
- };
35
- } | {
36
- driver: "mysql2";
37
- dbCredentials: {
38
- host: string;
39
- port?: number;
40
- user?: string;
41
- password?: string;
42
- database: string;
43
- } | {
44
- uri: string;
45
- };
46
- };
47
- export type Config = {
48
- out?: string | undefined;
49
- breakpoints?: boolean | undefined;
50
- tablesFilter?: string | string[] | undefined;
51
- schemaFilter?: string | string[] | undefined;
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 | undefined;
54
- strict?: boolean | undefined;
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
- driver: "turso";
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
- driver: "better-sqlite";
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
- driver: "pg";
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
- connectionString: string;
143
+ url: string;
86
144
  };
87
145
  } | {
88
- driver: "mysql2";
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
- uri: string;
163
+ url: string;
97
164
  };
98
165
  } | {
99
- driver: "d1";
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
- driver: "expo";
173
+ dialect: Verify<Dialect, "sqlite">;
174
+ driver: Verify<Driver, "expo">;
106
175
  } | {});
107
- export declare function defineConfig(config: Config): Config;
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 };