...
This commit is contained in:
11
Cargo.lock
generated
11
Cargo.lock
generated
@@ -197,6 +197,15 @@ version = "0.9.1"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445"
|
checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "bincode"
|
||||||
|
version = "1.3.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad"
|
||||||
|
dependencies = [
|
||||||
|
"serde",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "bitflags"
|
name = "bitflags"
|
||||||
version = "2.9.2"
|
version = "2.9.2"
|
||||||
@@ -965,11 +974,13 @@ dependencies = [
|
|||||||
name = "libdbstorage"
|
name = "libdbstorage"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"bincode",
|
||||||
"libcrypto",
|
"libcrypto",
|
||||||
"redb",
|
"redb",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"thiserror",
|
"thiserror",
|
||||||
|
"tokio",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@@ -10,4 +10,6 @@ serde_json = { workspace = true }
|
|||||||
thiserror = { workspace = true }
|
thiserror = { workspace = true }
|
||||||
|
|
||||||
# Local Crate Dependencies
|
# Local Crate Dependencies
|
||||||
libcrypto = { path = "../libcrypto" }
|
libcrypto = { path = "../libcrypto" }
|
||||||
|
tokio = { version = "1", features = ["full"] }
|
||||||
|
bincode = "1.3.3"
|
@@ -8,13 +8,11 @@ use libcrypto::CryptoFactory; // Correct import
|
|||||||
use redb::{Database, TableDefinition};
|
use redb::{Database, TableDefinition};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
pub use crate::error::DBError; // Re-export for users of this crate
|
pub mod error; // Declare the error module
|
||||||
|
pub use error::DBError; // Re-export for users of this crate
|
||||||
|
|
||||||
// Declare modules
|
// Declare storage module
|
||||||
pub mod storage_basic;
|
pub mod storage;
|
||||||
pub mod storage_hset;
|
|
||||||
pub mod storage_lists;
|
|
||||||
pub mod storage_extra;
|
|
||||||
|
|
||||||
// Table definitions for different Redis data types
|
// Table definitions for different Redis data types
|
||||||
const TYPES_TABLE: TableDefinition<&str, &str> = TableDefinition::new("types");
|
const TYPES_TABLE: TableDefinition<&str, &str> = TableDefinition::new("types");
|
||||||
|
4
crates/libdbstorage/src/storage/mod.rs
Normal file
4
crates/libdbstorage/src/storage/mod.rs
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
pub mod storage_basic;
|
||||||
|
pub mod storage_hset;
|
||||||
|
pub mod storage_lists;
|
||||||
|
pub mod storage_extra;
|
@@ -1,6 +1,6 @@
|
|||||||
use redb::{ReadableTable};
|
use redb::{ReadableTable};
|
||||||
use crate::error::DBError;
|
use crate::error::DBError;
|
||||||
use super::*;
|
use crate::{Storage, TYPES_TABLE, STRINGS_TABLE, HASHES_TABLE, LISTS_TABLE, STREAMS_META_TABLE, STREAMS_DATA_TABLE, EXPIRATION_TABLE, now_in_millis};
|
||||||
|
|
||||||
impl Storage {
|
impl Storage {
|
||||||
pub fn flushdb(&self) -> Result<(), DBError> {
|
pub fn flushdb(&self) -> Result<(), DBError> {
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
use redb::{ReadableTable};
|
use redb::{ReadableTable};
|
||||||
use crate::error::DBError;
|
use crate::error::DBError;
|
||||||
use super::*;
|
use crate::{Storage, TYPES_TABLE, STRINGS_TABLE, EXPIRATION_TABLE, now_in_millis};
|
||||||
|
|
||||||
impl Storage {
|
impl Storage {
|
||||||
// ✅ ENCRYPTION APPLIED: Values are decrypted after retrieval
|
// ✅ ENCRYPTION APPLIED: Values are decrypted after retrieval
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
use redb::{ReadableTable};
|
use redb::{ReadableTable};
|
||||||
use crate::error::DBError;
|
use crate::error::DBError;
|
||||||
use super::*;
|
use crate::{Storage, TYPES_TABLE, HASHES_TABLE};
|
||||||
|
|
||||||
impl Storage {
|
impl Storage {
|
||||||
// ✅ ENCRYPTION APPLIED: Values are encrypted before storage
|
// ✅ ENCRYPTION APPLIED: Values are encrypted before storage
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
use redb::{ReadableTable};
|
use redb::{ReadableTable};
|
||||||
use crate::error::DBError;
|
use crate::error::DBError;
|
||||||
use super::*;
|
use crate::{Storage, TYPES_TABLE, LISTS_TABLE};
|
||||||
|
|
||||||
impl Storage {
|
impl Storage {
|
||||||
// ✅ ENCRYPTION APPLIED: Elements are encrypted before storage
|
// ✅ ENCRYPTION APPLIED: Elements are encrypted before storage
|
||||||
|
Reference in New Issue
Block a user