diff options
author | polwex <polwex@sortug.com> | 2025-06-23 06:28:41 +0700 |
---|---|---|
committer | polwex <polwex@sortug.com> | 2025-06-23 06:28:41 +0700 |
commit | 9f5771af576413852a24b7b072a217c87b863b13 (patch) | |
tree | 391d51389024ac408fb375f06b6851b01bd3d0ef /bin | |
parent | f4459658a0cad4b7615c01af9c3f87fb4d0233e0 (diff) |
working working
Diffstat (limited to 'bin')
-rw-r--r-- | bin/mainlite.ml | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/bin/mainlite.ml b/bin/mainlite.ml index 42b0009..f288891 100644 --- a/bin/mainlite.ml +++ b/bin/mainlite.ml @@ -31,6 +31,19 @@ let () = let db_uri = 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 | Ok pool -> let server = Server.create ~config (request_handler ~db_pool:pool) in |