Struct schemer_postgres::PostgresAdapter
[−]
[src]
pub struct PostgresAdapter<'a> { /* fields omitted */ }
Adapter between schemer and PostgreSQL.
Methods
impl<'a> PostgresAdapter<'a>
[src]
fn new(conn: &'a Connection, table_name: Option<String>) -> PostgresAdapter<'a>
[src]
Construct a PostgreSQL schemer adapter.
table_name
specifies the name of the table that schemer will use
for storing metadata about applied migrations. If None
, a default
will be used.
let conn = postgres::Connection::connect( "postgresql://postgres@localhost/?search_path=pg_temp", postgres::TlsMode::None).unwrap(); let adapter = schemer_postgres::PostgresAdapter::new(&conn, None);
fn init(&self) -> Result<(), PostgresError>
[src]
Initialize the schemer metadata schema. This must be called before
using Migrator
with this adapter. This is safe to call multiple times.
Trait Implementations
impl<'a> Adapter for PostgresAdapter<'a>
[src]
type MigrationType = PostgresMigration
Type migrations must implement for this adapter.
type Error = PostgresAdapterError
Type of errors returned by this adapter.
fn applied_migrations(&self) -> Result<HashSet<Uuid>, Self::Error>
[src]
Returns the set of IDs for migrations that have been applied.
fn apply_migration(
&mut self,
migration: &Self::MigrationType
) -> Result<(), Self::Error>
[src]
&mut self,
migration: &Self::MigrationType
) -> Result<(), Self::Error>
Apply a single migration.
fn revert_migration(
&mut self,
migration: &Self::MigrationType
) -> Result<(), Self::Error>
[src]
&mut self,
migration: &Self::MigrationType
) -> Result<(), Self::Error>
Revert a single migration.