(** Durable {!Repository.S} backed by SQLite through Caqti. The production store. All performed facts are stored through {!Codec}. The adapter never inspects domain shape. It stores and returns opaque encoded strings. Prescriptions are not stored. A workout resolves its prescription against the shared {!Catalog} on read. Identity is assigned here: trainees and workouts get string ids the adapter mints. *) open Hito_app include Repository.S exception Corrupt of Codec.error (** Raised when a stored workout cannot be decoded. The cause is a corrupted database, or a catalog that no longer names a stored routine or workout. This is a fault, not a normal outcome. *) exception Import_corrupt of Import_codec.error (** Raised when a stored import batch or promoted record cannot be decoded. The cause is a corrupted database, or a catalog that no longer names a stored exercise. This is a fault, not a normal outcome. *) val connect : ?pool_config:Caqti_pool_config.t -> string -> (t, Caqti_error.t) result Lwt.t (** [connect uri] opens a connection pool and applies {!Migrations}. [uri] is a Caqti URI such as ["sqlite3:hito.sqlite"]. Use a one-connection pool for ["sqlite3::memory:"] because each connection has a separate database. *)