tern_core::migration

Trait QueryBuilder

Source
pub trait QueryBuilder {
    type Ctx: MigrationContext;

    // Required method
    fn build(
        &self,
        ctx: &mut Self::Ctx,
    ) -> impl Future<Output = TernResult<Query>> + Send;
}
Expand description

A helper trait for Migration.

With the derive macros, the user’s responsibility is to implement this for a Rust migration, and the proc macro uses it to build an implementation of Migration.

Required Associated Types§

Source

type Ctx: MigrationContext

The context for running a migration this query is built for.

It should have all the abilities described in MigrationContext but in addition can expose other behavior that is needed for a specific query.

Required Methods§

Source

fn build( &self, ctx: &mut Self::Ctx, ) -> impl Future<Output = TernResult<Query>> + Send

Asyncronously produce the migration query.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§