summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIlya Mashchenko <ilya@netdata.cloud>2022-05-16 19:21:58 +0300
committerGitHub <noreply@github.com>2022-05-16 19:21:58 +0300
commit16ad34d8d2e9631665187d857ac45a2561e0df4c (patch)
tree998cde4670e38fcca3662a3a8dbd73b2c75d1809
parent9e85e48799e6eb656943addd58785443b33fb721 (diff)
chore: add links to SQLite init options in the src code (#12920)
-rw-r--r--database/sqlite/sqlite_functions.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/database/sqlite/sqlite_functions.c b/database/sqlite/sqlite_functions.c
index de5ee2dd4b..db266f08d6 100644
--- a/database/sqlite/sqlite_functions.c
+++ b/database/sqlite/sqlite_functions.c
@@ -396,26 +396,32 @@ int sql_init_database(db_check_action_type_t rebuild, int memory)
char buf[1024 + 1] = "";
const char *list[2] = { buf, NULL };
+ // https://www.sqlite.org/pragma.html#pragma_auto_vacuum
// PRAGMA schema.auto_vacuum = 0 | NONE | 1 | FULL | 2 | INCREMENTAL;
snprintfz(buf, 1024, "PRAGMA auto_vacuum=%s;", config_get(CONFIG_SECTION_SQLITE, "auto vacuum", "INCREMENTAL"));
if(init_database_batch(rebuild, 0, list)) return 1;
+ // https://www.sqlite.org/pragma.html#pragma_synchronous
// PRAGMA schema.synchronous = 0 | OFF | 1 | NORMAL | 2 | FULL | 3 | EXTRA;
snprintfz(buf, 1024, "PRAGMA synchronous=%s;", config_get(CONFIG_SECTION_SQLITE, "synchronous", "NORMAL"));
if(init_database_batch(rebuild, 0, list)) return 1;
+ // https://www.sqlite.org/pragma.html#pragma_journal_mode
// PRAGMA schema.journal_mode = DELETE | TRUNCATE | PERSIST | MEMORY | WAL | OFF
snprintfz(buf, 1024, "PRAGMA journal_mode=%s;", config_get(CONFIG_SECTION_SQLITE, "journal mode", "WAL"));
if(init_database_batch(rebuild, 0, list)) return 1;
+ // https://www.sqlite.org/pragma.html#pragma_temp_store
// PRAGMA temp_store = 0 | DEFAULT | 1 | FILE | 2 | MEMORY;
snprintfz(buf, 1024, "PRAGMA temp_store=%s;", config_get(CONFIG_SECTION_SQLITE, "temp store", "MEMORY"));
if(init_database_batch(rebuild, 0, list)) return 1;
-
+
+ // https://www.sqlite.org/pragma.html#pragma_journal_size_limit
// PRAGMA schema.journal_size_limit = N ;
snprintfz(buf, 1024, "PRAGMA journal_size_limit=%lld;", config_get_number(CONFIG_SECTION_SQLITE, "journal size limit", 16777216));
if(init_database_batch(rebuild, 0, list)) return 1;
+ // https://www.sqlite.org/pragma.html#pragma_cache_size
// PRAGMA schema.cache_size = pages;
// PRAGMA schema.cache_size = -kibibytes;
snprintfz(buf, 1024, "PRAGMA cache_size=%lld;", config_get_number(CONFIG_SECTION_SQLITE, "cache size", -2000));