@anthonyalayo/drizzle-kit 1.0.2 → 1.0.5

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,869 +0,0 @@
1
- import { mysqlCredentials } from 'src/cli/validations/mysql';
2
- import { postgresCredentials } from 'src/cli/validations/postgres';
3
- import { singlestoreCredentials } from 'src/cli/validations/singlestore';
4
- import { sqliteCredentials } from 'src/cli/validations/sqlite';
5
- import { expect, test } from 'vitest';
6
-
7
- test('turso #1', () => {
8
- sqliteCredentials.parse({
9
- dialect: 'sqlite',
10
- driver: 'turso',
11
- url: 'https://turso.tech',
12
- });
13
- });
14
-
15
- test('turso #2', () => {
16
- sqliteCredentials.parse({
17
- dialect: 'sqlite',
18
- driver: 'turso',
19
- url: 'https://turso.tech',
20
- authToken: 'token',
21
- });
22
- });
23
-
24
- test('turso #3', () => {
25
- expect(() =>
26
- sqliteCredentials.parse({
27
- dialect: 'sqlite',
28
- driver: 'turso',
29
- url: 'https://turso.tech',
30
- authToken: '',
31
- })
32
- ).toThrowError();
33
- });
34
-
35
- test('turso #4', () => {
36
- expect(() => {
37
- sqliteCredentials.parse({
38
- dialect: 'sqlite',
39
- driver: 'turso',
40
- url: '',
41
- authToken: 'token',
42
- });
43
- }).toThrowError();
44
- });
45
-
46
- test('turso #5', () => {
47
- expect(() => {
48
- sqliteCredentials.parse({
49
- dialect: 'sqlite',
50
- driver: 'turso',
51
- url: '',
52
- authToken: '',
53
- });
54
- }).toThrowError();
55
- });
56
-
57
- test('d1-http #1', () => {
58
- sqliteCredentials.parse({
59
- dialect: 'sqlite',
60
- driver: 'd1-http',
61
- accountId: 'accountId',
62
- databaseId: 'databaseId',
63
- token: 'token',
64
- });
65
- });
66
-
67
- test('d1-http #2', () => {
68
- expect(() =>
69
- sqliteCredentials.parse({
70
- dialect: 'sqlite',
71
- driver: 'd1-http',
72
- accountId: 'accountId',
73
- databaseId: 'databaseId',
74
- // token: "token",
75
- })
76
- ).toThrowError();
77
- });
78
-
79
- test('d1-http #3', () => {
80
- expect(() =>
81
- sqliteCredentials.parse({
82
- dialect: 'sqlite',
83
- driver: 'd1-http',
84
- accountId: 'accountId',
85
- databaseId: 'databaseId',
86
- token: '',
87
- })
88
- ).toThrowError();
89
- });
90
-
91
- test('d1-http #4', () => {
92
- expect(() =>
93
- sqliteCredentials.parse({
94
- dialect: 'sqlite',
95
- driver: 'd1-http',
96
- accountId: 'accountId',
97
- // databaseId: "databaseId",
98
- token: 'token',
99
- })
100
- ).toThrowError();
101
- });
102
-
103
- test('d1-http #5', () => {
104
- expect(() =>
105
- sqliteCredentials.parse({
106
- dialect: 'sqlite',
107
- driver: 'd1-http',
108
- accountId: 'accountId',
109
- databaseId: '',
110
- token: 'token',
111
- })
112
- ).toThrowError();
113
- });
114
-
115
- test('d1-http #6', () => {
116
- expect(() =>
117
- sqliteCredentials.parse({
118
- dialect: 'sqlite',
119
- driver: 'd1-http',
120
- // accountId: "accountId",
121
- databaseId: 'databaseId',
122
- token: 'token',
123
- })
124
- ).toThrowError();
125
- });
126
-
127
- test('d1-http #7', () => {
128
- expect(() =>
129
- sqliteCredentials.parse({
130
- dialect: 'sqlite',
131
- driver: 'd1-http',
132
- accountId: '',
133
- databaseId: 'databaseId',
134
- token: 'token',
135
- })
136
- ).toThrowError();
137
- });
138
-
139
- // omit undefined driver
140
- test('sqlite #1', () => {
141
- expect(
142
- sqliteCredentials.parse({
143
- dialect: 'sqlite',
144
- driver: undefined,
145
- url: 'https://turso.tech',
146
- }),
147
- ).toStrictEqual({
148
- url: 'https://turso.tech',
149
- });
150
- });
151
-
152
- test('sqlite #2', () => {
153
- expect(
154
- sqliteCredentials.parse({
155
- dialect: 'sqlite',
156
- url: 'https://turso.tech',
157
- }),
158
- ).toStrictEqual({
159
- url: 'https://turso.tech',
160
- });
161
- });
162
-
163
- test('sqlite #3', () => {
164
- expect(() =>
165
- sqliteCredentials.parse({
166
- dialect: 'sqlite',
167
- url: '',
168
- })
169
- ).toThrowError();
170
- });
171
-
172
- test('AWS Data API #1', () => {
173
- expect(
174
- postgresCredentials.parse({
175
- dialect: 'postgres',
176
- url: 'https://turso.tech',
177
- }),
178
- ).toStrictEqual({
179
- url: 'https://turso.tech',
180
- });
181
- });
182
-
183
- test('AWS Data API #1', () => {
184
- expect(
185
- postgresCredentials.parse({
186
- dialect: 'postgres',
187
- driver: 'aws-data-api',
188
- database: 'database',
189
- secretArn: 'secretArn',
190
- resourceArn: 'resourceArn',
191
- }),
192
- ).toStrictEqual({
193
- driver: 'aws-data-api',
194
- database: 'database',
195
- secretArn: 'secretArn',
196
- resourceArn: 'resourceArn',
197
- });
198
- });
199
-
200
- test('AWS Data API #2', () => {
201
- expect(() => {
202
- postgresCredentials.parse({
203
- dialect: 'postgres',
204
- driver: 'aws-data-api',
205
- database: 'database',
206
- secretArn: '',
207
- resourceArn: 'resourceArn',
208
- });
209
- }).toThrowError();
210
- });
211
- test('AWS Data API #3', () => {
212
- expect(() => {
213
- postgresCredentials.parse({
214
- dialect: 'postgres',
215
- driver: 'aws-data-api',
216
- database: 'database',
217
- secretArn: 'secretArn',
218
- resourceArn: '',
219
- });
220
- }).toThrowError();
221
- });
222
- test('AWS Data API #4', () => {
223
- expect(() => {
224
- postgresCredentials.parse({
225
- dialect: 'postgres',
226
- driver: 'aws-data-api',
227
- database: '',
228
- secretArn: 'secretArn',
229
- resourceArn: 'resourceArn',
230
- });
231
- }).toThrowError();
232
- });
233
-
234
- test('AWS Data API #5', () => {
235
- expect(() => {
236
- postgresCredentials.parse({
237
- dialect: 'postgres',
238
- driver: 'aws-data-api',
239
- database: 'database',
240
- resourceArn: 'resourceArn',
241
- });
242
- }).toThrowError();
243
- });
244
- test('AWS Data API #6', () => {
245
- expect(() => {
246
- postgresCredentials.parse({
247
- dialect: 'postgres',
248
- driver: 'aws-data-api',
249
- secretArn: 'secretArn',
250
- resourceArn: 'resourceArn',
251
- });
252
- }).toThrowError();
253
- });
254
- test('AWS Data API #7', () => {
255
- expect(() => {
256
- postgresCredentials.parse({
257
- dialect: 'postgres',
258
- driver: 'aws-data-api',
259
- database: 'database',
260
- secretArn: 'secretArn',
261
- });
262
- }).toThrowError();
263
- });
264
-
265
- test('AWS Data API #8', () => {
266
- expect(() => {
267
- postgresCredentials.parse({
268
- dialect: 'postgres',
269
- driver: 'aws-data-api',
270
- });
271
- }).toThrowError();
272
- });
273
-
274
- test('PGlite #1', () => {
275
- expect(
276
- postgresCredentials.parse({
277
- dialect: 'postgres',
278
- driver: 'pglite',
279
- url: './my.db',
280
- }),
281
- ).toStrictEqual({
282
- driver: 'pglite',
283
- url: './my.db',
284
- });
285
- });
286
-
287
- test('PGlite #2', () => {
288
- expect(() => {
289
- postgresCredentials.parse({
290
- dialect: 'postgres',
291
- driver: 'pglite',
292
- url: '',
293
- });
294
- }).toThrowError();
295
- });
296
-
297
- test('PGlite #3', () => {
298
- expect(() => {
299
- postgresCredentials.parse({
300
- dialect: 'postgres',
301
- driver: 'pglite',
302
- });
303
- }).toThrowError();
304
- });
305
-
306
- test('postgres #1', () => {
307
- expect(
308
- postgresCredentials.parse({
309
- dialect: 'postgres',
310
- url: 'https://turso.tech',
311
- }),
312
- ).toStrictEqual({
313
- url: 'https://turso.tech',
314
- });
315
- });
316
-
317
- test('postgres #2', () => {
318
- expect(
319
- postgresCredentials.parse({
320
- dialect: 'postgres',
321
- driver: undefined,
322
- url: 'https://turso.tech',
323
- }),
324
- ).toStrictEqual({
325
- url: 'https://turso.tech',
326
- });
327
- });
328
-
329
- test('postgres #3', () => {
330
- expect(
331
- postgresCredentials.parse({
332
- dialect: 'postgres',
333
- database: 'database',
334
- host: 'host',
335
- }),
336
- ).toStrictEqual({
337
- database: 'database',
338
- host: 'host',
339
- });
340
- });
341
-
342
- test('postgres #4', () => {
343
- expect(
344
- postgresCredentials.parse({
345
- dialect: 'postgres',
346
- database: 'database',
347
- host: 'host',
348
- }),
349
- ).toStrictEqual({
350
- database: 'database',
351
- host: 'host',
352
- });
353
- });
354
-
355
- test('postgres #5', () => {
356
- expect(
357
- postgresCredentials.parse({
358
- dialect: 'postgres',
359
- host: 'host',
360
- port: 1234,
361
- user: 'user',
362
- password: 'password',
363
- database: 'database',
364
- ssl: 'require',
365
- }),
366
- ).toStrictEqual({
367
- host: 'host',
368
- port: 1234,
369
- user: 'user',
370
- password: 'password',
371
- database: 'database',
372
- ssl: 'require',
373
- });
374
- });
375
-
376
- test('postgres #6', () => {
377
- expect(
378
- postgresCredentials.parse({
379
- dialect: 'postgres',
380
- host: 'host',
381
- database: 'database',
382
- ssl: true,
383
- }),
384
- ).toStrictEqual({
385
- host: 'host',
386
- database: 'database',
387
- ssl: true,
388
- });
389
- });
390
-
391
- test('postgres #7', () => {
392
- expect(
393
- postgresCredentials.parse({
394
- dialect: 'postgres',
395
- host: 'host',
396
- database: 'database',
397
- ssl: 'allow',
398
- }),
399
- ).toStrictEqual({
400
- host: 'host',
401
- database: 'database',
402
- ssl: 'allow',
403
- });
404
- });
405
-
406
- test('postgres #8', () => {
407
- expect(
408
- postgresCredentials.parse({
409
- dialect: 'postgres',
410
- host: 'host',
411
- database: 'database',
412
- ssl: {
413
- ca: 'ca',
414
- cert: 'cert',
415
- },
416
- }),
417
- ).toStrictEqual({
418
- host: 'host',
419
- database: 'database',
420
- ssl: {
421
- ca: 'ca',
422
- cert: 'cert',
423
- },
424
- });
425
- });
426
-
427
- test('postgres #9', () => {
428
- expect(() => {
429
- postgresCredentials.parse({
430
- dialect: 'postgres',
431
- });
432
- }).toThrowError();
433
- });
434
-
435
- test('postgres #10', () => {
436
- expect(() => {
437
- postgresCredentials.parse({
438
- dialect: 'postgres',
439
- url: undefined,
440
- });
441
- }).toThrowError();
442
- });
443
-
444
- test('postgres #11', () => {
445
- expect(() => {
446
- postgresCredentials.parse({
447
- dialect: 'postgres',
448
- url: '',
449
- });
450
- }).toThrowError();
451
- });
452
-
453
- test('postgres #12', () => {
454
- expect(() => {
455
- postgresCredentials.parse({
456
- dialect: 'postgres',
457
- host: '',
458
- database: '',
459
- });
460
- }).toThrowError();
461
- });
462
-
463
- test('postgres #13', () => {
464
- expect(() => {
465
- postgresCredentials.parse({
466
- dialect: 'postgres',
467
- database: '',
468
- });
469
- }).toThrowError();
470
- });
471
-
472
- test('postgres #14', () => {
473
- expect(() => {
474
- postgresCredentials.parse({
475
- dialect: 'postgres',
476
- host: '',
477
- });
478
- }).toThrowError();
479
- });
480
-
481
- test('postgres #15', () => {
482
- expect(() => {
483
- postgresCredentials.parse({
484
- dialect: 'postgres',
485
- database: ' ',
486
- host: '',
487
- });
488
- }).toThrowError();
489
- });
490
-
491
- test('postgres #16', () => {
492
- expect(() => {
493
- postgresCredentials.parse({
494
- dialect: 'postgres',
495
- database: '',
496
- host: ' ',
497
- });
498
- }).toThrowError();
499
- });
500
-
501
- test('postgres #17', () => {
502
- expect(() => {
503
- postgresCredentials.parse({
504
- dialect: 'postgres',
505
- database: ' ',
506
- host: ' ',
507
- port: '',
508
- });
509
- }).toThrowError();
510
- });
511
-
512
- test('mysql #1', () => {
513
- expect(
514
- mysqlCredentials.parse({
515
- dialect: 'mysql',
516
- url: 'https://turso.tech',
517
- }),
518
- ).toStrictEqual({
519
- url: 'https://turso.tech',
520
- });
521
- });
522
-
523
- test('mysql #2', () => {
524
- expect(
525
- mysqlCredentials.parse({
526
- dialect: 'mysql',
527
- driver: undefined,
528
- url: 'https://turso.tech',
529
- }),
530
- ).toStrictEqual({
531
- url: 'https://turso.tech',
532
- });
533
- });
534
-
535
- test('mysql #3', () => {
536
- expect(
537
- mysqlCredentials.parse({
538
- dialect: 'mysql',
539
- database: 'database',
540
- host: 'host',
541
- }),
542
- ).toStrictEqual({
543
- database: 'database',
544
- host: 'host',
545
- });
546
- });
547
-
548
- test('mysql #4', () => {
549
- expect(
550
- mysqlCredentials.parse({
551
- dialect: 'mysql',
552
- database: 'database',
553
- host: 'host',
554
- }),
555
- ).toStrictEqual({
556
- database: 'database',
557
- host: 'host',
558
- });
559
- });
560
-
561
- test('mysql #5', () => {
562
- expect(
563
- mysqlCredentials.parse({
564
- dialect: 'mysql',
565
- host: 'host',
566
- port: 1234,
567
- user: 'user',
568
- password: 'password',
569
- database: 'database',
570
- ssl: 'require',
571
- }),
572
- ).toStrictEqual({
573
- host: 'host',
574
- port: 1234,
575
- user: 'user',
576
- password: 'password',
577
- database: 'database',
578
- ssl: 'require',
579
- });
580
- });
581
-
582
- test('mysql #7', () => {
583
- expect(
584
- mysqlCredentials.parse({
585
- dialect: 'mysql',
586
- host: 'host',
587
- database: 'database',
588
- ssl: 'allow',
589
- }),
590
- ).toStrictEqual({
591
- host: 'host',
592
- database: 'database',
593
- ssl: 'allow',
594
- });
595
- });
596
-
597
- test('mysql #8', () => {
598
- expect(
599
- mysqlCredentials.parse({
600
- dialect: 'mysql',
601
- host: 'host',
602
- database: 'database',
603
- ssl: {
604
- ca: 'ca',
605
- cert: 'cert',
606
- },
607
- }),
608
- ).toStrictEqual({
609
- host: 'host',
610
- database: 'database',
611
- ssl: {
612
- ca: 'ca',
613
- cert: 'cert',
614
- },
615
- });
616
- });
617
-
618
- test('mysql #9', () => {
619
- expect(() => {
620
- mysqlCredentials.parse({
621
- dialect: 'mysql',
622
- });
623
- }).toThrowError();
624
- });
625
-
626
- test('mysql #10', () => {
627
- expect(() => {
628
- mysqlCredentials.parse({
629
- dialect: 'mysql',
630
- url: undefined,
631
- });
632
- }).toThrowError();
633
- });
634
-
635
- test('mysql #11', () => {
636
- expect(() => {
637
- mysqlCredentials.parse({
638
- dialect: 'mysql',
639
- url: '',
640
- });
641
- }).toThrowError();
642
- });
643
-
644
- test('mysql #12', () => {
645
- expect(() => {
646
- mysqlCredentials.parse({
647
- dialect: 'mysql',
648
- host: '',
649
- database: '',
650
- });
651
- }).toThrowError();
652
- });
653
-
654
- test('mysql #13', () => {
655
- expect(() => {
656
- mysqlCredentials.parse({
657
- dialect: 'mysql',
658
- database: '',
659
- });
660
- }).toThrowError();
661
- });
662
-
663
- test('mysql #14', () => {
664
- expect(() => {
665
- mysqlCredentials.parse({
666
- dialect: 'mysql',
667
- host: '',
668
- });
669
- }).toThrowError();
670
- });
671
-
672
- test('mysql #15', () => {
673
- expect(() => {
674
- mysqlCredentials.parse({
675
- dialect: 'mysql',
676
- database: ' ',
677
- host: '',
678
- });
679
- }).toThrowError();
680
- });
681
-
682
- test('mysql #16', () => {
683
- expect(() => {
684
- mysqlCredentials.parse({
685
- dialect: 'mysql',
686
- database: '',
687
- host: ' ',
688
- });
689
- }).toThrowError();
690
- });
691
-
692
- test('mysql #17', () => {
693
- expect(() => {
694
- mysqlCredentials.parse({
695
- dialect: 'mysql',
696
- database: ' ',
697
- host: ' ',
698
- port: '',
699
- });
700
- }).toThrowError();
701
- });
702
-
703
- test('singlestore #1', () => {
704
- expect(
705
- singlestoreCredentials.parse({
706
- dialect: 'singlestore',
707
- database: 'database',
708
- host: 'host',
709
- }),
710
- ).toStrictEqual({
711
- database: 'database',
712
- host: 'host',
713
- });
714
- });
715
-
716
- test('singlestore #2', () => {
717
- expect(
718
- singlestoreCredentials.parse({
719
- dialect: 'singlestore',
720
- database: 'database',
721
- host: 'host',
722
- }),
723
- ).toStrictEqual({
724
- database: 'database',
725
- host: 'host',
726
- });
727
- });
728
-
729
- test('singlestore #3', () => {
730
- expect(
731
- singlestoreCredentials.parse({
732
- dialect: 'singlestore',
733
- host: 'host',
734
- port: 1234,
735
- user: 'user',
736
- password: 'password',
737
- database: 'database',
738
- ssl: 'require',
739
- }),
740
- ).toStrictEqual({
741
- host: 'host',
742
- port: 1234,
743
- user: 'user',
744
- password: 'password',
745
- database: 'database',
746
- ssl: 'require',
747
- });
748
- });
749
-
750
- test('singlestore #4', () => {
751
- expect(
752
- singlestoreCredentials.parse({
753
- dialect: 'singlestore',
754
- host: 'host',
755
- database: 'database',
756
- ssl: 'allow',
757
- }),
758
- ).toStrictEqual({
759
- host: 'host',
760
- database: 'database',
761
- ssl: 'allow',
762
- });
763
- });
764
-
765
- test('singlestore #5', () => {
766
- expect(
767
- singlestoreCredentials.parse({
768
- dialect: 'singlestore',
769
- host: 'host',
770
- database: 'database',
771
- ssl: {
772
- ca: 'ca',
773
- cert: 'cert',
774
- },
775
- }),
776
- ).toStrictEqual({
777
- host: 'host',
778
- database: 'database',
779
- ssl: {
780
- ca: 'ca',
781
- cert: 'cert',
782
- },
783
- });
784
- });
785
-
786
- test('singlestore #6', () => {
787
- expect(() => {
788
- singlestoreCredentials.parse({
789
- dialect: 'singlestore',
790
- });
791
- }).toThrowError();
792
- });
793
-
794
- test('singlestore #7', () => {
795
- expect(() => {
796
- singlestoreCredentials.parse({
797
- dialect: 'singlestore',
798
- url: undefined,
799
- });
800
- }).toThrowError();
801
- });
802
-
803
- test('singlestore #8', () => {
804
- expect(() => {
805
- singlestoreCredentials.parse({
806
- dialect: 'singlestore',
807
- url: '',
808
- });
809
- }).toThrowError();
810
- });
811
-
812
- test('singlestore #9', () => {
813
- expect(() => {
814
- singlestoreCredentials.parse({
815
- dialect: 'singlestore',
816
- host: '',
817
- database: '',
818
- });
819
- }).toThrowError();
820
- });
821
-
822
- test('singlestore #10', () => {
823
- expect(() => {
824
- singlestoreCredentials.parse({
825
- dialect: 'singlestore',
826
- database: '',
827
- });
828
- }).toThrowError();
829
- });
830
-
831
- test('singlestore #11', () => {
832
- expect(() => {
833
- singlestoreCredentials.parse({
834
- dialect: 'singlestore',
835
- host: '',
836
- });
837
- }).toThrowError();
838
- });
839
-
840
- test('singlestore #12', () => {
841
- expect(() => {
842
- singlestoreCredentials.parse({
843
- dialect: 'singlestore',
844
- database: ' ',
845
- host: '',
846
- });
847
- }).toThrowError();
848
- });
849
-
850
- test('singlestore #13', () => {
851
- expect(() => {
852
- singlestoreCredentials.parse({
853
- dialect: 'singlestore',
854
- database: '',
855
- host: ' ',
856
- });
857
- }).toThrowError();
858
- });
859
-
860
- test('singlestore #14', () => {
861
- expect(() => {
862
- singlestoreCredentials.parse({
863
- dialect: 'singlestore',
864
- database: ' ',
865
- host: ' ',
866
- port: '',
867
- });
868
- }).toThrowError();
869
- });