mithril_persistence/database/
mod.rspub mod cardano_transaction_migration;
mod db_version;
mod hydrator;
pub(crate) mod query;
pub mod record;
pub mod repository;
mod version_checker;
pub use db_version::*;
pub use hydrator::Hydrator;
pub use version_checker::{DatabaseVersionChecker, SqlMigration};
pub type DbVersion = i64;
#[cfg(test)]
pub(crate) mod test_helper {
use sqlite::ConnectionThreadSafe;
use mithril_common::StdResult;
use crate::sqlite::{ConnectionBuilder, ConnectionOptions};
pub fn cardano_tx_db_connection() -> StdResult<ConnectionThreadSafe> {
let connection = ConnectionBuilder::open_memory()
.with_options(&[ConnectionOptions::ForceDisableForeignKeys])
.with_migrations(crate::database::cardano_transaction_migration::get_migrations())
.build()?;
Ok(connection)
}
}