mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 17:45:28 +00:00
reorganize clone semantics, implement recently closed tabs history
This commit is contained in:
parent
3682b5bf3f
commit
ba68019614
17 changed files with 176 additions and 52 deletions
|
|
@ -1,18 +1,24 @@
|
|||
mod database;
|
||||
// mod database;
|
||||
mod memory;
|
||||
|
||||
use sqlite::Transaction;
|
||||
use memory::Memory;
|
||||
|
||||
// Tools
|
||||
use sqlite::Connection;
|
||||
use std::{rc::Rc, sync::RwLock};
|
||||
|
||||
pub fn migrate(tx: &Transaction) -> Result<(), String> {
|
||||
// Migrate self components
|
||||
if let Err(e) = database::init(tx) {
|
||||
return Err(e.to_string());
|
||||
}
|
||||
|
||||
// Delegate migration to childs
|
||||
// nothing yet..
|
||||
|
||||
// Success
|
||||
Ok(())
|
||||
pub struct History {
|
||||
pub memory: Rc<Memory>, // fast search index
|
||||
}
|
||||
|
||||
impl History {
|
||||
// Constructors
|
||||
|
||||
/// Create new `Self`
|
||||
pub fn build(_connection: &Rc<RwLock<Connection>>, _profile_id: &Rc<i64>) -> Self {
|
||||
// Init children components
|
||||
let memory = Rc::new(Memory::new());
|
||||
|
||||
// Return new `Self`
|
||||
Self { memory }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue