Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ibdce07d2626c1a9541eeed26a17716b46a6a6964
19 lines
563 B
Rust
19 lines
563 B
Rust
#[cfg(feature = "sqlite")]
|
|
pub fn run_sqlite_migrations(
|
|
conn: &mut rusqlite::Connection,
|
|
) -> crate::error::Result<()> {
|
|
pinakes_migrations::sqlite_migrations()
|
|
.to_latest(conn)
|
|
.map_err(|e| crate::error::PinakesError::Migration(e.to_string()))
|
|
}
|
|
|
|
#[cfg(feature = "postgres")]
|
|
pub async fn run_postgres_migrations(
|
|
client: &mut tokio_postgres::Client,
|
|
) -> crate::error::Result<()> {
|
|
pinakes_migrations::postgres_runner()
|
|
.run_async(client)
|
|
.await
|
|
.map(|_| ())
|
|
.map_err(|e| crate::error::PinakesError::Migration(e.to_string()))
|
|
}
|