Autosync first edition
This commit is contained in:
@@ -55,3 +55,11 @@ fn make_card_stats(conn: &Connection) -> Result<(), rusqlite::Error> {
|
||||
conn.execute(query, ())?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn default_connection() -> Connection {
|
||||
let path = app_data_dir();
|
||||
let db_file = path.join("data.db");
|
||||
let connection = Connection::open(db_file).unwrap();
|
||||
connection.execute("PRAGMA foreign_keys = ON;", []).unwrap();
|
||||
connection
|
||||
}
|
||||
Reference in New Issue
Block a user