tonsky / datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
Eclipse Public License 1.0
5.46k stars 304 forks source link

feat(datalog-console): respond to datalog-console messages in browser #395

Closed groundedsage closed 2 years ago

groundedsage commented 3 years ago

Basic implementation for Datalog Console #394

tonsky commented 3 years ago

Thank you for the patch! Datalog-console looks awesome!

Not saying your approach is wrong, just need more context and make sure we looked at all options. This is what I am curious about:

  1. Is there a way for initialization code to not be in the core?
  2. You are hooking up conn creation. What do you think should happen if user has multiple conns?
  3. Same question, but if user just uses db and db-with?
groundedsage commented 3 years ago

Glad you like the Datalog Console.

We are aware that there is quite a few things we need to consider and this is just to get the ball rolling. These are of course very good questions.

I think we could move the code outside of core and have some utility for registering the database. Not sure exactly what that would look like yet. We are open to suggestions on what could be done here if you have any.

tonsky commented 3 years ago

What if you just insert something like

datalog_console.show_db(db);

? What would be limitations of that? Usability-wise, convenience-wise?

groundedsage commented 2 years ago

We are currently doing a lot of improvements to the Datalog Console and it will now be available as a separate library. I am closing this pull request and will open another one for a README update when v1 is released. So developers can find dev tooling that works with Datascript.