SQLite: Add busy_timeout pragma to default options

This commit is contained in:
Tim Wojtulewicz 2025-05-13 10:37:04 -07:00
parent e91421a8de
commit 26cc6d4e7b
3 changed files with 3 additions and 3 deletions

View file

@ -24,6 +24,7 @@ export {
## database. These must be pairs that can be passed to the ``pragma`` ## database. These must be pairs that can be passed to the ``pragma``
## command in sqlite. ## command in sqlite.
tuning_params: table[string] of string &default=table( tuning_params: table[string] of string &default=table(
["busy_timeout"] = "5000",
["journal_mode"] = "WAL", ["journal_mode"] = "WAL",
["synchronous"] = "normal", ["synchronous"] = "normal",
["temp_store"] = "memory" ["temp_store"] = "memory"

View file

@ -107,8 +107,6 @@ OperationResult SQLite::DoOpen(OpenResultCallback* cb, RecordValPtr options) {
erase_stmt = std::move(stmt_ptrs[3]); erase_stmt = std::move(stmt_ptrs[3]);
expire_stmt = std::move(stmt_ptrs[4]); expire_stmt = std::move(stmt_ptrs[4]);
sqlite3_busy_timeout(db, 5000);
return {ReturnCode::SUCCESS}; return {ReturnCode::SUCCESS};
} }

View file

@ -1,8 +1,9 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63. ### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
Storage::backend_opened, Storage::STORAGE_BACKEND_SQLITE, [serializer=Storage::STORAGE_SERIALIZER_JSON, sqlite=[database_path=test.sqlite, table_name=testing, tuning_params={ Storage::backend_opened, Storage::STORAGE_BACKEND_SQLITE, [serializer=Storage::STORAGE_SERIALIZER_JSON, sqlite=[database_path=test.sqlite, table_name=testing, tuning_params={
[synchronous] = normal, [synchronous] = normal,
[journal_mode] = WAL,
[temp_store] = memory, [temp_store] = memory,
[journal_mode] = WAL [busy_timeout] = 5000
}]] }]]
open result, [code=Storage::SUCCESS, error_str=<uninitialized>, value=<opaque of BackendHandleVal>] open result, [code=Storage::SUCCESS, error_str=<uninitialized>, value=<opaque of BackendHandleVal>]
put result, [code=Storage::SUCCESS, error_str=<uninitialized>, value=<uninitialized>] put result, [code=Storage::SUCCESS, error_str=<uninitialized>, value=<uninitialized>]