Use SQLITE write-ahead logging
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Alex Mikhalev 2020-10-01 14:24:37 -06:00
parent 89d7b01a76
commit 0e45ab5aa9
2 changed files with 12 additions and 2 deletions

11
.gitignore vendored
View File

@ -1,4 +1,11 @@
# Cargo/Rust
/target
/.vscode
Cargo.lock
# Visual studio code
.vscode
# Sqlite databases
/*.db
Cargo.lock
*.db-shm
*.db-wal

View File

@ -17,6 +17,9 @@ pub fn setup_db() -> Result<DbConn> {
// let conn = DbConn::open_in_memory()?;
let mut conn = DbConn::open("test.db")?;
// Go ahead and use write ahead log for better perf
conn.execute_batch("PRAGMA journal_mode=WAL;")?;
let migs = create_migrations();
migs.apply(&mut conn)?;