pub fn migrator() -> Migrator
Expand description
Get the migrator for running outlet-postgres database migrations.
This returns a SQLx migrator that can be used to set up the required
http_requests
and http_responses
tables. The consuming application
is responsible for running these migrations at the appropriate time
and in the appropriate database schema.
ยงExamples
use outlet_postgres::migrator;
use sqlx::PgPool;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let pool = PgPool::connect("postgresql://user:pass@localhost/db").await?;
// Run outlet migrations
migrator().run(&pool).await?;
Ok(())
}