package irmin-indexeddb

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Direct access to the stores. This is intended only for use in unit-tests.

Friendly OCaml/Lwt abstraction over IndexedDB.

type db
type db_upgrader
type key = string
type db_name = string
type store
type store_name
val store_name : string -> store_name
val make : db_name -> version:int -> init:(old_version:int -> db_upgrader -> unit) -> db Lwt.t

Connect to database db_name. If it doesn't yet exist or is for an older version, calls init to initialise it first.

val close : db -> unit

Begin closing the connection (returns immediately).

val delete_database : db_name -> unit Lwt.t
val create_store : db_upgrader -> store_name -> unit
val delete_store : db_upgrader -> store_name -> unit
val store : db -> store_name -> store
val get : store -> key -> string option Lwt.t
val set : store -> key -> string -> unit Lwt.t
val compare_and_set : store -> key -> test:(string option -> bool) -> new_value:string option -> bool Lwt.t

If test current_value for returns true for the current value of key, replace it with new_value. * If new_value is None, the key is deleted. * This happens in a single atomic transaction.

val remove : store -> key -> unit Lwt.t
val bindings : store -> (key * string) list Lwt.t