View raw

1 (** Durable {!Repository.S} backed by SQLite through Caqti. The production 2 store. 3 4 All performed facts are stored through {!Codec}: the adapter never inspects 5 domain shape, it stores and returns opaque encoded strings. Prescriptions 6 are not stored — a workout resolves its prescription against the shared 7 {!Catalog} on read. 8 9 Identity is assigned here: trainees and workouts get string ids the adapter 10 mints. *) 11 12 include Repository.S 13 14 exception Corrupt of Codec.error 15 (** Raised when a stored workout cannot be decoded — a corrupted database or a 16 catalog that no longer names a stored routine or workout. This is a fault, 17 not a normal outcome. *) 18 19 val connect : string -> (t, Caqti_error.t) result Lwt.t 20 (** [connect uri] opens a connection pool and applies {!Migrations}. [uri] is a 21 Caqti URI such as ["sqlite3:hito.sqlite"]. *) 22