Version 0.10.1 is released, https://github.com/datalevin/datalevin/blob/master/CHANGELOG.md#0101-2026-01-21
I don't think the Pod version for Babashka is working: user=> (pods/load-pod 'huahaiy/datalevin "0.10.1") Downloading pod huahaiy/datalevin (0.10.1) java.io.FileNotFoundException: https://github.com/datalevin/datalevin/releases/download/0.10.1/dtlv-0.10.1-macos-latest-aarch64.zip [at <repl>31]
it's not released as pod, this is normally handled by someone else.
the url is wrong too
Sorry to bug you then, thought it was official, but looks to be via someone named "bzg"
I can send a PR to borkdude
Sent a PR to him
I should have told bzg about the URL changes. My bad.
Merged.
Trying the latest version and it loads without issue! gratitude
I noticed a small typo in https://github.com/datalevin/datalevin/blob/master/doc/upgrade.md#in-code
datalein.main/dump should probably be datalevin.main/dump.
Fixed. Thx.
I'm trying to dump the full database and restore in code. I'm not really sure what the recommended values are for dbis list? datalog? all?. Ideally, I could just do:
(require 'datalevin.main)
;; using old version
(datalevin.main/dump src-dir backup-file)
;; using new version
(datalevin.main/load new-copy-dir backup-file)I don't understand the descriptions for all? and datalog?
Is this the right idea?
(require 'datalevin.main)
;; using old version
(datalevin.main/dump src-dir backup-file nil false true true)
;; using new version
(datalevin.main/load new-copy-dir backup-file nil true)looks ok, anything wrong?
I don't know. Like I said, I don't understand what all? and datalog? do so I don't know how to check if everything worked.
ok, Datalevin expose both underlying key-value and Datalog API. Dump/load are trying to use the same function for both. all? means dump/load all the DBI, i.e. all the key-value sub-database. datalog? means dum/load the DB as a Datalog DB, not in terms key values, so it will dump all datoms, instead of key value raw bytes.
if both are true, does it dump both?
In any case, if you have a Datalog DB, set datalog? true, it will dump datoms and schema.
datalog? takes precedence.
We will not dump both formats at the same time. Only in one format.
Ok, I think it worked. I initially dumped nippy? set to false, but it had trouble loading some records I had stored. Using nippy? set to true seemed to work. It wasn't really clear what format would be used if nippy? was false.
If nippy? set as false, datoms are printed, so the values are expected to be printable.
Yes, I figured that, but it was apparent from the documentation. Thankfully, the db was small.
Added a note in the doc string. Thanks.
So, if datalevin have both key/value and datalog databases, then we need to dump/load it for each kind?
Correct. If you have both in the same db file, dump it as datalog will not dump non-datalog DBIs, you will have to dump them separately.
we could automate this though. I can file an issue.
It should also be possible to dump reload via the clojure cli without downloading a separate binary. An example command would be helpful. Something like:
clojure -Sdeps {:deps\ {datalevin/datalevin\ {:mvn/version\ \"old-version\"}}} -M -m datalevin.main.dump db-dir backup-file
clojure -Sdeps {:deps\ {datalevin/datalevin\ {:mvn/version\ \"new-version\"}}} -M -m datalevin.main.load backup-file new-db-dirCool, a PR on the doc would be appreciated
I don't think datalevin.main.dump and datalevin.main.load exist in the right form right now
or maybe the main function in datalevin.main could work
yeah, main function handles argument parsing etc. so it may work