datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
denis_krivosheev 2018-06-13T09:14:56.000242Z

Hi guys. I’m so exited about datascript and rum, thank you @tonsky for the great work! The only thing I can’t figure out is how to make them work together? Is there a standartized way? I know that I can just inject reactive mixin inside the component, but I don’t want to rerender everything every time something changed in the database, I don’t even want to execute all the queries all the time. Any suggestions?

2018-06-13T09:16:14.000216Z

I found out that in practice entities work much better than queries. As of rerendering everything every time, you’ll have to roll out your own solution

denis_krivosheev 2018-06-13T09:19:09.000448Z

Yeah, that’s what I thought. Thank you for answer @tonsky

2018-06-13T14:57:34.000063Z

Any thoughts on how such a solution might look?

petterik 2018-06-13T15:05:29.000445Z

I'm attempting it with a new om.next inspired library where the parser only runs queries that matter. It'll hopefully incrementally update both queries and pulls when I'm done. I have taken on quite a lot of stuff, but it's getting closer to being usable. om.next parser library - http://github.com/petterik/lajt om.next-like library - http://github.com/petterik/lajter

2018-06-13T15:08:03.000204Z

I'm thinking a love child of om.next and datascript. Yep @petterik, thanks for the reminder to check these out in more detail.

petterik 2018-06-13T15:08:33.000448Z

The lajter stuff is new. Was going to make it usable before I told you

petterik 2018-06-13T15:08:43.000658Z

:man-shrugging:

2018-06-13T15:09:18.000444Z

lajter is your take on om.next, with lajt ideas integrated?

petterik 2018-06-13T15:10:05.000286Z

lajter is my take on om.next, yes. lajt is the parser.

petterik 2018-06-13T15:10:15.000487Z

will most likely rename lajter

petterik 2018-06-13T15:10:27.000980Z

got to go 👋

👍 1
petterik 2018-06-13T16:36:27.000758Z

Also, @denis_krivosheev since we're on the topic of frontend libraries that work with datascript: There was recently a new release of re-posh (https://github.com/denistakeda/re-posh) - if you want to try out datascript and re-frame. Or just posh (https://github.com/mpdairy/posh) - datascript and reagent