announcements

Project/library announcements ONLY - use threaded replies for discussions. Do not cross post here from other channels. Consider #events or #news-and-articles for other announcements.
2021-05-02T10:57:41.102800Z

from today doxa can be even faster than datascript https://github.com/ribelo/doxa#can-we-be-faster-than-datascript-yes

πŸ‘ 2
πŸš€ 13
wotbrew 2021-05-03T21:10:26.114400Z

I am a little sceptical that a hash index {eid {k v}} could possibly beat indexed datascript in the general case? e.g not trivially small databases, and not 'get large portion of all the rows' type queries. @huxley any magic I am missing? Aren't value queries going to have to scan the the whole 'table'?

2021-05-03T21:14:51.114600Z

nested map can be faster due to the possibility of limiting the iterated elements, @danstone

2021-05-03T21:15:55.114800Z

[(datascript-query) (dx-query) (fast-dx-query)]
;; clj => [182.98 685.15 71.05] - in ms
for a normal query doxa is ~5x slower

2021-05-03T21:19:16.115Z

By the way, initially the goal was not to race with datascript at all, rather easy interop with re-frame and seamless data synchronisation with firestore

πŸ‘ 1
steveb8n 2021-05-03T22:03:29.115400Z

using the re-frame app-db is why I like this lib. using datalog instead of specter for subs is a nice architecture. it does mean losing some perf because equals? can’t use identical? but that’s ok for 80% of my use cases

steveb8n 2021-05-09T23:55:14.184100Z

@huxley do you want issues logged yet? I have a couple of feature requests: 1. runtime query & 2. query/pull without ?table. just checking when you think bugs/feature requests are useful

2021-05-10T08:26:03.184800Z

Yes, please. Especially the feature request.

steveb8n 2021-05-10T08:34:13.185Z

great. thanks

2021-05-10T09:31:56.185600Z

Do grapql entities always start with two underscores?

steveb8n 2021-05-21T09:18:21.021300Z

only the :typename field. the only other standard field is :id

steveb8n 2021-05-21T09:20:02.021500Z

you can see it here https://countries.trevorblades.com/

steveb8n 2021-05-21T09:20:21.021700Z

paste this query in the left panel and run it….

steveb8n 2021-05-21T09:20:22.021900Z

query { countries { typename code, name, currency } }

steveb8n 2021-05-21T09:22:01.022100Z

although that api does not provide an :id so maybe not a perfect example

steveb8n 2021-05-21T09:55:47.022300Z

I'm away from my desk at the moment but I saw your comment. Thanks

steveb8n 2021-05-21T09:57:36.022500Z

1 question. Could a runtime arg be passed using the :in clause? That way it would match the behaviour of the other implementations

2021-05-21T20:14:32.036800Z

I have just fixed it

πŸ™ 1
2021-05-02T12:56:54.104Z

You posted a link to the same library 2 weeks ago. https://clojurians.slack.com/archives/C06MAR553/p1618679544447900

2021-05-02T13:07:06.104400Z

sry, is there any place for new releases?

steffan 2021-05-02T13:33:09.104800Z

#releases

yuhan 2021-05-02T14:18:37.105300Z

Is this a library meant for public consumption or more like a series of explorations? I found the API quite hard to understand from the Readme, and none of the public functions have docstrings - just some feedback πŸ™‚

yuhan 2021-05-02T14:21:58.105500Z

The source definitely reads more like an exploratory notebook and it seems that the dependencies on encore, timbre, shadow-cljs are only used in comment forms and should be put into some sort of :dev alias.

2021-05-02T14:41:21.105700Z

@qythium doxa was born by accident while testing what a meander can do

2021-05-02T14:41:50.105900Z

I did not expect any interest, so for a long time there were neither tests nor readme

2021-05-02T14:42:39.106100Z

I will probably write docstrings once I have worked out more or less in my head how it should look and be used.

πŸ‘ 1
yuhan 2021-05-02T14:48:32.106400Z

I feel like the commit function would look better taking variable arity of transactions, except there's an optional tx-meta argument which I couldn't figure out what it was for

2021-05-02T14:51:30.106600Z

tx-meta is written to the db metadata

2021-05-02T14:52:23.106800Z

you can only listen! for a specific tx-meta

2021-05-02T15:02:55.107Z

(def conn_ (atom (dx/create-dx)))
(listen! @conn_
         (fn [db]
           (let [tx-meta ((meta db) :tx-meta)]
             (cond
               (#{:one :two} tx-meta)
               (println :something)
               (#{:three} tx-meta)
               (println :something-else)))))

(dx/commit! conn_ [:dx/put {:db/id 0 :key :value}] :one)
(dx/commit! conn_ [:dx/put {:db/id 1 :key :value}] :two)
(dx/commit! conn_ [:dx/put {:db/id 2 :key :value}] :three)
;; => repl
;; :something
;; :something
;; :something-else