diff --git a/storage_engine/src/index.rs b/storage_engine/src/index.rs index b7e48ab..dde57d3 100644 --- a/storage_engine/src/index.rs +++ b/storage_engine/src/index.rs @@ -31,38 +31,38 @@ pub struct Index { pub struct IndexHeader { } -impl Index { - pub async fn new(file_name: &str) -> Result> { +impl Index { + pub async fn new(file_name: &str) -> Result> { todo!() } - pub async fn connect(file_name: &str) -> Result> { + pub async fn connect(file_name: &str) -> Result> { todo!() } // Saves the in-memory index to disk and deallocates. - pub async fn sleep() -> Result> { + pub async fn sleep() -> Result> { todo!() } // Loads the index into memory - pub async fn wake() -> Result> { + pub async fn wake() -> Result> { todo!() } pub async fn insert() -> Result<()> - where I: Encode, V: Encode + where K: Encode, V: Encode { todo!() } - pub async fn lookup(&mut self, k: I) -> Result> - where I: Encode + Decode, + pub async fn lookup(&mut self, k: K) -> Result> + where K: Encode + Decode, { todo!() } - pub async fn delete(&mut self, k: I) -> Result> { + pub async fn delete(&mut self, k: K) -> Result> { todo!() } } diff --git a/storage_engine/src/storage_engine.rs b/storage_engine/src/storage_engine.rs index 113982a..6075476 100644 --- a/storage_engine/src/storage_engine.rs +++ b/storage_engine/src/storage_engine.rs @@ -22,6 +22,8 @@ pub type FilePosition = u64; pub struct Store { table_folder: String, file: File, + // primary_index: Vec>>, + // indexes: Vec>>>, header: StoreHeader, data_type: PhantomData, @@ -189,6 +191,8 @@ impl Store { }; let encoded_header: Vec = header.encode()?; + // Index::new(format!("rows", primary_column.to_string())) + let mut store = Self { table_folder: table_folder.to_string(), file,