Expand description
database migration with async support
§Supported database
- PostgreSQL
§License
Apache License 2.0
§Example
use asyncmigrate::{MigrationError, Migration};
use rust_embed::RustEmbed;
#[derive(RustEmbed)]
#[folder = "schema/"]
struct Assets;
let mut connection = asyncmigrate::connect(
"postgres://dbmigration-test:dbmigration-test@127.0.0.1:5432/dbmigration-test",
)
.await?;
let changeset = asyncmigrate::MigrationChangeSets::load_asset("default", Assets)?;
// Run migration
connection.migrate(&changeset, None).await?;
// Rollback
connection.rollback("default", None).await?;
Modules§
Structs§
- Change
Set - a change set with upgrade SQL and downgrade SQL
- Change
SetVersion Name - A change set version and a name
- Migration
Change Sets - change sets for migration
Enums§
- Connection
- Connection.
- Migration
Error
Traits§
Functions§
- connect
- Connect to a database with database URL