use crate::db::sqlite::{SqliteBootstrapSettings, SqlitePoolSettings};
#[must_use]
pub fn in_memory_settings() -> SqliteBootstrapSettings {
SqliteBootstrapSettings::new("sqlite::memory:")
.with_pool(SqlitePoolSettings::default().with_max_connections(1))
}
#[cfg(test)]
mod tests {
#[test]
fn in_memory_defaults_are_isolated_and_connectable() {
let config = super::in_memory_settings()
.build()
.expect("test settings should be valid");
assert_eq!(config.connection_config().database_url(), "sqlite::memory:");
assert_eq!(config.pool_config().max_connections(), 1);
assert!(!config.migrate_on_startup());
}
}