mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-02 01:25:27 +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
|
|
@ -5,8 +5,9 @@ use anyhow::Result;
|
|||
use database::Database;
|
||||
use gtk::glib::Uri;
|
||||
use memory::Memory;
|
||||
use sqlite::{Connection, Transaction};
|
||||
use std::{rc::Rc, sync::RwLock};
|
||||
use r2d2::Pool;
|
||||
use r2d2_sqlite::SqliteConnectionManager;
|
||||
use sqlite::Transaction;
|
||||
|
||||
pub struct Search {
|
||||
database: Database, // permanent storage
|
||||
|
|
@ -17,8 +18,8 @@ impl Search {
|
|||
// Constructors
|
||||
|
||||
/// Create new `Self`
|
||||
pub fn build(connection: &Rc<RwLock<Connection>>, profile_id: i64) -> Result<Self> {
|
||||
let database = Database::init(connection, profile_id)?;
|
||||
pub fn build(database_pool: &Pool<SqliteConnectionManager>, profile_id: i64) -> Result<Self> {
|
||||
let database = Database::init(database_pool, profile_id)?;
|
||||
// Init fast search index
|
||||
let memory = Memory::init();
|
||||
// Build initial index
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue