Created
November 12, 2019 19:12
-
-
Save Jaretbinford/aca34dbb977dc4d783dea5a61641dd8f to your computer and use it in GitHub Desktop.
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
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)) | |
#'tomhanks.tempid-tuple/client | |
user=> (d/list-databases client {}) | |
("datomic-docs-tutorial" "mbrainz-1968-1973") | |
user=> (d/create-database client {:db-name "jaret-tuples-1"}) | |
(def conn (d/connect client {:db-name "jaret-tuples-1"})) | |
true | |
user=> #'tomhanks.tempid-tuple/conn | |
user=> (def db (d/db conn)) | |
#'tomhanks.tempid-tuple/db | |
user=> (def jacobschema | |
[{:db/ident :episode-of-care/discharge-conditions | |
:db/doc "A list of [condition(ref), txn(ref)] tuples recorded at discharge." | |
:db/cardinality :db.cardinality/many | |
:db/valueType :db.type/tuple | |
:db/tupleTypes [:db.type/ref :db.type/ref]}]) | |
#'tomhanks.tempid-tuple/jacobschema | |
user=> (d/transact conn {:tx-data jacobschema}) | |
{:db-before {:database-id "5f1e2d0e-6fde-44d9-ba2b-8582e71eadd9", :db-name "jaret-tuples-1", :t 5, :next-t 6, :type :datomic.client/db}, :db-after {:database-id "5f1e2d0e-6fde-44d9-ba2b-8582e71eadd9", :db-name "jaret-tuples-1", :t 6, :next-t 7, :type :datomic.client/db}, :tx-data [#datom[13194139533318 50 #inst "2019-11-12T19:05:54.064-00:00" 13194139533318 true] #datom[73 10 :episode-of-care/discharge-conditions 13194139533318 true] #datom[73 63 "A list of [condition(ref), txn(ref)] tuples recorded at discharge." 13194139533318 true] #datom[73 41 36 13194139533318 true] #datom[73 40 64 13194139533318 true] #datom[73 67 [:db.type/ref :db.type/ref] 13194139533318 true] #datom[0 13 73 13194139533318 true]], :tempids {}} | |
user=> (def result | |
(d/transact conn {:tx-data | |
[[:db/add 13194139533354 | |
:episode-of-care/discharge-conditions [70738180084598536 "datomic.tx"]]]})) | |
#'tomhanks.tempid-tuple/result | |
user=> (:tx-data result) | |
[#datom[13194139533319 50 #inst "2019-11-12T19:05:57.279-00:00" 13194139533319 true] #datom[13194139533354 73 [70738180084598536 -9223358842714242486] 13194139533319 true]] | |
user=> (def conditionschema | |
[{:db/ident :condition/id | |
:db/doc "uuid" | |
:db/cardinality :db.cardinality/one | |
:db/valueType :db.type/uuid}]) | |
#'tomhanks.tempid-tuple/conditionschema | |
user=> (d/transact conn {:tx-data conditionschema}) | |
{:db-before {:database-id "5f1e2d0e-6fde-44d9-ba2b-8582e71eadd9", :db-name "jaret-tuples-1", :t 7, :next-t 8, :type :datomic.client/db}, :db-after {:database-id "5f1e2d0e-6fde-44d9-ba2b-8582e71eadd9", :db-name "jaret-tuples-1", :t 8, :next-t 9, :type :datomic.client/db}, :tx-data [#datom[13194139533320 50 #inst "2019-11-12T19:06:16.388-00:00" 13194139533320 true] #datom[74 10 :condition/id 13194139533320 true] #datom[74 63 "uuid" 13194139533320 true] #datom[74 41 35 13194139533320 true] #datom[74 40 54 13194139533320 true] #datom[0 13 74 13194139533320 true]], :tempids {}} | |
user=> (def result-2 | |
(d/transact conn {:tx-data [{:condition/id #uuid "f2253106-0f35-4298-8d44-7460595a4000" | |
:db/id "condition-1"} | |
[:db/add 13194139533377 :episode-of-care/discharge-conditions ["condition-1" "datomic.tx"]]]})) | |
#'tomhanks.tempid-tuple/result-2 | |
user=> (:tx-data result-2) | |
[#datom[13194139533321 50 #inst "2019-11-12T19:06:18.509-00:00" 13194139533321 true] #datom[22970996927496267 74 #uuid "f2253106-0f35-4298-8d44-7460595a4000" 13194139533321 true] #datom[13194139533377 73 [22970996927496267 13194139533321] 13194139533321 true]] | |
user=> | |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
;;563-8828 Tomhanks I cannot reproduce | |
user=> (d/create-database client {:db-name "jaret-tuples-4"}) | |
true | |
user=> (def conn (d/connect client {:db-name "jaret-tuples-4"})) | |
#'tomhanks.tempid-tuple/conn | |
user=> (def db (d/db conn)) | |
#'tomhanks.tempid-tuple/db | |
user=> (def jacobschema | |
[{:db/ident :episode-of-care/discharge-conditions | |
:db/doc "A list of [condition(ref), txn(ref)] tuples recorded at discharge." | |
:db/cardinality :db.cardinality/many | |
:db/valueType :db.type/tuple | |
:db/tupleTypes [:db.type/ref :db.type/ref]}]) | |
#'tomhanks.tempid-tuple/jacobschema | |
user=> (d/transact conn {:tx-data jacobschema}) | |
{:db-before {:database-id "f26c4649-a862-44a9-a941-43d456b55455", :db-name "jaret-tuples-4", :t 5, :next-t 6, :type :datomic.client/db}, :db-after {:database-id "f26c4649-a862-44a9-a941-43d456b55455", :db-name "jaret-tuples-4", :t 6, :next-t 7, :type :datomic.client/db}, :tx-data [#datom[13194139533318 50 #inst "2019-11-12T19:09:54.456-00:00" 13194139533318 true] #datom[73 10 :episode-of-care/discharge-conditions 13194139533318 true] #datom[73 63 "A list of [condition(ref), txn(ref)] tuples recorded at discharge." 13194139533318 true] #datom[73 41 36 13194139533318 true] #datom[73 40 64 13194139533318 true] #datom[73 67 [:db.type/ref :db.type/ref] 13194139533318 true] #datom[0 13 73 13194139533318 true]], :tempids {}} | |
user=> (def result | |
(d/transact conn {:tx-data | |
[[:db/add 13194139533354 | |
:episode-of-care/discharge-conditions [70738180084598536 "datomic.tx"]]]})) | |
#'tomhanks.tempid-tuple/result | |
user=> (:tx-data result) | |
[#datom[13194139533319 50 #inst "2019-11-12T19:09:59.021-00:00" 13194139533319 true] #datom[13194139533354 73 [70738180084598536 13194139533319] 13194139533319 true]] | |
user=> (def conditionschema | |
[{:db/ident :condition/id | |
:db/doc "uuid" | |
:db/cardinality :db.cardinality/one | |
:db/valueType :db.type/uuid}]) | |
#'tomhanks.tempid-tuple/conditionschema | |
user=> (d/transact conn {:tx-data conditionschema}) | |
{:db-before {:database-id "f26c4649-a862-44a9-a941-43d456b55455", :db-name "jaret-tuples-4", :t 7, :next-t 8, :type :datomic.client/db}, :db-after {:database-id "f26c4649-a862-44a9-a941-43d456b55455", :db-name "jaret-tuples-4", :t 8, :next-t 9, :type :datomic.client/db}, :tx-data [#datom[13194139533320 50 #inst "2019-11-12T19:10:11.742-00:00" 13194139533320 true] #datom[74 10 :condition/id 13194139533320 true] #datom[74 63 "uuid" 13194139533320 true] #datom[74 41 35 13194139533320 true] #datom[74 40 54 13194139533320 true] #datom[0 13 74 13194139533320 true]], :tempids {}} | |
user=> (def result-2 | |
(d/transact conn {:tx-data [{:condition/id #uuid "f2253106-0f35-4298-8d44-7460595a4000" | |
:db/id "condition-1"} | |
[:db/add 13194139533377 :episode-of-care/discharge-conditions ["condition-1" "datomic.tx"]]]})) | |
#'tomhanks.tempid-tuple/result-2 | |
user=> (:tx-data result-2) | |
[#datom[13194139533321 50 #inst "2019-11-12T19:10:16.868-00:00" 13194139533321 true] #datom[26542210694512715 74 #uuid "f2253106-0f35-4298-8d44-7460595a4000" 13194139533321 true] #datom[13194139533377 73 [26542210694512715 13194139533321] 13194139533321 true]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment