datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
richiardiandrea 2020-01-31T23:34:15.001500Z

Hi there - I am a newbie Datascript user and I have a newbie question :D I was wondering what is the equivalent of an entity identifier https://docs.datomic.com/on-prem/identity.html#entity-identifiers in Datascript

richiardiandrea 2020-01-31T23:34:33.002Z

and how I can use the pull-many function over an attribute that I declared unique

richiardiandrea 2020-01-31T23:47:56.002700Z

also, does Datascript support :keys as in:

(datascript/q '[:find ?guid-string
                :keys guid
                :where
                [_ :currency_code "CAD"]
                [?guid :guid ?guid-string]]
 @+conn2+)

richiardiandrea 2020-01-31T23:51:19.003500Z

this brings me closer to what I want - which is a list of entities with fields - but still not perfect:

(datascript/q '[:find (pull ?e [:guid :name :currency_code]) 
                :where
                [?e :currency_code "CAD"]]
  @+conn2+)

richiardiandrea 2020-01-31T23:52:24.004300Z

(sorry for the noise) to summarize I was wondering what is the best way to query by using Lookup Refs https://docs.datomic.com/on-prem/identity.html#lookup-refs