mirror of
https://github.com/mikedilger/chorus.git
synced 2026-04-03 06:41:16 +00:00
Store: add a general database
This commit is contained in:
parent
3a9f4a7e98
commit
4f41e4ad9a
@ -11,6 +11,7 @@ use std::ops::Bound;
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Store {
|
pub struct Store {
|
||||||
|
general: Database<UnalignedSlice<u8>, UnalignedSlice<u8>>,
|
||||||
events: EventStore,
|
events: EventStore,
|
||||||
env: Env,
|
env: Env,
|
||||||
ids: Database<UnalignedSlice<u8>, OwnedType<usize>>,
|
ids: Database<UnalignedSlice<u8>, OwnedType<usize>>,
|
||||||
@ -45,6 +46,10 @@ impl Store {
|
|||||||
|
|
||||||
// Open/Create maps
|
// Open/Create maps
|
||||||
let mut txn = env.write_txn()?;
|
let mut txn = env.write_txn()?;
|
||||||
|
let general = env
|
||||||
|
.database_options()
|
||||||
|
.types::<UnalignedSlice<u8>, UnalignedSlice<u8>>()
|
||||||
|
.create(&mut txn)?;
|
||||||
let ids = env
|
let ids = env
|
||||||
.database_options()
|
.database_options()
|
||||||
.types::<UnalignedSlice<u8>, OwnedType<usize>>()
|
.types::<UnalignedSlice<u8>, OwnedType<usize>>()
|
||||||
@ -90,6 +95,7 @@ impl Store {
|
|||||||
let events = EventStore::new(event_map_file)?;
|
let events = EventStore::new(event_map_file)?;
|
||||||
|
|
||||||
Ok(Store {
|
Ok(Store {
|
||||||
|
general,
|
||||||
events,
|
events,
|
||||||
env,
|
env,
|
||||||
ids,
|
ids,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user