Fork me on GitHub
#xtdb
<
2021-02-28
>
mmer00:02:57

Quick question - the client api that allows you to attach to a remote db over http? Is there a clojure script version of that api?

refset15:02:06

Nothing official, although I did hack one together once, so maybe you can do something similar: https://github.com/crux-labs/crux-console/blob/master/src/crux_ui_lib/async_http_client.cljc

refset15:02:44

Are you writing Lambdas in cljs or something?

mmer21:03:09

It would be good to go direct from cljs to the db, without having an extra layer in between.

refset21:03:15

You mean from cljs running in a browser? It was certainly nice to be able to do that for that original console prototype, but I'm not sure I can think of other scenarios where exposing your DB directly like that would be a good idea 🙂 what did you have in mind?

Toyam Cox03:02:26

What's with the dollar sign in the :in tests? :in [$ a]

refset15:02:05

Essentially it's just for better compatibility with DataScript tests, since we don't actually support multiple DB input sources you can also safely ignore it

teodorlu14:02:24

Hey! Anyone aware in UX work for writing Datalog queries that doesn't require the user to write the query in plain text? https://clojurians.slack.com/archives/C07V8N22C/p1614521640037100?thread_ts=1614521640.037100&amp;cid=C07V8N22C

refset16:02:45

One option that might work is to JSON-ify the Datalog syntax, and then use some kind of visual JSON editor, e,g. http://mb21.github.io/JSONedit/ (found via https://stackoverflow.com/questions/998832/gui-based-or-web-based-json-editor-that-works-like-property-explorer) The main challenge with that is in comprehensively representing non-JSON types like symbols, sets and keywords, but you can use a lightweight nesting abstractions like {"$set": [{"$keyword":"foo"}, {"$string":"bar"}] (in thinking about this before it seems better to treat JSON strings as symbols, and then be explicit about $string to save on string escaping chaos). Or you could use Transit-JSON-Verbose 🙂

👍 3
refset15:03:04

@U3X7174KS have you had any other interesting responses or related finds yet?

teodorlu15:03:44

@U899JBRPF hyperfiddle was mentioned. I'm probably looking for something lighter, though.

refset15:03:38

Cool, that's interesting to know. Is this for Metabase-like use-cases? Which Datalog backend do you ideally want it for? I built something kind of similar for DataScript once, but never released it - composing queries in a web-based modal text outliner

3
teodorlu17:03:15

I have an idea that I can't really get rid of. If we manage to use databases like Datascript client side in a proper way, a lot of frontend complexity would disappear. Datalog queries are a really good way to view data. But it's not something anyone could "just write. If we aim for easiest possible, we could support a subset of Datalog in a really nice to use UI. "only allow happy paths". I suppose there are a few different "easy subsets of Datalog" that it's possible to support.

teodorlu17:03:00

Good point about metabase. Metabase or Kibana seems like "high complexity buy-ins" to this idea.

refset18:03:31

Right yeah, I think declarative UI's backed directly by a Datalog database (client/server distinction is somewhat irrelevant) is definitely a great path. Being able to represent and transform a Datalog query as a UI-expressible data structure with Datalog would be a very neat bootstrapping step. Somewhat tangential, but have you seen https://github.com/den1k/root ? I feel like this idea is important also

3
teodorlu08:03:44

Nope, I'll take a look :thumbsup:

teodorlu08:03:32

This is exciting 👀

teodorlu08:03:54

Thanks for the reference 🙏

bbss03:03:41

@U3X7174KS maybe also check out the fulcro-inspect project it is text based and works on eql, not exactly datalog. But it does have query completion and is somewhat user friendly and might be close in scope? https://github.com/fulcrologic/fulcro-inspect

👀 6
💯 3
teodorlu06:03:55

@U09MR0T5Y thats a very good point. I watched the video way back, but didn't make the connection then. Thank you!