This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-02-12
Channels
- # aatree (9)
- # admin-announcements (2)
- # alda (4)
- # announcements (2)
- # beginners (87)
- # boot (218)
- # braid-chat (14)
- # cbus (2)
- # cider (19)
- # cljs-dev (17)
- # cljsjs (1)
- # cljsrn (5)
- # clojure (84)
- # clojure-android (1)
- # clojure-czech (8)
- # clojure-ireland (3)
- # clojure-madison (20)
- # clojure-poland (22)
- # clojure-russia (54)
- # clojure-sanfrancisco (1)
- # clojurescript (81)
- # clojurewest (4)
- # community-development (94)
- # conf-proposals (5)
- # core-async (199)
- # css (3)
- # cursive (68)
- # datavis (2)
- # datomic (23)
- # dysphemism (138)
- # editors (7)
- # hoplon (8)
- # jobs (8)
- # jobs-discuss (7)
- # ldnclj (2)
- # liberator (6)
- # off-topic (32)
- # om (200)
- # omnext (2)
- # onyx (88)
- # proton (58)
- # re-frame (14)
- # reagent (1)
- # ring-swagger (26)
- # yada (14)
Hi. Is it possible to get-database-names
for datomic:mem://{host}:{port}/*
URI? I.e. is is possible for *mem* DB's? Throws an error for me, asking about *
in place of db name, but it's already there.
@andrewboltachev: works fine for me:
(d/get-database-names "datomic:mem://*")
("a" "b")
note that in process memory URI is just: datomic:mem://{db-name}
do datomic queries always return a set? or can i example, pull out a single value for an attribute?
Here for example, I'd like to avoid (first (first
but is the result of a query always a vector in a set? i don't mind having to pull things out, it just feels like im missing a trick
ffirst is useful
thanks dm3, that was the trick i was missing
is there a name for that ., documented somewhere?
a great
important to note that :find ?a .
will just return the first item, even if there are more results
thanks a lot!
@danielstockton: it’s worth mentioning that Datomic query doesn’t return a set of tuples by default just to be arbitrary. This behavior is the means by which you can compose queries. (It’s a similar story with SQL select and result tables/sets). That said, as others mentioned, for returning an (expected) single value or one collection, etc, that’s the exact use case that find specifications exist for.
Yep, understood. I actually tried implementing datalog on a toy project but didnt get into all the nitty gritty and special syntax
@currentoor: Not quite. sqUUIDs have leading bits making a timestamp with an accuracy of 1 second. Multiple d/squuid
s created within the same second will be randomly ordered. Also, clock on different peers may not be in sync, so the timestamps in the sqUUIDs generated on different peers may not reflect the order in which they were transacted.
@stuartsierra: Makes sense, thanks.
I have an id
attribute on entities and this attribute is only set when the entity is created and it is never updated. If I want to sort a collection of entities by created-at times, I guess I can use the transaction time of that id
attribute. Is this fine or is there a preferred way to do it?
@currentoor: that’s the approach I’d probably recommend (as long as you’re sure about the guarantee that it’s set at creation time and never changed), see answer here: http://stackoverflow.com/questions/24645758/has-entities-in-datomic-metadata-like-creation-and-update-time
@bkamphaus: sounds good, Thanks!