package ocsipersist

  1. Overview
  2. Docs
Persistent key-value storage for OCaml using multiple backends

Install

dune-project
 Dependency

Authors

Maintainers

Sources

3.1.2.tar.gz
md5=685a01c152aa6059b721280a29d35257
sha512=1cadc30a37c253f98d7ace1bb1ce0ac133e3e17f5b595bd80cc6c324bd5aed687a61211fc4ddcc060cfa476ca977943f994549ac79e9c16677b2041cdcaaf8f0

doc/index.html

Ocsipersist

Ocsipersist is a collection of libraries defining a unified frontend for a number of key/value storage implementations. It is used pervasively in Ocsigen/Eliom to handle sessions and persistent references, but can be used as a standalone library or as an extension for Ocsigen Server.

Three backends currently exist:

You choose a backend by installing the corresponding package (ocsipersist-sqlite, ocsipersist-dbm or ocsipersist-pgsql); the unified frontend is the same in every case.

API reference

The storage frontend is documented in module Ocsipersist. It defines several interfaces:

  • Ref — the simplest to use: persistent references;
  • Store — a lower-level interface for persistent values;
  • Polymorphic — a polymorphic table (using Marshal);
  • Functorial — a type-safe table built from a value description.

See Ocsipersist for the full frontend, and Ocsipersist_lib for the backend-independent signatures and functors shared by every backend.

Backends and configuration

Each backend ships an Ocsipersist_settings library to configure storage from OCaml, and an optional ocsipersist-*-config package to configure it from Ocsigen Server's configuration file: