mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 17:15:28 +00:00
use r2d2 pool, update rusqlite version
This commit is contained in:
parent
c3f63dfbdc
commit
33369e31ea
17 changed files with 171 additions and 197 deletions
|
|
@ -7,11 +7,10 @@ use database::Database;
|
|||
use gtk::glib::DateTime;
|
||||
use item::Item;
|
||||
use memory::Memory;
|
||||
use sqlite::{Connection, Transaction};
|
||||
use std::{
|
||||
rc::Rc,
|
||||
sync::{Arc, RwLock},
|
||||
};
|
||||
use r2d2::Pool;
|
||||
use r2d2_sqlite::SqliteConnectionManager;
|
||||
use sqlite::Transaction;
|
||||
use std::sync::{Arc, RwLock};
|
||||
|
||||
pub struct Bookmark {
|
||||
database: Database, // permanent storage
|
||||
|
|
@ -22,9 +21,9 @@ impl Bookmark {
|
|||
// Constructors
|
||||
|
||||
/// Create new `Self`
|
||||
pub fn build(connection: &Rc<RwLock<Connection>>, profile_id: i64) -> Result<Self> {
|
||||
pub fn build(database_pool: &Pool<SqliteConnectionManager>, profile_id: i64) -> Result<Self> {
|
||||
// Init children components
|
||||
let database = Database::new(connection, profile_id);
|
||||
let database = Database::new(database_pool, profile_id);
|
||||
let memory = Arc::new(RwLock::new(Memory::new()));
|
||||
|
||||
// Build initial index
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue