INNER CODE UNIT · Rust
open_at
aannoo/hcom · src/db/mod.rs:202
pub fn open_at(db_path: &std::path::Path) -> Result<Self> {
let mut db = Self::open_raw(db_path)?;
db.ensure_schema()?;
Ok(db)
}
/// Open DB connection without schema checks (for testing only).
pub fn open_raw(db_path: &std::path::Path) -> Result<Self> {
#[cfg(test)]
assert_isolated_db_path(db_path);
let conn = Self::open_connection(db_path)?;
let inode = get_inode(db_path);
Ok(Self {
conn,
db_path: db_path.to_path_buf(),
db_inode: inode,