Created
November 10, 2017 14:12
-
-
Save Jaretbinford/922646038534a17c7e7d9131f0097578 to your computer and use it in GitHub Desktop.
testing limit nil
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 releasetest.limit) | |
(require '[datomic.api :as d]) | |
(d/get-database-names "datomic:dev://localhost:4334/*") | |
(def uri "datomic:dev://localhost:4334/mbrainz-1968-1973") | |
(def conn (d/connect uri)) | |
(def db (d/db conn)) | |
(d/q '[:find ?e ?a ?name | |
:where [?e :track/artists ?a] | |
[?a :artist/name "Led Zeppelin"] | |
[?a :artist/name ?name]] | |
db) | |
(def test-data | |
[{:db/id (d/tempid :db.part/user) | |
:track/name "testing" | |
:track/artists 747667906901339} | |
]) | |
(d/transact conn test-data) | |
(def conn (d/connect uri)) | |
(def db (d/db conn)) | |
(def led-zeppelin [:artist/gid #uuid "678d88b2-87b0-403b-b63d-5da7465aecc3"]) | |
(d/pull db '[{(limit :track/_artists nil) [:track/name]}] | |
led-zeppelin) | |
(let [uri "datomic:dev://localhost:4334/mbrainz-1968-1973" | |
conn (d/connect uri)] | |
(time (dotimes [_ 1000] | |
(let [more-tracks {:db/id (d/tempid :db.part/user) | |
:track/name (str (java.util.UUID/randomUUID)) | |
:track/artists 747667906901339}] | |
@(d/transact conn [more-tracks]))))) | |
(def conn (d/connect uri)) | |
(def db (d/db conn)) | |
;;works and returns 1,130 track names, so over 1,000 | |
(d/pull db '[{(limit :track/_artists nil) [:track/name]}] | |
led-zeppelin) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment