Fork me on GitHub
#datascript
<
2015-08-20
>
sonnyto09:08:53

@tonsky: you're awesome

sonnyto11:08:13

I am trying to write a wrapper around d/q that that looks like this

sonnyto11:08:14

(defn q [query & params] "wrapper around d/q so that you don't have to pass in the database @conn" (println params) (d/q query @conn params))

sonnyto11:08:32

but it doesnt work because params is treated as a list

sonnyto11:08:02

how can i pull the params out of that list?

acron13:08:40

so, i'll admit to being pretty new to datascript, datalog and datomic...i am trying to get results from a datascript db based on a query. I have the query returning :db/ids and rather than craft in the query what i want returned, i just want a way to turn these ids into fully-formed results.

acron13:08:07

I want the whole map, rather than select keys as the query only seems to allow me

sonnyto13:08:51

@acron u have to touch it

sonnyto13:08:58

use d/touch

sonnyto13:08:11

or you can use the pull api with the query api

sonnyto13:08:49

for example, (d/q '[:find (pull ?e [*]) :where [?e attribute someValue]])

acron13:08:33

cheers sonnyto simple_smile