Looking around at the limited datalog based client-side databases and came across Asami, and was wondering if it offers time-travel abilities similar to XTDB or is a more traditional mutable database?
Exactly the same as XTDB
The same functions as Datomic:
• as-of
• as-of-t
• since
• since-t
https://github.com/quoll/asami/wiki/7.-Asami-API#as-of
Does this mean that I could load a local asami database in CLJS with IndexedDB and use as-of/since queries in the UI with client data?
Awesome thanks!
Not yet. The query namespace needs to be reimplemented to work with Javascript futures. My plan was to do this with the Promesa library, but I haven’t made any moves on this yet
IndexedDB was originally supposed to have a synchronous API, but then Mozilla decided to abandon it, because, “No one will want it”
I screamed. Literally. I was yelling, “I want it!!!”
But I was just yelling at my computer. No one heard me
Asami does support durable storage correct? I somehow ended up looking at this feature flag that made mention of "once it gets durable storage". Sorry for the dumb questions, Asami looks pretty exciting and I'm just sorting out where it's at before diving in: https://github.com/babashka/babashka/issues/640
Yes, it supports durable storage
You create a connection with a URI that starts with asami:local:
Thanks! (And that is that both the JS and JVM versions support durable storage correct, not just JVM? I wasn't sure if the https://clojurians.slack.com/archives/C018H97E02D/p1699635763624249 meant no persistence on JS at all - or just that only a subset of the commands work. I don't think I'd need the time travel client side so much - that seems better suited to a server side thing anyway, but would want to store persistent data client side at least.) Anyway I'm excited about Asami and am just worried it sounds too good to be true haha.
Curios if changing asami.query to Promesa is on the roadmap? (No pressure! Just curious. And wish I had the skills to help haha.)
Sort of. It needs to be duplicated, and the new namespace wrapped in Promesa. Kind of like how Node.js has both synch and asynch versions of file io
Unfortunately, the JS version doesn’t support persistence. This needs IndexDB, which requires an aync API. I could transact that way, but I can’t query with it until the asami.query namespace gets re-implemented to use Promesa.
If it’s not a large DB, then the solution for now has been to save it.
(
This lets you save your work for next time. When you come back, you can say:
(asami.core/import-data (