Saving / Loading a Datascript DB

310 views
Skip to first unread message

Wukong Sun

unread,
Sep 26, 2016, 8:15:16 AM9/26/16
to Clojure
Hi,

  Is there a easy way to save/load a datascript DB to file?

  I'm not looking to use datomic. I just need a way to save my datascript db to file and to read it later.

Thanks!

Christopher Small

unread,
Sep 27, 2016, 3:07:51 AM9/27/16
to Clojure
This should be pretty easy. You can use `datascript.core/datoms` to produce a sequence of datoms which you serialize as EDN, CSV or (gasp) JSON. For reading back in, you can use `datascript.core/conn-from-datoms`.

Chris

Nikita Prokopov

unread,
Sep 27, 2016, 9:05:37 AM9/27/16
to Clojure
Wukong,


Best,
Nikita
Reply all
Reply to author
Forward
0 new messages