pinakes/crates/pinakes-core/src/storage/migrations.rs
NotAShelf 011e8edb28
pinakes-core: remove extracted modules; trim to storage/scan/scheduler domain
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ibdce07d2626c1a9541eeed26a17716b46a6a6964
2026-05-24 14:25:55 +03:00

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()))
}