summaryrefslogtreecommitdiff
path: root/litedb/query.ml
diff options
context:
space:
mode:
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";
+]