This file contains hidden or 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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;Rules I implemented to test. Results show that using any clojure core function in a rule results in an error | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;I created one without any clojure core function. It worked. | |
(def all2 | |
'[[(item-info ?type ?sku ?color ?size) | |
[?item :inv/type ?type] | |
[?item :inv/sku ?sku] | |
[?item :inv/color ?color] | |
[?item :inv/size ?size] |
This file contains hidden or 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
RESULTS: | |
=> #'datomic.or.join/db | |
(d/q '[:find ?id :in $ ?l [?d ...] | |
:where | |
(or-join [?e ?l ?d] [?e :resource/label ?l] [?e :resource/description ?d]) | |
[?e :resource/id ?id] ] | |
db "label 1" ["desc1"]) | |
=> [[123] [124]] | |
(d/q '[:find ?id :in $ ?l [?d ...] |
This file contains hidden or 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
;;Transactor | |
$ bin/transactor ~/Downloads/support-logs/1932-workframe/dev-transactor.properties | |
Launching with Java options -server -Xms1g -Xmx1g -XX:+UseG1GC -XX:MaxGCPauseMillis=50 | |
Starting datomic:dev://0.0.0.0:4334/<DB-NAME>, storing data in: data ... | |
System started datomic:dev://0.0.0.0:4334/<DB-NAME>, storing data in: data | |
;;Connecting with a REPL from datomic distribution: | |
$ bin/repl | |
Clojure 1.9.0 | |
user=> (require '[datomic.api :as d]) |
This file contains hidden or 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
(ns datomic-db | |
(:require [datomic.api :as d])) | |
(def schema-tx [{:db/ident :person/id | |
:db/cardinality :db.cardinality/one | |
:db/unique :db.unique/identity | |
:db/valueType :db.type/string} | |
{:db/ident :person/dept | |
:db/cardinality :db.cardinality/one |
This file contains hidden or 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
;First transaction | |
(d/transact conn {:tx-data [{:db/ident :account/id | |
:db/valueType :db.type/uuid | |
:db/cardinality :db.cardinality/one | |
:db/unique :db.unique/identity | |
:db/doc "foo"}]}) | |
=> | |
{:db-before {:database-id "datomic:dev://localhost:4334/mbrainz-1968-1973", | |
:db-name "mbrainz", |
This file contains hidden or 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
535-8812 SOLO: | |
;;TEMP ID in TUPLE does not RESOLVE: see `-9223358842714242486` | |
user=> (def cfg {:server-type :ion | |
:region "us-east-1" ;; e.g. us-east-1 | |
:system "toy-solo-4" | |
:endpoint "http://entry.toy-solo-4.us-east-1.datomic.net:8182/" | |
:proxy-port 8182}) | |
#'tomhanks.tempid-tuple/cfg | |
user=> (def client (d/client cfg)) |
OlderNewer