diff --git a/.env.template b/.env.template index 68c487f4..5ff34db7 100644 --- a/.env.template +++ b/.env.template @@ -34,7 +34,7 @@ ## For example, this can be used to run connection-scoped pragma statements. ## ## Statements to run when creating a new SQLite connection -# SQLITE_CONN_INIT="" +# SQLITE_CONN_INIT="PRAGMA busy_timeout = 5000; PRAGMA synchronous = NORMAL;" ## Statements to run when creating a new MySQL connection # MYSQL_CONN_INIT="" ## Statements to run when creating a new PostgreSQL connection diff --git a/src/config.rs b/src/config.rs index cd6dc138..eaabdf6b 100644 --- a/src/config.rs +++ b/src/config.rs @@ -521,7 +521,7 @@ make_config! { database_max_conns: u32, false, def, 10; /// SQLite connection init |> Statements to run when creating a new SQLite connection - sqlite_conn_init: String, false, def, "".to_string(); + sqlite_conn_init: String, false, def, "PRAGMA busy_timeout = 5000; PRAGMA synchronous = NORMAL;".to_string(); /// MySQL connection init |> Statements to run when creating a new MySQL connection mysql_conn_init: String, false, def, "".to_string();