mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 00:55:28 +00:00
implement sqlite transactions
This commit is contained in:
parent
d5101a6465
commit
271acd50ed
8 changed files with 213 additions and 119 deletions
|
|
@ -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}"),
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue