@anthonyalayo/drizzle-kit 1.0.1 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/api.d.mts +2891 -0
  2. package/api.d.ts +2891 -0
  3. package/api.js +47534 -0
  4. package/api.mjs +47521 -0
  5. package/bin.cjs +80043 -0
  6. package/{src/index.ts → index-Z-1TKnbX.d.mts} +123 -141
  7. package/index-Z-1TKnbX.d.ts +308 -0
  8. package/index.d.mts +2 -0
  9. package/index.d.ts +2 -0
  10. package/index.js +32 -0
  11. package/index.mjs +7 -0
  12. package/package.json +2 -2
  13. package/utils.js +6056 -0
  14. package/utils.mjs +6032 -0
  15. package/.gitignore +0 -25
  16. package/build.dev.ts +0 -51
  17. package/build.ts +0 -112
  18. package/imports-checker/analyze.ts +0 -78
  19. package/imports-checker/checker.ts +0 -296
  20. package/imports-checker/grammar/grammar.ohm +0 -121
  21. package/imports-checker/grammar/grammar.ohm-bundle.d.ts +0 -164
  22. package/imports-checker/grammar/grammar.ohm-bundle.js +0 -753
  23. package/imports-checker/index.ts +0 -48
  24. package/patches/difflib@0.2.4.patch +0 -31
  25. package/src/@types/utils.ts +0 -58
  26. package/src/api.ts +0 -504
  27. package/src/cli/commands/_es5.ts +0 -2
  28. package/src/cli/commands/check.ts +0 -52
  29. package/src/cli/commands/drop.ts +0 -60
  30. package/src/cli/commands/introspect.ts +0 -772
  31. package/src/cli/commands/libSqlPushUtils.ts +0 -355
  32. package/src/cli/commands/migrate.ts +0 -1526
  33. package/src/cli/commands/mysqlIntrospect.ts +0 -53
  34. package/src/cli/commands/mysqlPushUtils.ts +0 -352
  35. package/src/cli/commands/mysqlUp.ts +0 -102
  36. package/src/cli/commands/pgIntrospect.ts +0 -55
  37. package/src/cli/commands/pgPushUtils.ts +0 -269
  38. package/src/cli/commands/pgUp.ts +0 -217
  39. package/src/cli/commands/push.ts +0 -637
  40. package/src/cli/commands/singlestoreIntrospect.ts +0 -53
  41. package/src/cli/commands/singlestorePushUtils.ts +0 -456
  42. package/src/cli/commands/singlestoreUp.ts +0 -1
  43. package/src/cli/commands/sqliteIntrospect.ts +0 -96
  44. package/src/cli/commands/sqlitePushUtils.ts +0 -322
  45. package/src/cli/commands/sqliteUp.ts +0 -52
  46. package/src/cli/commands/utils.ts +0 -858
  47. package/src/cli/connections.ts +0 -914
  48. package/src/cli/index.ts +0 -48
  49. package/src/cli/schema.ts +0 -794
  50. package/src/cli/selector-ui.ts +0 -38
  51. package/src/cli/utils.ts +0 -112
  52. package/src/cli/validations/cli.ts +0 -79
  53. package/src/cli/validations/common.ts +0 -193
  54. package/src/cli/validations/libsql.ts +0 -27
  55. package/src/cli/validations/mysql.ts +0 -61
  56. package/src/cli/validations/outputs.ts +0 -91
  57. package/src/cli/validations/postgres.ts +0 -83
  58. package/src/cli/validations/singlestore.ts +0 -61
  59. package/src/cli/validations/sqlite.ts +0 -104
  60. package/src/cli/validations/studio.ts +0 -24
  61. package/src/cli/views.ts +0 -658
  62. package/src/extensions/getTablesFilterByExtensions.ts +0 -16
  63. package/src/extensions/vector.ts +0 -10
  64. package/src/global.ts +0 -61
  65. package/src/introspect-mysql.ts +0 -1030
  66. package/src/introspect-pg.ts +0 -1435
  67. package/src/introspect-singlestore.ts +0 -913
  68. package/src/introspect-sqlite.ts +0 -533
  69. package/src/jsonDiffer.js +0 -882
  70. package/src/jsonStatements.ts +0 -3590
  71. package/src/loader.mjs +0 -57
  72. package/src/migrationPreparator.ts +0 -217
  73. package/src/schemaValidator.ts +0 -23
  74. package/src/serializer/index.ts +0 -142
  75. package/src/serializer/mysqlImports.ts +0 -38
  76. package/src/serializer/mysqlSchema.ts +0 -423
  77. package/src/serializer/mysqlSerializer.ts +0 -999
  78. package/src/serializer/pgImports.ts +0 -106
  79. package/src/serializer/pgSchema.ts +0 -937
  80. package/src/serializer/pgSerializer.ts +0 -2223
  81. package/src/serializer/singlestoreImports.ts +0 -38
  82. package/src/serializer/singlestoreSchema.ts +0 -257
  83. package/src/serializer/singlestoreSerializer.ts +0 -767
  84. package/src/serializer/sqliteImports.ts +0 -41
  85. package/src/serializer/sqliteSchema.ts +0 -352
  86. package/src/serializer/sqliteSerializer.ts +0 -931
  87. package/src/serializer/studio.ts +0 -694
  88. package/src/serializer/utils.ts +0 -45
  89. package/src/simulator.ts +0 -157
  90. package/src/snapshotsDiffer.ts +0 -4398
  91. package/src/sqlgenerator.ts +0 -4212
  92. package/src/statementCombiner.ts +0 -597
  93. package/src/utils/certs.ts +0 -44
  94. package/src/utils/words.ts +0 -1333
  95. package/src/utils.ts +0 -370
  96. package/tests/bin.test.ts +0 -58
  97. package/tests/cli/d1http.config.ts +0 -12
  98. package/tests/cli/drizzle.config.ts +0 -9
  99. package/tests/cli/durable-sqlite.config.ts +0 -7
  100. package/tests/cli/expo.config.ts +0 -7
  101. package/tests/cli/postgres.config.ts +0 -13
  102. package/tests/cli/postgres2.config.ts +0 -17
  103. package/tests/cli/schema.ts +0 -1
  104. package/tests/cli/turso.config.ts +0 -10
  105. package/tests/cli-export.test.ts +0 -79
  106. package/tests/cli-generate.test.ts +0 -259
  107. package/tests/cli-migrate.test.ts +0 -103
  108. package/tests/cli-push.test.ts +0 -126
  109. package/tests/common.ts +0 -15
  110. package/tests/indexes/common.ts +0 -21
  111. package/tests/indexes/pg.test.ts +0 -245
  112. package/tests/introspect/libsql.test.ts +0 -35
  113. package/tests/introspect/mysql.test.ts +0 -319
  114. package/tests/introspect/pg.test.ts +0 -894
  115. package/tests/introspect/singlestore.test.ts +0 -275
  116. package/tests/introspect/sqlite.test.ts +0 -122
  117. package/tests/libsql-checks.test.ts +0 -308
  118. package/tests/libsql-statements.test.ts +0 -989
  119. package/tests/libsql-views.test.ts +0 -218
  120. package/tests/migrate/libsq-schema.ts +0 -6
  121. package/tests/migrate/libsql-migrate.test.ts +0 -58
  122. package/tests/migrate/migrations/0000_little_blizzard.sql +0 -4
  123. package/tests/migrate/migrations/0001_nebulous_storm.sql +0 -10
  124. package/tests/migrate/migrations/meta/0000_snapshot.json +0 -40
  125. package/tests/migrate/migrations/meta/0001_snapshot.json +0 -40
  126. package/tests/migrate/migrations/meta/_journal.json +0 -20
  127. package/tests/mysql-checks.test.ts +0 -291
  128. package/tests/mysql-generated.test.ts +0 -1290
  129. package/tests/mysql-schemas.test.ts +0 -156
  130. package/tests/mysql-views.test.ts +0 -553
  131. package/tests/mysql.test.ts +0 -863
  132. package/tests/pg-array.test.ts +0 -368
  133. package/tests/pg-checks.test.ts +0 -329
  134. package/tests/pg-columns.test.ts +0 -484
  135. package/tests/pg-domains.test.ts +0 -306
  136. package/tests/pg-enums.test.ts +0 -751
  137. package/tests/pg-generated.test.ts +0 -529
  138. package/tests/pg-identity.test.ts +0 -447
  139. package/tests/pg-schemas.test.ts +0 -105
  140. package/tests/pg-sequences.test.ts +0 -298
  141. package/tests/pg-tables.test.ts +0 -1021
  142. package/tests/pg-views.test.ts +0 -1929
  143. package/tests/push/common.ts +0 -58
  144. package/tests/push/libsql.test.ts +0 -1400
  145. package/tests/push/mysql-push.test.ts +0 -345
  146. package/tests/push/mysql.test.ts +0 -788
  147. package/tests/push/pg.test.ts +0 -4341
  148. package/tests/push/singlestore-push.test.ts +0 -894
  149. package/tests/push/singlestore.test.ts +0 -444
  150. package/tests/push/sqlite.test.ts +0 -1613
  151. package/tests/rls/pg-policy.test.ts +0 -1656
  152. package/tests/rls/pg-role.test.ts +0 -234
  153. package/tests/schemaDiffer.ts +0 -2852
  154. package/tests/singlestore-generated.test.ts +0 -1290
  155. package/tests/singlestore-schemas.test.ts +0 -155
  156. package/tests/singlestore.test.ts +0 -978
  157. package/tests/sqlite-checks.test.ts +0 -308
  158. package/tests/sqlite-columns.test.ts +0 -1049
  159. package/tests/sqlite-generated.test.ts +0 -1726
  160. package/tests/sqlite-tables.test.ts +0 -637
  161. package/tests/sqlite-views.test.ts +0 -218
  162. package/tests/statements-combiner/libsql-statements-combiner.test.ts +0 -1812
  163. package/tests/statements-combiner/singlestore-statements-combiner.test.ts +0 -882
  164. package/tests/statements-combiner/sqlite-statements-combiner.test.ts +0 -1211
  165. package/tests/test/sqlite.test.ts +0 -39
  166. package/tests/testsinglestore.ts +0 -29
  167. package/tests/validations.test.ts +0 -869
  168. package/tests/wrap-param.test.ts +0 -16
  169. package/tsconfig.build.json +0 -4
  170. package/tsconfig.cli-types.json +0 -9
  171. package/tsconfig.json +0 -28
  172. package/vitest.config.ts +0 -34
@@ -1,21 +1,26 @@
1
1
  import { ConnectionOptions } from 'tls';
2
- import type { Driver, Prefix } from './cli/validations/common';
3
- import type { Dialect } from './schemaValidator';
4
2
 
5
- // import {SslOptions} from 'mysql2'
3
+ declare const prefixes: readonly ["index", "timestamp", "supabase", "unix", "none"];
4
+ type Prefix = (typeof prefixes)[number];
5
+ declare const casingTypes: readonly ["snake_case", "camelCase"];
6
+ type CasingType = (typeof casingTypes)[number];
7
+ declare const drivers: readonly ["d1-http", "expo", "aws-data-api", "pglite", "durable-sqlite"];
8
+ type Driver = (typeof drivers)[number];
9
+
10
+ declare const dialects: readonly ["postgresql", "mysql", "sqlite", "turso", "singlestore"];
11
+ type Dialect = (typeof dialects)[number];
12
+
6
13
  type SslOptions = {
7
- pfx?: string;
8
- key?: string;
9
- passphrase?: string;
10
- cert?: string;
11
- ca?: string | string[];
12
- crl?: string | string[];
13
- ciphers?: string;
14
- rejectUnauthorized?: boolean;
14
+ pfx?: string;
15
+ key?: string;
16
+ passphrase?: string;
17
+ cert?: string;
18
+ ca?: string | string[];
19
+ crl?: string | string[];
20
+ ciphers?: string;
21
+ rejectUnauthorized?: boolean;
15
22
  };
16
-
17
23
  type Verify<T, U extends T> = U;
18
-
19
24
  /**
20
25
  * **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
21
26
  * adjustments may be necessary for you. See https://orm.drizzle.team/kit-docs/upgrade-21#how-to-migrate-to-0210**
@@ -106,131 +111,108 @@ type Verify<T, U extends T> = U;
106
111
  *
107
112
  * See https://orm.drizzle.team/kit-docs/config-reference#strict
108
113
  */
109
- export type Config =
110
- & {
111
- dialect: Dialect;
112
- out?: string;
113
- breakpoints?: boolean;
114
- tablesFilter?: string | string[];
115
- extensionsFilters?: 'postgis'[];
116
- schemaFilter?: string | string[];
117
- schema?: string | string[];
118
- verbose?: boolean;
119
- strict?: boolean;
120
- casing?: 'camelCase' | 'snake_case';
121
- migrations?: {
122
- table?: string;
123
- schema?: string;
124
- prefix?: Prefix;
125
- };
126
- introspect?: {
127
- casing: 'camel' | 'preserve';
128
- };
129
- entities?: {
130
- roles?: boolean | { provider?: 'supabase' | 'neon' | string & {}; exclude?: string[]; include?: string[] };
131
- };
132
- }
133
- & (
134
- | {
135
- dialect: Verify<Dialect, 'turso'>;
136
- dbCredentials: {
137
- url: string;
138
- authToken?: string;
139
- };
140
- }
141
- | {
142
- dialect: Verify<Dialect, 'sqlite'>;
143
- dbCredentials: {
144
- url: string;
145
- };
146
- }
147
- | {
148
- dialect: Verify<Dialect, 'postgresql'>;
149
- dbCredentials:
150
- | ({
151
- host: string;
152
- port?: number;
153
- user?: string;
154
- password?: string;
155
- database: string;
156
- ssl?:
157
- | boolean
158
- | 'require'
159
- | 'allow'
160
- | 'prefer'
161
- | 'verify-full'
162
- | ConnectionOptions;
163
- } & {})
164
- | {
165
- url: string;
166
- };
167
- }
168
- | {
169
- dialect: Verify<Dialect, 'postgresql'>;
170
- driver: Verify<Driver, 'aws-data-api'>;
171
- dbCredentials: {
172
- database: string;
173
- secretArn: string;
174
- resourceArn: string;
175
- };
176
- }
177
- | {
178
- dialect: Verify<Dialect, 'postgresql'>;
179
- driver: Verify<Driver, 'pglite'>;
180
- dbCredentials: {
181
- url: string;
182
- };
183
- }
184
- | {
185
- dialect: Verify<Dialect, 'mysql'>;
186
- dbCredentials:
187
- | {
188
- host: string;
189
- port?: number;
190
- user?: string;
191
- password?: string;
192
- database: string;
193
- ssl?: string | SslOptions;
194
- }
195
- | {
196
- url: string;
197
- };
198
- }
199
- | {
200
- dialect: Verify<Dialect, 'sqlite'>;
201
- driver: Verify<Driver, 'd1-http'>;
202
- dbCredentials: {
203
- accountId: string;
204
- databaseId: string;
205
- token: string;
206
- };
207
- }
208
- | {
209
- dialect: Verify<Dialect, 'sqlite'>;
210
- driver: Verify<Driver, 'expo'>;
211
- }
212
- | {
213
- dialect: Verify<Dialect, 'sqlite'>;
214
- driver: Verify<Driver, 'durable-sqlite'>;
215
- }
216
- | {}
217
- | {
218
- dialect: Verify<Dialect, 'singlestore'>;
219
- dbCredentials:
220
- | {
221
- host: string;
222
- port?: number;
223
- user?: string;
224
- password?: string;
225
- database: string;
226
- ssl?: string | SslOptions;
227
- }
228
- | {
229
- url: string;
230
- };
231
- }
232
- );
233
-
114
+ type Config = {
115
+ dialect: Dialect;
116
+ out?: string;
117
+ breakpoints?: boolean;
118
+ tablesFilter?: string | string[];
119
+ extensionsFilters?: 'postgis'[];
120
+ schemaFilter?: string | string[];
121
+ schema?: string | string[];
122
+ verbose?: boolean;
123
+ strict?: boolean;
124
+ casing?: 'camelCase' | 'snake_case';
125
+ migrations?: {
126
+ table?: string;
127
+ schema?: string;
128
+ prefix?: Prefix;
129
+ };
130
+ introspect?: {
131
+ casing: 'camel' | 'preserve';
132
+ };
133
+ entities?: {
134
+ roles?: boolean | {
135
+ provider?: 'supabase' | 'neon' | string & {};
136
+ exclude?: string[];
137
+ include?: string[];
138
+ };
139
+ };
140
+ } & ({
141
+ dialect: Verify<Dialect, 'turso'>;
142
+ dbCredentials: {
143
+ url: string;
144
+ authToken?: string;
145
+ };
146
+ } | {
147
+ dialect: Verify<Dialect, 'sqlite'>;
148
+ dbCredentials: {
149
+ url: string;
150
+ };
151
+ } | {
152
+ dialect: Verify<Dialect, 'postgresql'>;
153
+ dbCredentials: ({
154
+ host: string;
155
+ port?: number;
156
+ user?: string;
157
+ password?: string;
158
+ database: string;
159
+ ssl?: boolean | 'require' | 'allow' | 'prefer' | 'verify-full' | ConnectionOptions;
160
+ } & {}) | {
161
+ url: string;
162
+ };
163
+ } | {
164
+ dialect: Verify<Dialect, 'postgresql'>;
165
+ driver: Verify<Driver, 'aws-data-api'>;
166
+ dbCredentials: {
167
+ database: string;
168
+ secretArn: string;
169
+ resourceArn: string;
170
+ };
171
+ } | {
172
+ dialect: Verify<Dialect, 'postgresql'>;
173
+ driver: Verify<Driver, 'pglite'>;
174
+ dbCredentials: {
175
+ url: string;
176
+ };
177
+ } | {
178
+ dialect: Verify<Dialect, 'mysql'>;
179
+ dbCredentials: {
180
+ host: string;
181
+ port?: number;
182
+ user?: string;
183
+ password?: string;
184
+ database: string;
185
+ ssl?: string | SslOptions;
186
+ } | {
187
+ url: string;
188
+ };
189
+ } | {
190
+ dialect: Verify<Dialect, 'sqlite'>;
191
+ driver: Verify<Driver, 'd1-http'>;
192
+ dbCredentials: {
193
+ accountId: string;
194
+ databaseId: string;
195
+ token: string;
196
+ };
197
+ } | {
198
+ dialect: Verify<Dialect, 'sqlite'>;
199
+ driver: Verify<Driver, 'expo'>;
200
+ } | {
201
+ dialect: Verify<Dialect, 'sqlite'>;
202
+ driver: Verify<Driver, 'durable-sqlite'>;
203
+ } | {} | {
204
+ dialect: Verify<Dialect, 'singlestore'>;
205
+ dbCredentials: {
206
+ host: string;
207
+ port?: number;
208
+ user?: string;
209
+ password?: string;
210
+ database: string;
211
+ ssl?: string | SslOptions;
212
+ } | {
213
+ url: string;
214
+ };
215
+ });
234
216
  /**
235
217
  * **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
236
218
  * adjustments may be necessary for you. See https://orm.drizzle.team/kit-docs/upgrade-21#how-to-migrate-to-0210**
@@ -321,6 +303,6 @@ export type Config =
321
303
  *
322
304
  * See https://orm.drizzle.team/kit-docs/config-reference#strict
323
305
  */
324
- export function defineConfig(config: Config) {
325
- return config;
326
- }
306
+ declare function defineConfig(config: Config): Config;
307
+
308
+ export { type CasingType as C, type Config as a, defineConfig as d };
@@ -0,0 +1,308 @@
1
+ import { ConnectionOptions } from 'tls';
2
+
3
+ declare const prefixes: readonly ["index", "timestamp", "supabase", "unix", "none"];
4
+ type Prefix = (typeof prefixes)[number];
5
+ declare const casingTypes: readonly ["snake_case", "camelCase"];
6
+ type CasingType = (typeof casingTypes)[number];
7
+ declare const drivers: readonly ["d1-http", "expo", "aws-data-api", "pglite", "durable-sqlite"];
8
+ type Driver = (typeof drivers)[number];
9
+
10
+ declare const dialects: readonly ["postgresql", "mysql", "sqlite", "turso", "singlestore"];
11
+ type Dialect = (typeof dialects)[number];
12
+
13
+ type SslOptions = {
14
+ pfx?: string;
15
+ key?: string;
16
+ passphrase?: string;
17
+ cert?: string;
18
+ ca?: string | string[];
19
+ crl?: string | string[];
20
+ ciphers?: string;
21
+ rejectUnauthorized?: boolean;
22
+ };
23
+ type Verify<T, U extends T> = U;
24
+ /**
25
+ * **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
26
+ * adjustments may be necessary for you. See https://orm.drizzle.team/kit-docs/upgrade-21#how-to-migrate-to-0210**
27
+ *
28
+ * **Config** usage:
29
+ *
30
+ * `dialect` - mandatory and is responsible for explicitly providing a databse dialect you are using for all the commands
31
+ * *Possible values*: `postgresql`, `mysql`, `sqlite`, `singlestore
32
+ *
33
+ * See https://orm.drizzle.team/kit-docs/config-reference#dialect
34
+ *
35
+ * ---
36
+ * `schema` - param lets you define where your schema file/files live.
37
+ * You can have as many separate schema files as you want and define paths to them using glob or array of globs syntax.
38
+ *
39
+ * See https://orm.drizzle.team/kit-docs/config-reference#schema
40
+ *
41
+ * ---
42
+ * `out` - allows you to define the folder for your migrations and a folder, where drizzle will introspect the schema and relations
43
+ *
44
+ * See https://orm.drizzle.team/kit-docs/config-reference#out
45
+ *
46
+ * ---
47
+ * `driver` - optional param that is responsible for explicitly providing a driver to use when accessing a database
48
+ * *Possible values*: `aws-data-api`, `d1-http`, `expo`, `turso`, `pglite`
49
+ * 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
50
+ *
51
+ * See https://orm.drizzle.team/kit-docs/config-reference#driver
52
+ *
53
+ * ---
54
+ *
55
+ * `dbCredentials` - an object to define your connection to the database. For more info please check the docs
56
+ *
57
+ * See https://orm.drizzle.team/kit-docs/config-reference#dbcredentials
58
+ *
59
+ * ---
60
+ *
61
+ * `migrations` - param let’s use specify custom table and schema(PostgreSQL only) for migrations.
62
+ * By default, all information about executed migrations will be stored in the database inside
63
+ * the `__drizzle_migrations` table, and for PostgreSQL, inside the drizzle schema.
64
+ * However, you can configure where to store those records.
65
+ *
66
+ * See https://orm.drizzle.team/kit-docs/config-reference#migrations
67
+ *
68
+ * ---
69
+ *
70
+ * `breakpoints` - param lets you enable/disable SQL statement breakpoints in generated migrations.
71
+ * It’s optional and true by default, it’s necessary to properly apply migrations on databases,
72
+ * that do not support multiple DDL alternation statements in one transaction(MySQL, SQLite, SingleStore) and
73
+ * Drizzle ORM has to apply them sequentially one by one.
74
+ *
75
+ * See https://orm.drizzle.team/kit-docs/config-reference#breakpoints
76
+ *
77
+ * ---
78
+ *
79
+ * `tablesFilters` - param lets you filter tables with glob syntax for db push command.
80
+ * It’s useful when you have only one database avaialable for several separate projects with separate sql schemas.
81
+ *
82
+ * How to define multi-project tables with Drizzle ORM — see https://orm.drizzle.team/docs/goodies#multi-project-schema
83
+ *
84
+ * See https://orm.drizzle.team/kit-docs/config-reference#tablesfilters
85
+ *
86
+ * ---
87
+ *
88
+ * `schemaFilter` - parameter allows you to define which schema in PostgreSQL should be used for either introspect or push commands.
89
+ * This parameter accepts a single schema as a string or an array of schemas as strings.
90
+ * No glob pattern is supported here. By default, drizzle will use the public schema for both commands,
91
+ * but you can add any schema you need.
92
+ *
93
+ * For example, having schemaFilter: ["my_schema"] will only look for tables in both the database and
94
+ * drizzle schema that are a part of the my_schema schema.
95
+ *
96
+ * See https://orm.drizzle.team/kit-docs/config-reference#schemafilter
97
+ *
98
+ * ---
99
+ *
100
+ * `verbose` - command is used for drizzle-kit push commands and prints all statements that will be executed.
101
+ *
102
+ * > Note: This command will only print the statements that should be executed.
103
+ * To approve them before applying, please refer to the `strict` command.
104
+ *
105
+ * See https://orm.drizzle.team/kit-docs/config-reference#verbose
106
+ *
107
+ * ---
108
+ *
109
+ * `strict` - command is used for drizzle-kit push commands and will always ask for your confirmation,
110
+ * either to execute all statements needed to sync your schema with the database or not.
111
+ *
112
+ * See https://orm.drizzle.team/kit-docs/config-reference#strict
113
+ */
114
+ type Config = {
115
+ dialect: Dialect;
116
+ out?: string;
117
+ breakpoints?: boolean;
118
+ tablesFilter?: string | string[];
119
+ extensionsFilters?: 'postgis'[];
120
+ schemaFilter?: string | string[];
121
+ schema?: string | string[];
122
+ verbose?: boolean;
123
+ strict?: boolean;
124
+ casing?: 'camelCase' | 'snake_case';
125
+ migrations?: {
126
+ table?: string;
127
+ schema?: string;
128
+ prefix?: Prefix;
129
+ };
130
+ introspect?: {
131
+ casing: 'camel' | 'preserve';
132
+ };
133
+ entities?: {
134
+ roles?: boolean | {
135
+ provider?: 'supabase' | 'neon' | string & {};
136
+ exclude?: string[];
137
+ include?: string[];
138
+ };
139
+ };
140
+ } & ({
141
+ dialect: Verify<Dialect, 'turso'>;
142
+ dbCredentials: {
143
+ url: string;
144
+ authToken?: string;
145
+ };
146
+ } | {
147
+ dialect: Verify<Dialect, 'sqlite'>;
148
+ dbCredentials: {
149
+ url: string;
150
+ };
151
+ } | {
152
+ dialect: Verify<Dialect, 'postgresql'>;
153
+ dbCredentials: ({
154
+ host: string;
155
+ port?: number;
156
+ user?: string;
157
+ password?: string;
158
+ database: string;
159
+ ssl?: boolean | 'require' | 'allow' | 'prefer' | 'verify-full' | ConnectionOptions;
160
+ } & {}) | {
161
+ url: string;
162
+ };
163
+ } | {
164
+ dialect: Verify<Dialect, 'postgresql'>;
165
+ driver: Verify<Driver, 'aws-data-api'>;
166
+ dbCredentials: {
167
+ database: string;
168
+ secretArn: string;
169
+ resourceArn: string;
170
+ };
171
+ } | {
172
+ dialect: Verify<Dialect, 'postgresql'>;
173
+ driver: Verify<Driver, 'pglite'>;
174
+ dbCredentials: {
175
+ url: string;
176
+ };
177
+ } | {
178
+ dialect: Verify<Dialect, 'mysql'>;
179
+ dbCredentials: {
180
+ host: string;
181
+ port?: number;
182
+ user?: string;
183
+ password?: string;
184
+ database: string;
185
+ ssl?: string | SslOptions;
186
+ } | {
187
+ url: string;
188
+ };
189
+ } | {
190
+ dialect: Verify<Dialect, 'sqlite'>;
191
+ driver: Verify<Driver, 'd1-http'>;
192
+ dbCredentials: {
193
+ accountId: string;
194
+ databaseId: string;
195
+ token: string;
196
+ };
197
+ } | {
198
+ dialect: Verify<Dialect, 'sqlite'>;
199
+ driver: Verify<Driver, 'expo'>;
200
+ } | {
201
+ dialect: Verify<Dialect, 'sqlite'>;
202
+ driver: Verify<Driver, 'durable-sqlite'>;
203
+ } | {} | {
204
+ dialect: Verify<Dialect, 'singlestore'>;
205
+ dbCredentials: {
206
+ host: string;
207
+ port?: number;
208
+ user?: string;
209
+ password?: string;
210
+ database: string;
211
+ ssl?: string | SslOptions;
212
+ } | {
213
+ url: string;
214
+ };
215
+ });
216
+ /**
217
+ * **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
218
+ * adjustments may be necessary for you. See https://orm.drizzle.team/kit-docs/upgrade-21#how-to-migrate-to-0210**
219
+ *
220
+ * **Config** usage:
221
+ *
222
+ * `dialect` - mandatory and is responsible for explicitly providing a databse dialect you are using for all the commands
223
+ * *Possible values*: `postgresql`, `mysql`, `sqlite`, `singlestore`
224
+ *
225
+ * See https://orm.drizzle.team/kit-docs/config-reference#dialect
226
+ *
227
+ * ---
228
+ * `schema` - param lets you define where your schema file/files live.
229
+ * You can have as many separate schema files as you want and define paths to them using glob or array of globs syntax.
230
+ *
231
+ * See https://orm.drizzle.team/kit-docs/config-reference#schema
232
+ *
233
+ * ---
234
+ * `out` - allows you to define the folder for your migrations and a folder, where drizzle will introspect the schema and relations
235
+ *
236
+ * See https://orm.drizzle.team/kit-docs/config-reference#out
237
+ *
238
+ * ---
239
+ * `driver` - optional param that is responsible for explicitly providing a driver to use when accessing a database
240
+ * *Possible values*: `aws-data-api`, `d1-http`, `expo`, `turso`, `pglite`
241
+ * 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
242
+ *
243
+ * See https://orm.drizzle.team/kit-docs/config-reference#driver
244
+ *
245
+ * ---
246
+ *
247
+ * `dbCredentials` - an object to define your connection to the database. For more info please check the docs
248
+ *
249
+ * See https://orm.drizzle.team/kit-docs/config-reference#dbcredentials
250
+ *
251
+ * ---
252
+ *
253
+ * `migrations` - param let’s use specify custom table and schema(PostgreSQL only) for migrations.
254
+ * By default, all information about executed migrations will be stored in the database inside
255
+ * the `__drizzle_migrations` table, and for PostgreSQL, inside the drizzle schema.
256
+ * However, you can configure where to store those records.
257
+ *
258
+ * See https://orm.drizzle.team/kit-docs/config-reference#migrations
259
+ *
260
+ * ---
261
+ *
262
+ * `breakpoints` - param lets you enable/disable SQL statement breakpoints in generated migrations.
263
+ * It’s optional and true by default, it’s necessary to properly apply migrations on databases,
264
+ * that do not support multiple DDL alternation statements in one transaction(MySQL, SQLite, SingleStore) and
265
+ * Drizzle ORM has to apply them sequentially one by one.
266
+ *
267
+ * See https://orm.drizzle.team/kit-docs/config-reference#breakpoints
268
+ *
269
+ * ---
270
+ *
271
+ * `tablesFilters` - param lets you filter tables with glob syntax for db push command.
272
+ * It’s useful when you have only one database avaialable for several separate projects with separate sql schemas.
273
+ *
274
+ * How to define multi-project tables with Drizzle ORM — see https://orm.drizzle.team/docs/goodies#multi-project-schema
275
+ *
276
+ * See https://orm.drizzle.team/kit-docs/config-reference#tablesfilters
277
+ *
278
+ * ---
279
+ *
280
+ * `schemaFilter` - parameter allows you to define which schema in PostgreSQL should be used for either introspect or push commands.
281
+ * This parameter accepts a single schema as a string or an array of schemas as strings.
282
+ * No glob pattern is supported here. By default, drizzle will use the public schema for both commands,
283
+ * but you can add any schema you need.
284
+ *
285
+ * For example, having schemaFilter: ["my_schema"] will only look for tables in both the database and
286
+ * drizzle schema that are a part of the my_schema schema.
287
+ *
288
+ * See https://orm.drizzle.team/kit-docs/config-reference#schemafilter
289
+ *
290
+ * ---
291
+ *
292
+ * `verbose` - command is used for drizzle-kit push commands and prints all statements that will be executed.
293
+ *
294
+ * > Note: This command will only print the statements that should be executed.
295
+ * To approve them before applying, please refer to the `strict` command.
296
+ *
297
+ * See https://orm.drizzle.team/kit-docs/config-reference#verbose
298
+ *
299
+ * ---
300
+ *
301
+ * `strict` - command is used for drizzle-kit push commands and will always ask for your confirmation,
302
+ * either to execute all statements needed to sync your schema with the database or not.
303
+ *
304
+ * See https://orm.drizzle.team/kit-docs/config-reference#strict
305
+ */
306
+ declare function defineConfig(config: Config): Config;
307
+
308
+ export { type CasingType as C, type Config as a, defineConfig as d };
package/index.d.mts ADDED
@@ -0,0 +1,2 @@
1
+ import 'tls';
2
+ export { a as Config, d as defineConfig } from './index-Z-1TKnbX.mjs';
package/index.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ import 'tls';
2
+ export { a as Config, d as defineConfig } from './index-Z-1TKnbX.js';
package/index.js ADDED
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var src_exports = {};
22
+ __export(src_exports, {
23
+ defineConfig: () => defineConfig
24
+ });
25
+ module.exports = __toCommonJS(src_exports);
26
+ function defineConfig(config) {
27
+ return config;
28
+ }
29
+ // Annotate the CommonJS export names for ESM import in node:
30
+ 0 && (module.exports = {
31
+ defineConfig
32
+ });
package/index.mjs ADDED
@@ -0,0 +1,7 @@
1
+ // src/index.ts
2
+ function defineConfig(config) {
3
+ return config;
4
+ }
5
+ export {
6
+ defineConfig
7
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anthonyalayo/drizzle-kit",
3
- "version": "1.0.1",
3
+ "version": "1.0.4",
4
4
  "homepage": "https://orm.drizzle.team",
5
5
  "keywords": [
6
6
  "drizzle",
@@ -26,7 +26,7 @@
26
26
  "author": "Drizzle Team",
27
27
  "license": "MIT",
28
28
  "bin": {
29
- "drizzle-kit": "./bin.cjs"
29
+ "@anthonyalayo/drizzle-kit": "./bin.cjs"
30
30
  },
31
31
  "scripts": {
32
32
  "api": "tsx ./dev/api.ts",