mpdairy / posh

A luxuriously simple and powerful way to make front-ends with DataScript and Reagent in Clojure.
Eclipse Public License 1.0
460 stars 45 forks source link

query doesn't work if I omit ':in $' #15

Open UrKr opened 7 years ago

UrKr commented 7 years ago

If this is the database: {:schema {}, :datoms [[1 :count 1 536870913]]}

(ns posh-todo.core
  (:require 
            [posh.reagent :as p]
            [datascript.core :as d]))

(d/q '[:find ?count :where [_ :count ?count]] @conn) ; -> #{[1]}
@(p/q '[:find ?count :where [_ :count ?count]] conn) ; -> #{}
@(p/q '[:find ?count :in $ :where [_ :count ?count]] conn) ; -> #{[1]}

So apparently I have to explicitly pass the database as an argument to the query when using posh, whereas datascript let's me omit it.