postgres
This commit is contained in:
parent
584ffb6b11
commit
1faa3b9668
19 changed files with 1058 additions and 1244 deletions
|
@ -1,10 +1,9 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use mongod::Model;
|
||||
|
||||
use crate::item::Item;
|
||||
|
||||
/// Item database
|
||||
#[derive(Debug)]
|
||||
pub struct ItemDB {
|
||||
index: HashMap<String, Item>,
|
||||
}
|
||||
|
@ -20,9 +19,7 @@ impl ItemDB {
|
|||
|
||||
for item in &index.documents {
|
||||
let item = Item::new(item);
|
||||
item.insert_overwrite().await.unwrap();
|
||||
log::info!("Adding item {} to DB", item.name);
|
||||
items.insert(item._id.clone(), item);
|
||||
items.insert(item.id.clone(), item);
|
||||
}
|
||||
|
||||
Self { index: items }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue