Formatting

This commit is contained in:
micialware committed 2026-08-25 12:04:07 +03:00
1 parent dddac01bdf
commit 10cf7f0d2e
29 files changed
+138 -138

No files matched your search

+7 -3
View File
@@ -1,12 +1,14 @@
use rusqlite::Connection;
use crate::fs::*;
use rusqlite::Connection;
pub fn create_db() {
let db_file = db_path();
if !db_file.exists() {
std::fs::File::create(&db_file).expect("Database file creation failed");
let connection = Connection::open(&db_file).expect("Connection open failed");
connection.execute("PRAGMA foreign_keys = ON;", []).expect("Failed to set PRAGMA");
connection
.execute("PRAGMA foreign_keys = ON;", [])
.expect("Failed to set PRAGMA");
create_tables(&connection);
}
@@ -52,6 +54,8 @@ fn make_card_stats(conn: &Connection) -> Result<(), rusqlite::Error> {
pub fn default_connection() -> Connection {
let db_file = db_path();
let connection = Connection::open(db_file).expect("Failed to open database");
connection.execute("PRAGMA foreign_keys = ON;", []).expect("Failed to set PRAGMA");
connection
.execute("PRAGMA foreign_keys = ON;", [])
.expect("Failed to set PRAGMA");
connection
}