Created
June 28, 2019 14:15
-
-
Save viebel/2aa5135e80a995b002dd279e972c530b to your computer and use it in GitHub Desktop.
datascript inside Klipse http://app.klipse.tech/?eval_only=1&external-libs=[%22https://raw.githubusercontent.com/Zetawar/datascript/macrovich/src/%22]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(require '[datascript.core :as d]) | |
(let [schema {:aka {:db/cardinality :db.cardinality/many}} | |
conn (d/create-conn schema)] | |
(d/transact! conn [ { :db/id -1 | |
:name "Maksim" | |
:age 45 | |
:aka ["Max Otto von Stierlitz", "Jack Ryan"] } ]) | |
(d/q '[ :find ?n ?a | |
:where [?e :aka "Max Otto von Stierlitz"] | |
[?e :name ?n] | |
[?e :age ?a] ] | |
@conn)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment