summaryrefslogtreecommitdiff
path: root/src/sql
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2023-11-15 10:50:30 -0300
committerEuAndreh <eu@euandre.org>2023-11-15 16:16:30 -0300
commitaf5e7495f3993c52573432cadde12169d5c05e62 (patch)
tree002fc20e6f12eac71c21c6eccc48bf59e7180274 /src/sql
parentsrc/napi-sqlite.c: Add Node-API PoC (diff)
downloadpapod-af5e7495f3993c52573432cadde12169d5c05e62.tar.gz
papod-af5e7495f3993c52573432cadde12169d5c05e62.tar.xz
Add support for multi-file C project
- have dynamic discovered dependencies via `mkdeps.hs`, and also move the listing of JavaScript files to it. - copy over stub C files for setting up the project skeleton.
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/config.sql34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/sql/config.sql b/src/sql/config.sql
new file mode 100644
index 0000000..53eb279
--- /dev/null
+++ b/src/sql/config.sql
@@ -0,0 +1,34 @@
+; "Litestream requires periodic but short write locks on the database when
+; checkpointing occurs":
+; https://litestream.io/tips/#busy-timeout
+PRAGMA busy_timeout = 5000;
+
+; "Litestream only works with the SQLite WAL journaling mode":
+; https://litestream.io/tips/#wal-journal-mode
+PRAGMA journal_mode = WAL;
+
+; "(...) change the synchronous mode to NORMAL (it typically defaults to FULL)":
+; https://litestream.io/tips/#synchronous-pragma
+; "WAL mode is safe from corruption with synchronous=NORMAL":
+; https://www.sqlite.org/pragma.html#pragma_synchronous
+PRAGMA synchronous = NORMAL;
+
+; "(...) can perform a checkpoint in between Litestream-initiated checkpoints
+; and cause Litestream to miss a WAL file":
+; https://litestream.io/tips/#disable-autocheckpoints-for-high-write-load-servers
+PRAGMA wal_autocheckpoint = 0;
+
+; "This pragma does a low-level formatting and consistency check of the
+; database":
+; https://www.sqlite.org/pragma.html#pragma_integrity_check
+PRAGMA integrity_check;
+
+; "The foreign_key_check pragma checks the database, or the table called
+ \"table-name\", for foreign key constraints that are violated":
+; https://www.sqlite.org/pragma.html#pragma_foreign_key_check
+PRAGMA foreign_key_check;
+
+
+CREATE TABLE IF NO EXISTS migrations (
+ name TEXT PRIMARY KEY
+);