simplify DB constructor

Signed-off-by: Lee Smet <lee.smet@hotmail.com>
This commit is contained in:
Lee Smet
2025-04-25 14:15:52 +02:00
parent b8e1449ddb
commit d8b40b6995
5 changed files with 21 additions and 455 deletions

View File

@@ -4,16 +4,8 @@ use heromodels::models::{Comment, User};
use heromodels_core::Model;
fn main() {
let index_db = tst::TST::new("/tmp/ourdb/tst", true).expect("can create index DB");
let data_db = ourdb::OurDB::new(ourdb::OurDBConfig {
incremental_mode: false,
path: "/tmp/ourdb/ourdb".into(),
file_size: None,
keysize: None,
reset: Some(true),
})
.expect("can create data DB");
let db = heromodels::db::hero::OurDB::new(index_db, data_db);
// Create a new DB instance in /tmp/ourdb, and reset before every run
let db = heromodels::db::hero::OurDB::new("/tmp/ourdb", true).expect("Can create DB");
println!("Hero Models - Basic Usage Example");
println!("================================");