datascript

Immutable database and Datalog query engine for Clojure, ClojureScript and JS
petterik 2018-07-01T01:27:57.000015Z

@mrchance that should work. I'm guessing the value you're looking for isn't the symbol foo, but rather what the value foo is bound to? Trying removing the quote before the vector. Is :unique/name set to unique in the schema?

(-> db :schema :unique/name)
;; should contain :db/unique with either 
;; :db.unique/identity or :db.unique/value

petterik 2018-07-01T01:28:31.000065Z

I think you also can use (d/entid db [:unique/name foo]) to get the id directly

2018-07-01T07:54:37.000023Z

@petterik thanks, I'll try that. I only need the id, and yes, it's unique in the schema