aboutsummaryrefslogtreecommitdiff
path: root/base/src/database.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-29 16:07:58 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-29 16:07:58 +0100
commite7ba3274e27fad755f15465581f5b403c82ab4d2 (patch)
treef2d693c61786ee6ed027636393fd75f086bd77e8 /base/src/database.rs
parent5ac3f397b4a28b7bf8b399e73ad0d29e3da45ab0 (diff)
downloadjellything-e7ba3274e27fad755f15465581f5b403c82ab4d2.tar
jellything-e7ba3274e27fad755f15465581f5b403c82ab4d2.tar.bz2
jellything-e7ba3274e27fad755f15465581f5b403c82ab4d2.tar.zst
prepare database refactor
Diffstat (limited to 'base/src/database.rs')
-rw-r--r--base/src/database.rs21
1 files changed, 9 insertions, 12 deletions
diff --git a/base/src/database.rs b/base/src/database.rs
index e57ea3e..a6bcdf7 100644
--- a/base/src/database.rs
+++ b/base/src/database.rs
@@ -7,7 +7,7 @@ use anyhow::Context;
use bincode::{Decode, Encode};
use jellycommon::{
user::{NodeUserData, User},
- ExtendedNode, Node,
+ Node,
};
use log::info;
use redb::{Database, TableDefinition};
@@ -33,11 +33,6 @@ pub const T_USER_NODE: TableDefinition<(&str, &str), Ser<NodeUserData>> =
TableDefinition::new("user_node");
pub const T_INVITE: TableDefinition<&str, Ser<()>> = TableDefinition::new("invite");
pub const T_NODE: TableDefinition<&str, Ser<Node>> = TableDefinition::new("node");
-pub const T_NODE_EXTENDED: TableDefinition<&str, Ser<ExtendedNode>> =
- TableDefinition::new("node-ext");
-#[allow(clippy::type_complexity)]
-pub const T_NODE_IMPORT: TableDefinition<&str, Ser<Vec<(Vec<usize>, Node)>>> =
- TableDefinition::new("node-import");
#[derive(Clone)]
pub struct DataAcid {
@@ -64,8 +59,6 @@ impl DataAcid {
drop(txn.open_table(T_USER)?);
drop(txn.open_table(T_USER_NODE)?);
drop(txn.open_table(T_NODE)?);
- drop(txn.open_table(T_NODE_IMPORT)?);
- drop(txn.open_table(T_NODE_EXTENDED)?);
txn.commit()?;
}
@@ -205,10 +198,12 @@ where
pub struct Ser<T>(pub T);
#[cfg(not(feature = "db_json"))]
impl<T: Encode + Decode + std::fmt::Debug> redb::Value for Ser<T> {
- type SelfType<'a> = Ser<T>
+ type SelfType<'a>
+ = Ser<T>
where
Self: 'a;
- type AsBytes<'a> = Vec<u8>
+ type AsBytes<'a>
+ = Vec<u8>
where
Self: 'a;
@@ -243,10 +238,12 @@ impl<T: Encode + Decode + std::fmt::Debug> redb::Value for Ser<T> {
pub struct Ser<T>(pub T);
#[cfg(feature = "db_json")]
impl<T: Serialize + for<'a> Deserialize<'a> + std::fmt::Debug> redb::Value for Ser<T> {
- type SelfType<'a> = Ser<T>
+ type SelfType<'a>
+ = Ser<T>
where
Self: 'a;
- type AsBytes<'a> = Vec<u8>
+ type AsBytes<'a>
+ = Vec<u8>
where
Self: 'a;