package sihl
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=77f0813d75a88edd14b3396e8b848d94c31c28803299b4b1bd4b78b1de4a2e80
sha512=a8907bc35ea14b7c3a7d638979a2a274860202b2de58b84b5621a4908db001ace493d8aa2e5383f4c8b1847efd256938592f63ef75a41521284b3640d3a7442a
doc/sihl.repository/Sihl_repository/index.html
Module Sihl_repository
Source
The repository service deals with cleaning repositories. This is useful for integration tests.
Installation
Use the provided Sihl.Repository.Service.Make
to instantiate a repo service.
module Repo = Sihl.Repository.Service.Make ()
Usage
You typically want to use the repo service in your own repositories in order to register repository cleaners. This allows Sihl to reset the state of your system after integration tests.
{ let cleaner = ... in Repo.register_cleaer cleaner; }
In order to clean all repositories that have registered cleaners you can call clean_all
:
{ open Lwt.Syntax let* () = Repo.clean_all ctx in .. }
Repositories can return meta data containing information like total rows affected. This can be useful for pagination.
This module can be used to assemble dynamic repository queries. This is typically used if you don't know the number of parameters at compile time because they are provided by the user, for instance as a filter or sort. http://paurkedal.github.io/ocaml-caqti/caqti/Caqti_request/index.html#how-to-dynamically-assemble-queries-and-parameters
module Sig : sig ... end