Comparison

plugins/mod_storage_sql.lua @ 13222:cb6a17eaa0e6

mod_storage_sql: Use config enum for 'sqlite_tune'
author Kim Alvefur <zash@zash.se>
date Tue, 18 Jul 2023 11:53:12 +0200
parent 13221:2a9ce229efac
child 13223:b88b3e414550
comparison
equal deleted inserted replaced
13221:2a9ce229efac 13222:cb6a17eaa0e6
933 end 933 end
934 934
935 -- Note: These things can't be changed with in a transaction. LuaDBI 935 -- Note: These things can't be changed with in a transaction. LuaDBI
936 -- opens a transaction automatically for every statement(?), so this 936 -- opens a transaction automatically for every statement(?), so this
937 -- will not work there. 937 -- will not work there.
938 local tune = module:get_option_string("sqlite_tune", "default"); 938 local tune = module:get_option_enum("sqlite_tune", "default", "normal", "fast", "safe");
939 if tune == "normal" then 939 if tune == "normal" then
940 if journal_mode ~= "wal" then 940 if journal_mode ~= "wal" then
941 engine:execute("PRAGMA journal_mode=WAL;"); 941 engine:execute("PRAGMA journal_mode=WAL;");
942 end 942 end
943 engine:execute("PRAGMA auto_vacuum=FULL;"); 943 engine:execute("PRAGMA auto_vacuum=FULL;");