From 9f5771af576413852a24b7b072a217c87b863b13 Mon Sep 17 00:00:00 2001 From: polwex Date: Mon, 23 Jun 2025 06:28:41 +0700 Subject: working working --- litedb/query.ml | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'litedb/query.ml') diff --git a/litedb/query.ml b/litedb/query.ml index 536347c..61616b4 100644 --- a/litedb/query.ml +++ b/litedb/query.ml @@ -59,7 +59,7 @@ module Query = struct let user_comments = [%rapper - get_opt + get_many {sql| SELECT @int{id}, @string{content}, @string{date}, @string{tags}, @string{url} FROM Comments @@ -70,7 +70,7 @@ module Query = struct let post_comments = [%rapper - get_opt + get_many {sql| SELECT @int{id}, @string{content}, @string{date}, @string{tags}, @string{url} FROM Comments @@ -81,7 +81,7 @@ module Query = struct let comment_children = [%rapper - get_opt + get_many {sql| SELECT @int{id}, @string{content}, @string{date}, @string{tags}, @string{url} FROM Comments @@ -94,9 +94,12 @@ end let get_poasts conn = Query.poasts conn let get_poast post_id conn = Query.poast ~post_id conn -(* db.exec("PRAGMA journal_mode = WAL"); *) -(* db.exec("PRAGMA foreign_keys = ON"); *) -(* db.exec("PRAGMA cache_size = -8000"); // 8MB cache *) -(* db.exec("PRAGMA temp_store = MEMORY"); *) -(* db.exec("PRAGMA synchronous = NORMAL"); *) -(* db.exec("PRAGMA mmap_size = 30000000000"); // 30GB memory map *) +(* SQLite performance pragmas - to be implemented *) +let sqlite_pragmas = [ + "PRAGMA journal_mode = WAL"; + "PRAGMA foreign_keys = ON"; + "PRAGMA cache_size = -8000"; + "PRAGMA temp_store = MEMORY"; + "PRAGMA synchronous = NORMAL"; + "PRAGMA mmap_size = 30000000000"; +] -- cgit v1.2.3