Skip to content

Instantly share code, notes, and snippets.

@cmcfarlen
Created May 23, 2018 20:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cmcfarlen/33d9a8f7e0f926db7d112326e7523792 to your computer and use it in GitHub Desktop.
Save cmcfarlen/33d9a8f7e0f926db7d112326e7523792 to your computer and use it in GitHub Desktop.
(let [url "datomic:mem://test-bigint" #_ "datomic:sql://test-bigint?jdbc:postgresql://192.168.99.100:5432/datomic?user=datomic&password=datomic"
_ (d/delete-database url)
_ (d/create-database url)
test-conn (d/connect url)
]
@(d/transact test-conn [{:db/ident :test/bigint
:db/cardinality :db.cardinality/one
:db/valueType :db.type/bigint
:db/unique :db.unique/identity}])
@(d/transact test-conn [{:test/bigint 1N} {:test/bigint (biginteger 2)} {:test/bigint 73018638354N} {:test/bigint (biginteger 73018638355)}])
(let [db (d/db test-conn)]
[(mapv #(d/q '[:find ?e .
:in $ ?v
:where
[?e :test/bigint ?v]] db %) [1N 2N 73018638354N 73018638355N (biginteger 1) (biginteger 2) (biginteger 73018638354N) (biginteger 73018638355N)])
(mapv #(d/entity db [:test/bigint %]) [1N 2N 73018638354N 73018638355N (biginteger 1) (biginteger 2) (biginteger 73018638354N) (biginteger 73018638355N)])
]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment