aboutsummaryrefslogtreecommitdiff
path: root/base/src/database.rs
diff options
context:
space:
mode:
Diffstat (limited to 'base/src/database.rs')
-rw-r--r--base/src/database.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/base/src/database.rs b/base/src/database.rs
index 2a57937..f6f21bd 100644
--- a/base/src/database.rs
+++ b/base/src/database.rs
@@ -9,6 +9,7 @@ use jellycommon::{
Node,
};
use log::info;
+use serde::{Deserialize, Serialize};
use std::{borrow::Borrow, ops::Deref, path::Path};
pub use redb::*;
@@ -32,6 +33,7 @@ impl DataAcid {
let r = Self { inner: db };
{
+ // this creates all tables such that read operations on them do not fail.
let txn = r.begin_write()?;
drop(txn.open_table(T_INVITE)?);
drop(txn.open_table(T_USER)?);
@@ -62,7 +64,7 @@ impl<'a, 'b, 'c, Key, Value, KeyRef> TableExt<Key, KeyRef, Value>
for TableDefinition<'a, Key, Ser<Value>>
where
Key: Borrow<<Key as RedbValue>::SelfType<'b>> + redb::RedbKey,
- Value: bincode::Encode + bincode::Decode + std::fmt::Debug,
+ Value: Encode + Decode + std::fmt::Debug + Serialize + for<'x> Deserialize<'x>,
KeyRef: Borrow<<Key as redb::RedbValue>::SelfType<'c>>,
{
fn get(self, db: &DataAcid, key: KeyRef) -> anyhow::Result<Option<Value>> {