0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2024-12-15 20:20:20 +00:00
Avinash Sajjanshetty 15dca45139
Make PRAGMA synchronous configurable for a Namespace (#1533)
* Make PRAGMA synchronous configurable for a Namespace

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

* Make `durability_mode` field optional in proto

* Set `default` in the enum

Co-authored-by: ad hoc <postma.marin@protonmail.com>

---------

Co-authored-by: ad hoc <postma.marin@protonmail.com>
2024-07-10 09:34:29 +00:00

31 lines
839 B
Protocol Buffer

syntax = "proto3";
package metadata;
enum DurabilityMode {
RELAXED = 0;
STRONG = 1;
EXTRA = 2;
OFF = 3;
}
// Database config used to send db configs over the wire and stored
// in the meta store.
message DatabaseConfig {
bool block_reads = 1;
bool block_writes = 2;
// The reason why operations are blocked. This will be included in [`Error::Blocked`].
optional string block_reason = 3;
// maximum db size (in pages)
uint64 max_db_pages = 4;
optional string heartbeat_url = 5;
optional string bottomless_db_id = 6;
optional string jwt_key = 7;
optional uint64 txn_timeout_s = 8;
bool allow_attach = 9;
optional uint64 max_row_size = 10;
optional bool shared_schema = 11;
optional string shared_schema_name = 12;
optional DurabilityMode durability_mode = 13;
}