MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / temp_db

Function temp_db

nodedb-cluster/src/metadata_group/migration_state.rs:332–345  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

330 use super::*;
331
332 fn temp_db() -> Arc<redb::Database> {
333 let dir = tempfile::tempdir().unwrap();
334 let path = dir.path().join("test.redb");
335 let db = redb::Database::create(&path).unwrap();
336 // Create the table.
337 let txn = db.begin_write().unwrap();
338 {
339 let _ = txn.open_table(MigrationStateTable::TABLE).unwrap();
340 }
341 txn.commit().unwrap();
342 // Box keeps the TempDir alive — we leak it intentionally for tests.
343 std::mem::forget(dir);
344 Arc::new(db)
345 }
346
347 fn make_row(
348 id: MigrationId,

Callers 3

remove_deletes_from_redbFunction · 0.70

Calls 5

joinMethod · 0.80
begin_writeMethod · 0.80
createFunction · 0.50
pathMethod · 0.45
commitMethod · 0.45

Tested by 3

remove_deletes_from_redbFunction · 0.56