@lamhieu/prisma-schema-engine-wasm 7.8.0

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.
@@ -0,0 +1,869 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * The version of the @prisma/schema-engine-wasm.
5
+ */
6
+ export function version(): string;
7
+ /**
8
+ * Parameters defining the construction of an engine.
9
+ */
10
+ export interface ConstructorOptions {
11
+ /**
12
+ * The initial datamodels to use.
13
+ */
14
+ datamodels: [string, string][] | undefined;
15
+ }
16
+
17
+ export interface TransactionOptions {
18
+ /**
19
+ * Whether or not to run a phantom query (i.e., a query that only influences Prisma event logs, but not the database itself)
20
+ * before opening a transaction, committing, or rollbacking.
21
+ */
22
+ usePhantomQuery: boolean;
23
+ }
24
+
25
+ /**
26
+ * Information about a migration directory.
27
+ */
28
+ export interface MigrationDirectory {
29
+ /**
30
+ * Relative path to a migration directory from `baseDir`.
31
+ * E.g., `20201117144659_test`.
32
+ */
33
+ path: string;
34
+ /**
35
+ * Information about the migration file within the directory.
36
+ */
37
+ migrationFile: MigrationFile;
38
+ }
39
+
40
+ /**
41
+ * Information about a migration file within a migration directory.
42
+ */
43
+ export interface MigrationFile {
44
+ /**
45
+ * Relative path to the migration file from the migration directory.
46
+ * E.g., `migration.sql`.
47
+ */
48
+ path: string;
49
+ /**
50
+ * Content of the migration file or error if it couldn\'t be read.
51
+ */
52
+ content: JsResult<string, string>;
53
+ }
54
+
55
+ /**
56
+ * Information about a database view.
57
+ */
58
+ export interface IntrospectionView {
59
+ /**
60
+ * The view definition.
61
+ */
62
+ definition: string;
63
+ /**
64
+ * The view name.
65
+ */
66
+ name: string;
67
+ /**
68
+ * The schema name.
69
+ */
70
+ schema: string;
71
+ }
72
+
73
+ /**
74
+ * Response result for the `schemaPush` method.
75
+ */
76
+ export interface SchemaPushOutput {
77
+ /**
78
+ * How many migration steps were executed.
79
+ */
80
+ executedSteps: number;
81
+ /**
82
+ * Steps that cannot be executed in the current state of the database.
83
+ */
84
+ unexecutable: string[];
85
+ /**
86
+ * Destructive change warnings.
87
+ */
88
+ warnings: string[];
89
+ }
90
+
91
+ /**
92
+ * Information about a SQL query parameter.
93
+ */
94
+ export interface SqlQueryParameterOutput {
95
+ /**
96
+ * Parameter name.
97
+ */
98
+ name: string;
99
+ /**
100
+ * Parameter type.
101
+ */
102
+ typ: string;
103
+ /**
104
+ * Optional documentation.
105
+ */
106
+ documentation: string | null;
107
+ /**
108
+ * Whether the parameter is nullable.
109
+ */
110
+ nullable: boolean;
111
+ }
112
+
113
+ /**
114
+ * The type of params for the `diff` method.
115
+ */
116
+ export interface DiffParams {
117
+ /**
118
+ * The source of the schema to consider as a _starting point_.
119
+ */
120
+ from: DiffTarget;
121
+ /**
122
+ * The source of the schema to consider as a _destination_, or the desired
123
+ * end-state.
124
+ */
125
+ to: DiffTarget;
126
+ /**
127
+ * By default, the response will contain a human-readable diff. If you want an
128
+ * executable script, pass the `\"script\": true` param.
129
+ */
130
+ script: boolean;
131
+ /**
132
+ * Whether the --exit-code param was passed.
133
+ *
134
+ * If this is set, the engine will return exitCode = 2 in the diffResult in case the diff is
135
+ * non-empty. Other than this, it does not change the behaviour of the command.
136
+ */
137
+ exitCode: boolean | null;
138
+ /**
139
+ * The schema filter to use during the diff.
140
+ */
141
+ filters: SchemaFilter;
142
+ }
143
+
144
+ /**
145
+ * Reset action fields.
146
+ */
147
+ export interface DevActionReset {
148
+ /**
149
+ * Why do we need to reset?
150
+ */
151
+ reason: string;
152
+ }
153
+
154
+ /**
155
+ * A suggested action for the CLI `migrate dev` command.
156
+ */
157
+ export type DevAction = ({ tag: "reset" } & DevActionReset) | { tag: "createMigration" };
158
+
159
+ /**
160
+ * A container that holds multiple Prisma schema files.
161
+ */
162
+ export interface SchemasContainer {
163
+ /**
164
+ * List of schema files.
165
+ */
166
+ files: SchemaContainer[];
167
+ }
168
+
169
+ /**
170
+ * Information about a SQL query result column.
171
+ */
172
+ export interface SqlQueryColumnOutput {
173
+ /**
174
+ * Column name.
175
+ */
176
+ name: string;
177
+ /**
178
+ * Column type.
179
+ */
180
+ typ: string;
181
+ /**
182
+ * Whether the column is nullable.
183
+ */
184
+ nullable: boolean;
185
+ }
186
+
187
+ /**
188
+ * Params type for the introspectSql method.
189
+ */
190
+ export interface IntrospectSqlParams {
191
+ /**
192
+ * The database URL.
193
+ */
194
+ url: string;
195
+ /**
196
+ * SQL queries to introspect.
197
+ */
198
+ queries: SqlQueryInput[];
199
+ }
200
+
201
+ /**
202
+ * A data loss warning or an unexecutable migration error, associated with the step that triggered it.
203
+ */
204
+ export interface MigrationFeedback {
205
+ /**
206
+ * The human-readable message.
207
+ */
208
+ message: string;
209
+ /**
210
+ * The index of the step this pertains to.
211
+ */
212
+ stepIndex: number;
213
+ }
214
+
215
+ /**
216
+ * The type of params accepted by dbExecute.
217
+ */
218
+ export interface DbExecuteParams {
219
+ /**
220
+ * The location of the live database to connect to.
221
+ */
222
+ datasourceType: DbExecuteDatasourceType;
223
+ /**
224
+ * The input script.
225
+ */
226
+ script: string;
227
+ }
228
+
229
+ /**
230
+ * The response type for `devDiagnostic`.
231
+ */
232
+ export interface DevDiagnosticOutput {
233
+ /**
234
+ * The suggested course of action for the CLI.
235
+ */
236
+ action: DevAction;
237
+ }
238
+
239
+ /**
240
+ * Result type for the ensureConnectionValidity method.
241
+ */
242
+ export interface EnsureConnectionValidityResult {}
243
+
244
+ /**
245
+ * A list of Prisma schema files with a config directory.
246
+ */
247
+ export interface SchemasWithConfigDir {
248
+ /**
249
+ * A list of Prisma schema files.
250
+ */
251
+ files: SchemaContainer[];
252
+ /**
253
+ * An optional directory containing the config files such as SSL certificates.
254
+ */
255
+ configDir: string;
256
+ }
257
+
258
+ /**
259
+ * The input to the `reset` command.
260
+ */
261
+ export interface ResetInput {
262
+ /**
263
+ * The schema filter to use during the reset. Only relevant during \"soft\" resets though - usually we try to drop the whole database.
264
+ */
265
+ filter: SchemaFilter;
266
+ }
267
+
268
+ /**
269
+ * Input for a single SQL query.
270
+ */
271
+ export interface SqlQueryInput {
272
+ /**
273
+ * The name of the query.
274
+ */
275
+ name: string;
276
+ /**
277
+ * The source SQL.
278
+ */
279
+ source: string;
280
+ }
281
+
282
+ /**
283
+ * The request params for the `diagnoseMigrationHistory` method.
284
+ */
285
+ export interface DiagnoseMigrationHistoryInput {
286
+ /**
287
+ * The list of migrations, already loaded from disk.
288
+ */
289
+ migrationsList: MigrationList;
290
+ /**
291
+ * Whether creating a shadow database is allowed.
292
+ */
293
+ optInToShadowDatabase: boolean;
294
+ /**
295
+ * The schema filter to use during checks on the database.
296
+ * Note: Only used if opt_in_to_shadow_database is true.
297
+ */
298
+ filters: SchemaFilter;
299
+ }
300
+
301
+ /**
302
+ * The result type for `diagnoseMigrationHistory` responses.
303
+ */
304
+ export interface DiagnoseMigrationHistoryOutput {
305
+ /**
306
+ * The names of the migrations for which the checksum of the script in the
307
+ * migration directory does not match the checksum of the applied migration
308
+ * in the database.
309
+ */
310
+ editedMigrationNames: string[];
311
+ /**
312
+ * The names of the migrations that are currently in a failed state in the migrations table.
313
+ */
314
+ failedMigrationNames: string[];
315
+ /**
316
+ * Is the migrations table initialized/present in the database?
317
+ */
318
+ hasMigrationsTable: boolean;
319
+ /**
320
+ * The current status of the migration history of the database
321
+ * relative to migrations directory. `null` if they are in sync and up
322
+ * to date.
323
+ */
324
+ history: HistoryDiagnostic | null;
325
+ }
326
+
327
+ /**
328
+ * The request type for `devDiagnostic`.
329
+ */
330
+ export interface DevDiagnosticInput {
331
+ /**
332
+ * The list of migrations, already loaded from disk.
333
+ */
334
+ migrationsList: MigrationList;
335
+ /**
336
+ * The schema filter to use during checks on the database.
337
+ */
338
+ filters: SchemaFilter;
339
+ }
340
+
341
+ /**
342
+ * Get the database version for error reporting.
343
+ * @deprecated
344
+ */
345
+ export interface GetDatabaseVersionInput {
346
+ /**
347
+ * The datasource parameter.
348
+ */
349
+ datasource: DatasourceParam;
350
+ }
351
+
352
+ /**
353
+ * A list of migration directories with related information.
354
+ */
355
+ export interface MigrationList {
356
+ /**
357
+ * Absolute path to the base directory of Prisma migrations.
358
+ * E.g., `/usr/src/app/prisma/migrations`.
359
+ */
360
+ baseDir: string;
361
+ /**
362
+ * Description of the lockfile, which may or may not exist.
363
+ */
364
+ lockfile: MigrationLockfile;
365
+ /**
366
+ * An init script that will be run on the shadow database before the migrations are applied. Can be a no-op.
367
+ */
368
+ shadowDbInitScript: string;
369
+ /**
370
+ * List of migration directories.
371
+ */
372
+ migrationDirectories: MigrationDirectory[];
373
+ }
374
+
375
+ /**
376
+ * The input to the `applyMigrations` command.
377
+ */
378
+ export interface ApplyMigrationsInput {
379
+ /**
380
+ * The list of migrations, already loaded from disk.
381
+ */
382
+ migrationsList: MigrationList;
383
+ /**
384
+ * The schema filter to use during the apply migrations.
385
+ */
386
+ filters: SchemaFilter;
387
+ }
388
+
389
+ /**
390
+ * Result type for the introspectSql method.
391
+ */
392
+ export interface IntrospectSqlResult {
393
+ /**
394
+ * The introspected queries.
395
+ */
396
+ queries: SqlQueryOutput[];
397
+ }
398
+
399
+ /**
400
+ * A container that holds the path and the content of a Prisma schema file.
401
+ */
402
+ export interface SchemaContainer {
403
+ /**
404
+ * The content of the Prisma schema file.
405
+ */
406
+ content: string;
407
+ /**
408
+ * The file name of the Prisma schema file.
409
+ */
410
+ path: string;
411
+ }
412
+
413
+ /**
414
+ * The type of params for the `createDatabase` method.
415
+ */
416
+ export interface CreateDatabaseParams {
417
+ /**
418
+ * The datasource parameter.
419
+ */
420
+ datasource: DatasourceParam;
421
+ }
422
+
423
+ /**
424
+ * Configuration of entities in the schema/database to be included or excluded from an operation.
425
+ */
426
+ export interface SchemaFilter {
427
+ /**
428
+ * Tables that shall be considered \'externally\" managed. As per prisma.config.ts > tables.external.
429
+ */
430
+ externalTables: string[];
431
+ /**
432
+ * Enums that shall be considered \"externally\" managed. As per prisma.config.ts > enums.external.
433
+ */
434
+ externalEnums: string[];
435
+ }
436
+
437
+ /**
438
+ * Mark an existing failed migration as rolled back in the migrations table. It
439
+ * will still be there, but ignored for all purposes except as audit trail.
440
+ */
441
+ export interface MarkMigrationRolledBackInput {
442
+ /**
443
+ * The name of the migration to mark rolled back.
444
+ */
445
+ migrationName: string;
446
+ }
447
+
448
+ /**
449
+ * Mark a migration as applied in the migrations table.
450
+ *
451
+ * There are two possible outcomes:
452
+ *
453
+ * - The migration is already in the table, but in a failed state. In this case, we will mark it
454
+ * as rolled back, then create a new entry.
455
+ * - The migration is not in the table. We will create a new entry in the migrations table. The
456
+ * `started_at` and `finished_at` will be the same.
457
+ * - If it is already applied, we return a user-facing error.
458
+ */
459
+ export interface MarkMigrationAppliedInput {
460
+ /**
461
+ * The name of the migration to mark applied.
462
+ */
463
+ migrationName: string;
464
+ /**
465
+ * The list of migrations, already loaded from disk.
466
+ */
467
+ migrationsList: MigrationList;
468
+ }
469
+
470
+ /**
471
+ * Introspect the database (db pull)
472
+ */
473
+ export interface IntrospectParams {
474
+ /**
475
+ * Prisma schema files.
476
+ */
477
+ schema: SchemasContainer;
478
+ /**
479
+ * Base directory path.
480
+ */
481
+ baseDirectoryPath: string;
482
+ /**
483
+ * Force flag.
484
+ */
485
+ force: boolean;
486
+ /**
487
+ * Composite type depth.
488
+ */
489
+ compositeTypeDepth: number;
490
+ /**
491
+ * Optional namespaces.
492
+ */
493
+ namespaces: string[] | null;
494
+ }
495
+
496
+ /**
497
+ * The input to the `createMigration` command.
498
+ */
499
+ export interface CreateMigrationInput {
500
+ /**
501
+ * If true, always generate a migration, but do not apply.
502
+ */
503
+ draft: boolean;
504
+ /**
505
+ * The user-given name for the migration. This will be used for the migration directory.
506
+ */
507
+ migrationName: string;
508
+ /**
509
+ * The list of migrations, already loaded from disk.
510
+ */
511
+ migrationsList: MigrationList;
512
+ /**
513
+ * The Prisma schema content to use as a target for the generated migration.
514
+ */
515
+ schema: SchemasContainer;
516
+ /**
517
+ * Entities to be included or excluded from the migration.
518
+ */
519
+ filters: SchemaFilter;
520
+ }
521
+
522
+ /**
523
+ * The output of the `applyMigrations` command.
524
+ */
525
+ export interface ApplyMigrationsOutput {
526
+ /**
527
+ * The names of the migrations that were just applied. Empty if no migration was applied.
528
+ */
529
+ appliedMigrationNames: string[];
530
+ }
531
+
532
+ /**
533
+ * The output of the `markMigrationRolledBack` command.
534
+ */
535
+ export interface MarkMigrationRolledBackOutput {}
536
+
537
+ /**
538
+ * Result type for the introspect method.
539
+ */
540
+ export interface IntrospectResult {
541
+ /**
542
+ * The introspected schema.
543
+ */
544
+ schema: SchemasContainer;
545
+ /**
546
+ * Optional views.
547
+ */
548
+ views: IntrospectionView[] | null;
549
+ /**
550
+ * Optional warnings.
551
+ */
552
+ warnings: string | null;
553
+ }
554
+
555
+ /**
556
+ * Response for debug panic.
557
+ */
558
+ export interface DebugPanicOutput {}
559
+
560
+ /**
561
+ * Output for a single SQL query.
562
+ */
563
+ export interface SqlQueryOutput {
564
+ /**
565
+ * The name of the query.
566
+ */
567
+ name: string;
568
+ /**
569
+ * The source SQL.
570
+ */
571
+ source: string;
572
+ /**
573
+ * Optional documentation.
574
+ */
575
+ documentation: string | null;
576
+ /**
577
+ * Query parameters.
578
+ */
579
+ parameters: SqlQueryParameterOutput[];
580
+ /**
581
+ * Query result columns.
582
+ */
583
+ resultColumns: SqlQueryColumnOutput[];
584
+ }
585
+
586
+ /**
587
+ * The type of results returned by dbExecute.
588
+ */
589
+ export interface DbExecuteResult {}
590
+
591
+ /**
592
+ * A supported source for a database schema to diff in the `diff` command.
593
+ */
594
+ export type DiffTarget = { tag: "empty" } | ({ tag: "schemaDatasource" } & SchemasWithConfigDir) | ({ tag: "schemaDatamodel" } & SchemasContainer) | ({ tag: "url" } & UrlContainer) | ({ tag: "migrations" } & MigrationList);
595
+
596
+ /**
597
+ * The result for the `createDatabase` method.
598
+ */
599
+ export interface CreateDatabaseResult {
600
+ /**
601
+ * The name of the created database.
602
+ */
603
+ databaseName: string;
604
+ }
605
+
606
+ /**
607
+ * Development command for migrations. Evaluate the data loss induced by the next
608
+ * migration the engine would generate on the main database.
609
+ *
610
+ * At this stage, the engine does not create or mutate anything in the database
611
+ * nor in the migrations directory.
612
+ *
613
+ * This is part of the `migrate dev` flow.
614
+ *
615
+ * **Note**: the engine currently assumes the main database schema is up-to-date
616
+ * with the migration history.
617
+ */
618
+ export interface EvaluateDataLossInput {
619
+ /**
620
+ * The list of migrations, already loaded from disk.
621
+ */
622
+ migrationsList: MigrationList;
623
+ /**
624
+ * The prisma schema files to migrate to.
625
+ */
626
+ schema: SchemasContainer;
627
+ /**
628
+ * Entities to be included or excluded during the data loss evaluation.
629
+ */
630
+ filters: SchemaFilter;
631
+ }
632
+
633
+ /**
634
+ * The output of the `createMigration` command.
635
+ */
636
+ export interface CreateMigrationOutput {
637
+ /**
638
+ * The active connector type used.
639
+ */
640
+ connectorType: 'sqlite' | 'postgresql' | 'cockroachdb';
641
+ /**
642
+ * The generated name of migration directory, which the caller must use to create the new directory.
643
+ */
644
+ generatedMigrationName: string;
645
+ /**
646
+ * The migration script that was generated, if any.
647
+ * It will be null if:
648
+ * 1. The migration we generate would be empty, **AND**
649
+ * 2. the `draft` param was not true, because in that case the engine would still generate an empty
650
+ * migration script.
651
+ */
652
+ migrationScript: string | null;
653
+ /**
654
+ * The file extension for generated migration files.
655
+ */
656
+ extension: string;
657
+ }
658
+
659
+ /**
660
+ * Request for debug panic.
661
+ */
662
+ export interface DebugPanicInput {}
663
+
664
+ /**
665
+ * The output of the `reset` command.
666
+ */
667
+ export interface ResetOutput {}
668
+
669
+ /**
670
+ * The path to a live database taken as input. For flexibility, this can be Prisma schemas as strings, or only the
671
+ * connection string. See variants.
672
+ */
673
+ export type DatasourceParam = ({ tag: "Schema" } & SchemasContainer) | ({ tag: "ConnectionString" } & UrlContainer);
674
+
675
+ /**
676
+ * The output of the `evaluateDataLoss` command.
677
+ */
678
+ export interface EvaluateDataLossOutput {
679
+ /**
680
+ * The number migration steps that would be generated. If this is empty, we
681
+ * wouldn\'t generate a new migration, unless the `draft` option is
682
+ * passed.
683
+ */
684
+ migrationSteps: number;
685
+ /**
686
+ * Steps that cannot be executed on the local database in the
687
+ * migration that would be generated.
688
+ */
689
+ unexecutableSteps: MigrationFeedback[];
690
+ /**
691
+ * Destructive change warnings for the local database. These are the
692
+ * warnings *for the migration that would be generated*. This does not
693
+ * include other potentially yet unapplied migrations.
694
+ */
695
+ warnings: MigrationFeedback[];
696
+ }
697
+
698
+ /**
699
+ * An object with a `url` field.
700
+ * @deprecated
701
+ */
702
+ export interface UrlContainer {
703
+ /**
704
+ * The URL string.
705
+ */
706
+ url: string;
707
+ }
708
+
709
+ /**
710
+ * Fields for the DatabaseIsBehind variant.
711
+ */
712
+ export interface DatabaseIsBehindFields {}
713
+
714
+ /**
715
+ * The location of the live database to connect to.
716
+ */
717
+ export type DbExecuteDatasourceType = ({ tag: "schema" } & SchemasWithConfigDir) | ({ tag: "url" } & UrlContainer);
718
+
719
+ /**
720
+ * A diagnostic returned by `diagnoseMigrationHistory` when looking at the
721
+ * database migration history in relation to the migrations directory.
722
+ */
723
+ export type HistoryDiagnostic = { diagnostic: "databaseIsBehind"; unappliedMigrationNames: string[] } | { diagnostic: "migrationsDirectoryIsBehind"; unpersistedMigrationNames: string[] } | { diagnostic: "historiesDiverge"; lastCommonMigrationName: string | null; unpersistedMigrationNames: string[]; unappliedMigrationNames: string[] };
724
+
725
+ /**
726
+ * Request params for the `schemaPush` method.
727
+ */
728
+ export interface SchemaPushInput {
729
+ /**
730
+ * Push the schema ignoring destructive change warnings.
731
+ */
732
+ force: boolean;
733
+ /**
734
+ * The Prisma schema files.
735
+ */
736
+ schema: SchemasContainer;
737
+ /**
738
+ * The schema filter to use during the push.
739
+ */
740
+ filters: SchemaFilter;
741
+ }
742
+
743
+ /**
744
+ * Information about a migration lockfile.
745
+ */
746
+ export interface MigrationLockfile {
747
+ /**
748
+ * Relative path to the lockfile from base directory.
749
+ * E.g., `./migration_lock.toml`.
750
+ */
751
+ path: string;
752
+ /**
753
+ * Content of the lockfile, if it exists.
754
+ */
755
+ content: string | null;
756
+ }
757
+
758
+ /**
759
+ * Make sure the schema engine can connect to the database from the Prisma schema.
760
+ */
761
+ export interface EnsureConnectionValidityParams {
762
+ /**
763
+ * The datasource parameter.
764
+ */
765
+ datasource: DatasourceParam;
766
+ }
767
+
768
+ /**
769
+ * The output of the `markMigrationApplied` command.
770
+ */
771
+ export interface MarkMigrationAppliedOutput {}
772
+
773
+ /**
774
+ * The result type for the `diff` method.
775
+ */
776
+ export interface DiffResult {
777
+ /**
778
+ * The exit code that the CLI should return.
779
+ */
780
+ exitCode: number;
781
+ /**
782
+ * The diff script, if `script` was set to true in [`DiffParams`](DiffParams),
783
+ * or a human-readable migration summary otherwise.
784
+ * This is meant to be printed to the stdout by the caller.
785
+ * Note: in `schema-engine-cli`, this is None.
786
+ */
787
+ stdout: string | null;
788
+ }
789
+
790
+ export type JsResult<R, E> = { tag: "ok"; value: R } | { tag: "error"; value: E };
791
+
792
+ /**
793
+ * The main query engine used by JS
794
+ */
795
+ export class SchemaEngine {
796
+ private constructor();
797
+ free(): void;
798
+ [Symbol.dispose](): void;
799
+ /**
800
+ * Send a raw command to the database.
801
+ */
802
+ dbExecute(params: DbExecuteParams): Promise<void>;
803
+ /**
804
+ * Introspect the database schema.
805
+ */
806
+ introspect(params: IntrospectParams): Promise<IntrospectResult>;
807
+ /**
808
+ * Debugging method that only panics, for tests.
809
+ */
810
+ debugPanic(): void;
811
+ /**
812
+ * The command behind `prisma db push`.
813
+ */
814
+ schemaPush(input: SchemaPushInput): Promise<SchemaPushOutput>;
815
+ /**
816
+ * Tells the CLI what to do in `migrate dev`.
817
+ */
818
+ devDiagnostic(input: DevDiagnosticInput): Promise<DevDiagnosticOutput>;
819
+ /**
820
+ * Introspects a SQL query and returns types information.
821
+ * Note: this will fail on SQLite, as it requires Wasm-compatible sqlx implementation.
822
+ */
823
+ introspectSql(params: IntrospectSqlParams): Promise<IntrospectSqlResult>;
824
+ /**
825
+ * Apply all the unapplied migrations from the migrations folder.
826
+ */
827
+ applyMigrations(input: ApplyMigrationsInput): Promise<ApplyMigrationsOutput>;
828
+ /**
829
+ * Generate a new migration, based on the provided schema and existing migrations history.
830
+ */
831
+ createMigration(input: CreateMigrationInput): Promise<CreateMigrationOutput>;
832
+ /**
833
+ * Evaluate the consequences of running the next migration we would generate, given the current state of a Prisma schema.
834
+ */
835
+ evaluateDataLoss(input: EvaluateDataLossInput): Promise<EvaluateDataLossOutput>;
836
+ /**
837
+ * Mark a migration from the migrations folder as applied, without actually applying it.
838
+ */
839
+ markMigrationApplied(input: MarkMigrationAppliedInput): Promise<MarkMigrationAppliedOutput>;
840
+ /**
841
+ * Looks at the migrations folder and the database, and returns a bunch of useful information.
842
+ */
843
+ diagnoseMigrationHistory(input: DiagnoseMigrationHistoryInput): Promise<DiagnoseMigrationHistoryOutput>;
844
+ /**
845
+ * Make sure the connection to the database is established and valid.
846
+ * Connectors can choose to connect lazily, but this method should force
847
+ * them to connect.
848
+ */
849
+ ensureConnectionValidity(_params: EnsureConnectionValidityParams): Promise<EnsureConnectionValidityResult>;
850
+ /**
851
+ * Mark a migration as rolled back.
852
+ */
853
+ markMigrationRolledBack(input: MarkMigrationRolledBackInput): Promise<MarkMigrationRolledBackOutput>;
854
+ static new(options: ConstructorOptions, callback: Function, adapter: object): Promise<SchemaEngine>;
855
+ /**
856
+ * Create a migration between any two sources of database schemas.
857
+ */
858
+ diff(params: DiffParams): Promise<DiffResult>;
859
+ /**
860
+ * Reset a database to an empty state (no data, no schema).
861
+ */
862
+ reset(input: ResetInput): Promise<void>;
863
+ /**
864
+ * Return the database version as a string.
865
+ */
866
+ version(_params?: GetDatabaseVersionInput | null): Promise<string>;
867
+ }
868
+
869
+ export const __wbg_set_wasm: (val: any) => void;