Added default options for synchronous and journal mode

Added enum options SQLITE_SYNCHRONOUS_DEFAULT and SQLITE_JOURNAL_MODE_DEFAULT
and changed the default to be these instead.
This commit is contained in:
Mymaqn 2024-10-30 13:56:19 +01:00 committed by Johanna Amann
parent 6e026ba313
commit 3ca56f7e0f
4 changed files with 17 additions and 8 deletions

View file

@ -23,6 +23,7 @@ export {
const empty_field = Log::empty_field &redef;
type SQLiteSynchronous: enum {
SQLITE_SYNCHRONOUS_DEFAULT,
SQLITE_SYNCHRONOUS_OFF,
SQLITE_SYNCHRONOUS_NORMAL,
SQLITE_SYNCHRONOUS_FULL,
@ -31,27 +32,29 @@ export {
## Values supported for SQLite's PRAGMA journal_mode statement.
type SQLiteJournalMode: enum {
SQLITE_JOURNAL_MODE_DEFAULT,
SQLITE_JOURNAL_MODE_DELETE,
SQLITE_JOURNAL_MODE_TRUNCATE,
SQLITE_JOURNAL_MODE_PERIST,
SQLITE_JOURNAL_MODE_PERSIST,
SQLITE_JOURNAL_MODE_MEMORY,
SQLITE_JOURNAL_MODE_WAL,
SQLITE_JOURNAL_MODE_OFF,
};
## If set, runs the PRAGMA synchronous statement with the
## provided value after connecting to the SQLite database. See
## If changed from SQLITE_SYNCHRONOUS_DEFAULT, runs the PRAGMA synchronous
## statement with the provided value after connecting to the SQLite database. See
## `SQLite's synchronous documentation <https://www.sqlite.org/pragma.html#pragma_synchronous>`_
## for more details around performance and data safety trade offs.
const synchronous = SQLITE_SYNCHRONOUS_FULL &redef;
const synchronous = SQLITE_SYNCHRONOUS_DEFAULT &redef;
## If set, runs the PRAGMA journal_mode statement with the
## provided value after connecting to the SQLite database. See
## If changed from SQLITE_JOURNAL_MODE_DEFAULT, runs the PRAGMA
## journal_mode statement with the provided value after connecting to
## the SQLite database.
## `SQLite's journal_mode documentation <https://www.sqlite.org/pragma.html#pragma_journal_mode>`_
## for more details around performance, data safety trade offs
## and interaction with the PRAGMA synchronous statement.
const journal_mode = SQLITE_JOURNAL_MODE_DELETE &redef;
const journal_mode = SQLITE_JOURNAL_MODE_DEFAULT &redef;
}