package irmin-indexeddb

  1. Overview
  2. Docs

Module Irmin_indexeddb.RawSource

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

Friendly OCaml/Lwt abstraction over IndexedDB.

Sourcetype db
Sourcetype db_upgrader
Sourcetype key = string
Sourcetype db_name = string
Sourcetype store
Sourcetype store_name
Sourceval store_name : string -> store_name
Sourceval 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.

Sourceval close : db -> unit

Begin closing the connection (returns immediately).

Sourceval delete_database : db_name -> unit Lwt.t
Sourceval create_store : db_upgrader -> store_name -> unit
Sourceval delete_store : db_upgrader -> store_name -> unit
Sourceval store : db -> store_name -> store
Sourceval get : store -> key -> string option Lwt.t
Sourceval set : store -> key -> string -> unit Lwt.t
Sourceval 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.

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