summaryrefslogtreecommitdiff
path: root/litedb/query.ml
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-06-23 06:28:41 +0700
committerpolwex <polwex@sortug.com>2025-06-23 06:28:41 +0700
commit9f5771af576413852a24b7b072a217c87b863b13 (patch)
tree391d51389024ac408fb375f06b6851b01bd3d0ef /litedb/query.ml
parentf4459658a0cad4b7615c01af9c3f87fb4d0233e0 (diff)
working working
Diffstat (limited to 'litedb/query.ml')
-rw-r--r--litedb/query.ml21
1 files changed, 12 insertions, 9 deletions
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";
+]