Fork me on GitHub
#cljsrn
<
2022-11-10
>
2FO16:11:32

Howdy, Is it possible do use datalog databases as the persistence layer with cljsrn? e.g xtdb, datomic etc

joshmiller02:11:46

Do you mean locally? If so, I think your best option is Datascript, although I think you’ll have to write your own code to save its state to disk on changes.

2FO16:11:43

If possible, I was hoping to use it as an external db.

Oliver George23:11:09

Small heads up based on my experience a couple of years ago. Initialising a datascript db involves indexing which was quite resource intensive for my cljsrn app. Impacted UX. Depends on what data you need to load of course. I had a lot of reference data.

2FO14:11:22

Thanks for the heads up, looks I'd be better off going with something more run of the mill for the db.

walterl18:11:39

Logseq saves a Datascript db in an IndexedDB database; not sure what provides that in their CapacitorJS-based mobile app, or if it's available to RN, though.

👍 1
Oliver George22:11:15

Interesting. A persisting datascript would be sweet. I can imagine serlising to IndexedDB but can't intuitively see how you can run datascript queries against it. I think IndexDB only handles simple types so the comparison stuff is limited (serialisable?). The async API is a challenge too. (old memories, could be wrong).

walterl22:11:48

From the little code I've read it seemed like the data is mostly kept in RAM, and only periodically persisted in IndexedDB. Could be wrong.