Trait schema_core::GenericApi
source · 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§
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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_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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn debug_panic<'life0, 'async_trait>(
&'life0 self
) -> 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,
Debugging method that only panics, for CLI tests.
sourcefn 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 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
.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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 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.
sourcefn 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_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.
sourcefn 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 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.
sourcefn reset<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = CoreResult<()>> + 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,
Reset a database to an empty state (no data, no schema).
sourcefn 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,
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
.