Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datakit using irmin store not writing to repository #603

Closed
nickbetteridge opened this issue Jun 16, 2017 · 1 comment
Closed

Datakit using irmin store not writing to repository #603

nickbetteridge opened this issue Jun 16, 2017 · 1 comment

Comments

@nickbetteridge
Copy link

The following code correctly prints out 'foo' and 'sub', but when I take a look at the irmin repo, there is nothing in the AO or RW stores. If I re-run the code, excluding the 'updates', nothing is printed out. I'm pretty sure that I've missed something somewhere :(

    module I = Idb.I_MAKER
    module Store = Datakit.Make (I)
    module RW = Datakit.Dir(Store)

    let v x = Datakit.Blob.string x, `Normal in
    let config = create_config "datakit_test_db" in
    Store.Repo.v config >>= fun repo ->
    let rw = RW.v repo Store.Tree.empty in

    RW.update rw (p []) "foo" (v "a") >>*= fun () ->
    RW.update rw (p ["sub"; "bar"]) "baz" (v "b") >>*= fun () ->

    let root = RW.root rw in

    Store.Tree.list root Store.Key.empty >>= fun keys ->
    List.iter (fun (step,tipe) ->
      print  (" - "^step)
    ) keys;
@nickbetteridge
Copy link
Author

Duh - that cunning set_tree :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant