Merge branch 'master' into new-schema

This commit is contained in:
Scott Lamb
2019-07-10 01:11:25 -07:00
2 changed files with 8 additions and 0 deletions

View File

@@ -101,6 +101,10 @@ pub fn run(args: &Args, conn: &mut rusqlite::Connection) -> Result<(), Error> {
// be careful about the order of operations during the upgrade.
conn.execute("pragma foreign_keys = on", &[] as &[&dyn ToSql])?;
// Make the database actually durable.
conn.execute("pragma fullfsync = on", &[] as &[&dyn ToSql])?;
conn.execute("pragma synchronous = 2", &[] as &[&dyn ToSql])?;
// WAL is the preferred journal mode for normal operation; it reduces the number of syncs
// without compromising safety.
set_journal_mode(&conn, "wal").unwrap();