Splitting kana set
This commit is contained in:
1 parent
36e5693564
commit
c74a0eb311
25 files changed
+389
-354
No files matched your search
@@ -1,9 +1,8 @@
|
||||
use crate::dictionary::app_data_dir;
|
||||
use rusqlite::Connection;
|
||||
use crate::fs::*;
|
||||
|
||||
pub fn create_db() {
|
||||
let path = app_data_dir();
|
||||
let db_file = path.join("data.db");
|
||||
let db_file = db_path();
|
||||
if !db_file.exists() {
|
||||
std::fs::File::create(&db_file).unwrap();
|
||||
let connection = Connection::open(&db_file).unwrap();
|
||||
@@ -51,8 +50,7 @@ fn make_card_stats(conn: &Connection) -> Result<(), rusqlite::Error> {
|
||||
}
|
||||
|
||||
pub fn default_connection() -> Connection {
|
||||
let path = app_data_dir();
|
||||
let db_file = path.join("data.db");
|
||||
let db_file = db_path();
|
||||
let connection = Connection::open(db_file).unwrap();
|
||||
connection.execute("PRAGMA foreign_keys = ON;", []).unwrap();
|
||||
connection
|
||||
|
||||
Reference in new issue
Block a user