pub trait GenericApi: Send + Sync + 'static {
Show 18 methods // Required methods fn version<'life0, 'async_trait>( &'life0 self, params: Option<GetDatabaseVersionInput> ) -> Pin<Box<dyn Future<Output = CoreResult<String>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn apply_migrations<'life0, 'async_trait>( &'life0 self, input: ApplyMigrationsInput ) -> Pin<Box<dyn Future<Output = CoreResult<ApplyMigrationsOutput>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn create_database<'life0, 'async_trait>( &'life0 self, params: CreateDatabaseParams ) -> Pin<Box<dyn Future<Output = CoreResult<CreateDatabaseResult>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn create_migration<'life0, 'async_trait>( &'life0 self, input: CreateMigrationInput ) -> Pin<Box<dyn Future<Output = CoreResult<CreateMigrationOutput>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn db_execute<'life0, 'async_trait>( &'life0 self, params: DbExecuteParams ) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn debug_panic<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn dev_diagnostic<'life0, 'async_trait>( &'life0 self, input: DevDiagnosticInput ) -> Pin<Box<dyn Future<Output = CoreResult<DevDiagnosticOutput>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn diff<'life0, 'async_trait>( &'life0 self, params: DiffParams ) -> Pin<Box<dyn Future<Output = CoreResult<DiffResult>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn drop_database<'life0, 'async_trait>( &'life0 self, url: String ) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn diagnose_migration_history<'life0, 'async_trait>( &'life0 self, input: DiagnoseMigrationHistoryInput ) -> Pin<Box<dyn Future<Output = CoreResult<DiagnoseMigrationHistoryOutput>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn ensure_connection_validity<'life0, 'async_trait>( &'life0 self, params: EnsureConnectionValidityParams ) -> Pin<Box<dyn Future<Output = CoreResult<EnsureConnectionValidityResult>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn evaluate_data_loss<'life0, 'async_trait>( &'life0 self, input: EvaluateDataLossInput ) -> Pin<Box<dyn Future<Output = CoreResult<EvaluateDataLossOutput>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn introspect<'life0, 'async_trait>( &'life0 self, input: IntrospectParams ) -> Pin<Box<dyn Future<Output = CoreResult<IntrospectResult>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn list_migration_directories<'life0, 'async_trait>( &'life0 self, input: ListMigrationDirectoriesInput ) -> Pin<Box<dyn Future<Output = CoreResult<ListMigrationDirectoriesOutput>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn mark_migration_applied<'life0, 'async_trait>( &'life0 self, input: MarkMigrationAppliedInput ) -> Pin<Box<dyn Future<Output = CoreResult<MarkMigrationAppliedOutput>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn mark_migration_rolled_back<'life0, 'async_trait>( &'life0 self, input: MarkMigrationRolledBackInput ) -> Pin<Box<dyn Future<Output = CoreResult<MarkMigrationRolledBackOutput>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn reset<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn schema_push<'life0, 'async_trait>( &'life0 self, input: SchemaPushInput ) -> Pin<Box<dyn Future<Output = CoreResult<SchemaPushOutput>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait;
}
Expand description

The programmatic, generic, fantastic schema engine API.

Required Methods§

source

fn version<'life0, 'async_trait>( &'life0 self, params: Option<GetDatabaseVersionInput> ) -> Pin<Box<dyn Future<Output = CoreResult<String>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Return the database version as a string.

source

fn apply_migrations<'life0, 'async_trait>( &'life0 self, input: ApplyMigrationsInput ) -> Pin<Box<dyn Future<Output = CoreResult<ApplyMigrationsOutput>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Apply all the unapplied migrations from the migrations folder.

source

fn create_database<'life0, 'async_trait>( &'life0 self, params: CreateDatabaseParams ) -> Pin<Box<dyn Future<Output = CoreResult<CreateDatabaseResult>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Create the database referenced by Prisma schema that was used to initialize the connector.

source

fn create_migration<'life0, 'async_trait>( &'life0 self, input: CreateMigrationInput ) -> Pin<Box<dyn Future<Output = CoreResult<CreateMigrationOutput>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Generate a new migration, based on the provided schema and existing migrations history.

source

fn db_execute<'life0, 'async_trait>( &'life0 self, params: DbExecuteParams ) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Send a raw command to the database.

source

fn debug_panic<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Debugging method that only panics, for CLI tests.

source

fn dev_diagnostic<'life0, 'async_trait>( &'life0 self, input: DevDiagnosticInput ) -> Pin<Box<dyn Future<Output = CoreResult<DevDiagnosticOutput>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Tells the CLI what to do in migrate dev.

source

fn diff<'life0, 'async_trait>( &'life0 self, params: DiffParams ) -> Pin<Box<dyn Future<Output = CoreResult<DiffResult>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Create a migration between any two sources of database schemas.

source

fn drop_database<'life0, 'async_trait>( &'life0 self, url: String ) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Drop the database referenced by Prisma schema that was used to initialize the connector.

source

fn diagnose_migration_history<'life0, 'async_trait>( &'life0 self, input: DiagnoseMigrationHistoryInput ) -> Pin<Box<dyn Future<Output = CoreResult<DiagnoseMigrationHistoryOutput>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Looks at the migrations folder and the database, and returns a bunch of useful information.

source

fn ensure_connection_validity<'life0, 'async_trait>( &'life0 self, params: EnsureConnectionValidityParams ) -> Pin<Box<dyn Future<Output = CoreResult<EnsureConnectionValidityResult>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Make sure the connection to the database is established and valid. Connectors can choose to connect lazily, but this method should force them to connect.

source

fn evaluate_data_loss<'life0, 'async_trait>( &'life0 self, input: EvaluateDataLossInput ) -> Pin<Box<dyn Future<Output = CoreResult<EvaluateDataLossOutput>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Evaluate the consequences of running the next migration we would generate, given the current state of a Prisma schema.

source

fn introspect<'life0, 'async_trait>( &'life0 self, input: IntrospectParams ) -> Pin<Box<dyn Future<Output = CoreResult<IntrospectResult>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Introspect the database schema.

source

fn list_migration_directories<'life0, 'async_trait>( &'life0 self, input: ListMigrationDirectoriesInput ) -> Pin<Box<dyn Future<Output = CoreResult<ListMigrationDirectoriesOutput>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

List the migration directories.

source

fn mark_migration_applied<'life0, 'async_trait>( &'life0 self, input: MarkMigrationAppliedInput ) -> Pin<Box<dyn Future<Output = CoreResult<MarkMigrationAppliedOutput>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Mark a migration from the migrations folder as applied, without actually applying it.

source

fn mark_migration_rolled_back<'life0, 'async_trait>( &'life0 self, input: MarkMigrationRolledBackInput ) -> Pin<Box<dyn Future<Output = CoreResult<MarkMigrationRolledBackOutput>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Mark a migration as rolled back.

source

fn reset<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = CoreResult<()>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Reset a database to an empty state (no data, no schema).

source

fn schema_push<'life0, 'async_trait>( &'life0 self, input: SchemaPushInput ) -> Pin<Box<dyn Future<Output = CoreResult<SchemaPushOutput>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

The command behind prisma db push.

Implementors§