tursodatabase / libsql

libSQL is a fork of SQLite that is both Open Source, and Open Contributions.
https://turso.tech/libsql
MIT License
9.54k stars 252 forks source link

Make PRAGMA `synchronous` configurable for a Namespace #1533

Closed avinassh closed 2 months ago

avinassh commented 2 months ago

SQLite allows setting synchronous values to any four levels. This patch provides an option to set the level for a namespace which will be used for every connection. It defaults to NORMAL.

allowed values: https://www.sqlite.org/pragma.html#pragma_synchronous

e.g. to enable:

curl -X POST http://sqld-admin-endpoint/v1/namespaces/<namespace>/config -H "Content-Type: application/json" -d '{"durability_mode": "strong"}' -v