datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
devn 2018-02-28T00:50:08.000111Z

Can I do multiple pulls in a query? It seems to only respect the first (pull ...) in the find clause

souenzzo 2018-02-28T12:53:59.000404Z

In datomic, yes, you can do (d/q '[:find (pull ?e) (pull ?a) :where [?e :user/address ?a]]).

devn 2018-02-28T19:09:08.000238Z

@souenzzo thanks. i was doing something still. I was calling (map first) on the result of the query and went to bed confused about why the order of the pulls in the :find clause mattered. sleep is good!

devn 2018-02-28T19:09:49.000736Z

In these docs, there is an example which uses a schema that specifies a valueType of :db.type/string on an attribute: https://github.com/tonsky/datascript/wiki/API-overview

devn 2018-02-28T19:10:33.000450Z

When I specify a valueType of string, it throws an exception: Bad attribute specification ...

souenzzo 2018-02-28T19:10:54.000640Z

I think that it's a issue. You can update the docs and make a pR

devn 2018-02-28T19:11:07.000040Z

Thanks @souenzzo

devn 2018-02-28T19:12:22.000197Z

@souenzzo you don't happen to have any idea which issue it is, do you?

souenzzo 2018-02-28T19:13:59.000410Z

I think that is something like outdated/inconsistent documentation Some versions back, it was possible to declare these types.

devn 2018-02-28T20:51:42.000034Z

Here's a lazy question:

devn 2018-02-28T20:52:08.000411Z

Why is conn-from-datoms so much faster that transacting maps?

devn 2018-02-28T20:52:35.000648Z

It takes like 40 seconds to do db/with or transact! what takes 2 seconds if I put it all into datom format ahead of time