irmin-indexeddb

Irmin backend using the web-browser's IndexedDB store
README

Copyright Thomas Leonard, 2020

This is an Irmin backend that stores the data in the web-browser's IndexedDB store.

Instructions

You'll need to pin a fixed version of irmin-git first:

opam pin add -yn irmin-git.2.0.0 https://github.com/talex5/irmin.git#2.0.0-cuekeeper

Also, until https://github.com/mirage/encore/issues/13 is fixed, you'll need to link with
helpers.js to add a missing stub.

You can create stores using either the standard Git format, or using Irmin's own format.
For Git format (you'll need to add irmin-git as a dependency), use:

(* A Git-format store. This data can be exported and used with the regular Git
   tools. It can also read data produced by older versions of irmin-indexeddb. *)
module I = Irmin_git.Generic(Irmin_indexeddb.Content_store)(Irmin_indexeddb.Branch_store)
    (Irmin.Contents.String)(Irmin.Path.String_list)(Irmin.Branch.String)

For Irmin format, use:

(* An Irmin-format store. This allows storing custom metadata or using
   different hash functions, but is not compatible with the Git tools or with
   databases created by older versions of irmin-indexeddb. *)
module I = Irmin.Make(Irmin_indexeddb.Content_store)(Irmin_indexeddb.Branch_store)
    (Irmin.Metadata.None)(Irmin.Contents.String)
    (Irmin.Path.String_list)(Irmin.Branch.String)(Irmin.Hash.SHA256)

To create a store, use e.g.

let () =
  let config = Irmin_IDB.config "MyProg" in
  I.v config make_task >>= fun store ->
  ...

The argument to Irmin_IDB.config is the name of the database to use (default "Irmin").

Note: In order to provide notifications (to instances running in other tabs),
the backend will also write the current branch head hash into HTML local
storage.

Bugs

Please any send questions or comments to the mirage mailing list:

http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

Bugs can be reported on the mailing list or as GitHub issues:

https://github.com/talex5/irmin-indexeddb/issues

Conditions

See LICENSE.md.

Install
Published
11 Jan 2020
Sources
irmin-indexeddb-v2.0.tbz
sha256=9397a500f5a3f83270921d95f861af0da6174d68516ce3fade725b13428ba41d
sha512=34d24e9eb04cd025e9b83b33a55d0341553f536593a837638e1ff8b75053b9ca5144466b9604a03d1d8bc99f33c34f8ae600d926fbe0b31e74230f78c3337f8c
Dependencies
git
< "3.0.0"
js_of_ocaml
>= "3.0"
cstruct
>= "1.7.0"
irmin-git
with-test
irmin
>= "2.0.0" & < "2.3.0"
base64
>= "3.0.0"
dune
>= "1.11"
ocaml
>= "4.5.0"
Reverse Dependencies