implement sqlite transactions

This commit is contained in:
yggverse 2024-10-06 00:43:35 +03:00
parent d5101a6465
commit 271acd50ed
8 changed files with 213 additions and 119 deletions

View file

@ -3,7 +3,10 @@ mod app;
use app::App;
use gtk::glib::{user_config_dir, ExitCode};
use sqlite::Connection;
use std::{fs::create_dir_all, sync::Arc};
use std::{
fs::create_dir_all,
sync::{Arc, RwLock},
};
const VENDOR: &str = "YGGverse";
const APP_ID: &str = "Yoda"; // env!("CARGO_PKG_NAME");
@ -28,7 +31,7 @@ fn main() -> ExitCode {
// Init database connection
let profile_database_connection = match Connection::open(profile_database_path) {
Ok(connection) => Arc::new(connection),
Ok(connection) => Arc::new(RwLock::new(connection)),
Err(error) => panic!("Failed to connect profile database: {error}"),
};