datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
teodorlu 2020-10-10T22:44:46.025500Z

Is it a bad idea to store a whole Datascript db value inside a reagent.core/atom?

2020-10-11T18:31:39.028200Z

@teodorlu It is wild šŸ™‚ But, datascript is just... an in memory database. So it's wild by design.

šŸ˜ 1
2020-10-11T18:32:17.028400Z

FWIW, this is more or less what Posh does.

teodorlu 2020-10-11T20:42:53.028700Z

Ah, OK. I almost asked about what Posh actually does. After not too much code, I had something that worked decently, so I wondered if there was much more to it. Is it worth the extra dependency? I guess they may have thought a bit more about API design than what I collected.

Oliver George 2020-10-11T22:45:16.029100Z

Iā€™m in the same boat. I decided that I would work directly with the datascript until there was compelling reason to add a new dependency

šŸ‘ 1
2020-10-12T19:28:28.034900Z

Yeah; So the thing Posh does is give you reactive queries that only update if it looks new transactions have a chance of effecting the result. So it saves you some compute. However, it doesn't always do this perfectly; There are some edge cases like recursive query rules (and maybe using query functions?), and I don't remember now whether it catches these and updates them automatically. As a last resort, you can specify a custom pattern for deciding when to rerun a query if something is amiss. I'd say it's pretty convenient and worth taking a look at.

šŸ‘ 1
2020-10-12T19:29:01.035100Z

If don't expect to ever have too much data or too many queries though, it may not be necessary.

šŸ‘ 1
Oliver George 2020-10-10T23:58:38.026400Z

I do. Works fine for me.

šŸ‘ 1