diff options
author | polwex <polwex@sortug.com> | 2025-06-23 06:52:20 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-06-23 06:52:20 +0700 |
commit | 7d6d899f273ffe252c7381e2162a1bbc611cddc5 (patch) | |
tree | a3eb861db79182a9866c3cd3963590c3d45821ef /bin/mainlite.ml | |
parent | 9f5771af576413852a24b7b072a217c87b863b13 (diff) |
Diffstat (limited to 'bin/mainlite.ml')
-rw-r--r-- | bin/mainlite.ml | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/bin/mainlite.ml b/bin/mainlite.ml index f288891..400f113 100644 --- a/bin/mainlite.ml +++ b/bin/mainlite.ml @@ -32,19 +32,19 @@ let () = Uri.make ~scheme:"sqlite3" ~path:"/home/y/code/ocaml/combattant/bulkdata/blog.db" () in (* Create connection pool with initialization function *) - (* let connect_pool ~sw ~stdenv uri = - Caqti_eio_unix.connect_pool - ~sw - ~stdenv - ~post_connect:(fun conn -> - (* Initialize each connection with SQLite performance pragmas *) - match Query.init_connection conn with - | Ok () -> Ok () - | Error err -> Error err) - uri - in - match connect_pool ~sw ~stdenv:(env :> Caqti_eio.stdenv) db_uri with *) - match Caqti_eio_unix.connect_pool ~sw ~stdenv:(env :> Caqti_eio.stdenv) db_uri with + let connect_pool ~sw ~stdenv uri = + Caqti_eio_unix.connect_pool + ~sw + ~stdenv + ~post_connect:(fun conn -> + (* Initialize each connection with SQLite performance pragmas *) + match Litedb.Query.init_connection conn with + | Ok () -> Ok () + | Error err -> Error err) + uri + in + match connect_pool ~sw ~stdenv:(env :> Caqti_eio.stdenv) db_uri with + (* match Caqti_eio_unix.connect_pool ~sw ~stdenv:(env :> Caqti_eio.stdenv) db_uri with *) | Ok pool -> let server = Server.create ~config (request_handler ~db_pool:pool) in ignore @@ Server.Command.start ~sw env server |