Fork me on GitHub
#datascript
<
2015-10-23
>
jamesh11:10:47

@tonsky: Hi, I am using datascript on the client, and datomic on the server, and sharing queries between them. I run into a problem with input variables when I want to parametrise a query over a pull-pattern. Datomic requires that the symbol not start with a ?, whereas datascript requires (and works) when I use a variable that starts with a ?. For example:

[:find (pull ?e pattern)
 :in $ ?artist pattern
 :where [?e :release/artists ?artist]]
works on Datomic, and:
[:find (pull ?e ?pattern)
 :in $ ?artist pattern
 :where [?e :release/artists ?artist]]
works on datascript.

jamesh11:10:11

[:find (pull ?e pattern)
 :in $ ?artist ?pattern
 :where [?e :release/artists ?artist]]

jamesh11:10:15

on datascript

jamesh11:10:08

Is the way datascript handles variables fundamentally different to datomic, or could this be patched to work more like datomic?