Skip to content

Instantly share code, notes, and snippets.

View rodnaph's full-sized avatar
🈲
On vacation

Rhodri Pugh rodnaph

🈲
On vacation
View GitHub Profile
@stuarthalloway
stuarthalloway / gist:2321773
Created April 6, 2012 18:15
Datomic schema query, constrained by attribute namespace
;; Datomic sample code
;; schema query for attribute types in specified namespaces
(q '[:find ?attr
:in $ [?include-ns ...] ;; bind ?include-ns once for each item in collection
:where
[?e :db/valueType] ;; all schema types (must have a valueType)
[?e :db/ident ?attr] ;; schema type name
[(datomic.Util/namespace ?attr) ?ns] ;; namespace of name
[(= ?ns ?include-ns)]] ;; must match one of the ?include-ns