(** Common fuctions shared between the tests *) let ( let* ) = Lwt.bind (** Connect to the database in memory and create a schema matching the given configuration *) let connect : Configuration.Ast.setting -> Caqti_lwt.connection Lwt.t = fun conf -> let* conn = Caqti_lwt_unix.connect (Uri.of_string "sqlite3::memory:") in let* db = Caqti_lwt.or_fail conn in let module Db = (val db) in let* () = Query.create db conf in Lwt.return db