Autosync first edition
This commit is contained in:
1 parent
ccac3e5a03
commit
a21fd5e69b
6 files changed
+218
-111
No files matched your search
@@ -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