This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-06-01
Channels
- # beginners (133)
- # boot (59)
- # cider (5)
- # cljs-dev (30)
- # cljsrn (23)
- # clojure (212)
- # clojure-austin (3)
- # clojure-brasil (1)
- # clojure-chicago (5)
- # clojure-italy (10)
- # clojure-russia (5)
- # clojure-serbia (1)
- # clojure-spec (34)
- # clojure-turkiye (2)
- # clojure-uk (132)
- # clojurescript (163)
- # clojutre (1)
- # cursive (5)
- # datomic (58)
- # emacs (42)
- # events (1)
- # graphql (26)
- # hoplon (16)
- # jobs (1)
- # lumo (27)
- # numerical-computing (3)
- # off-topic (127)
- # om (9)
- # onyx (24)
- # re-frame (20)
- # reagent (20)
- # ring-swagger (14)
- # sql (19)
- # unrepl (28)
- # untangled (3)
- # vim (8)
- # yada (17)
I'm having trouble writing a seemingly simple query... I have a bunch of tuples
[<id1> :category :x]
[<id1> :value 100]
[<id2> :category :y]
[<id2> :value 200]
[<id3> :category :x]
[<id3> :value 300]
I want to count how many ids I have of each category. So I want to get back something like {:x 2 :y 1}
. How do I write this query?[:find ?category (count ?categorised) :where [?categorised :category ?category]]
Can I do this on multiple attributes simultaneously? That is, a query that would return {:category {:x 2 :y 1} :color {:blue 3 :red 5} :shape {:square 2 :ellipse 6}}
? Or is that better done in multiple queries?
(ds/q
'[:find ?a ?v (count ?e)
:in $ [?a ...]
:where [?e ?a ?v]]
@conn [:exchange/to-unit :exchange/from-unit])
=>
([:exchange/from-unit 11 36]
[:exchange/to-unit 6 3]
[:exchange/to-unit 11 40]
[:exchange/from-unit 35 1]
[:exchange/to-unit 4 1]
[:exchange/from-unit 101 1]
[:exchange/from-unit 9 4]
[:exchange/from-unit 105 1]
[:exchange/from-unit 4 9]
[:exchange/to-unit 35 12]
[:exchange/from-unit 31 2]
[:exchange/from-unit 57 1]
[:exchange/from-unit 103 1]
[:exchange/to-unit 72 1]
[:exchange/to-unit 24 8]
[:exchange/to-unit 57 6]
[:exchange/from-unit 24 1])
why not give it a try? if you don’t get it right, multiple queries is fine. i find i prefer multiple smaller, focused queries
Yup. I just gave it a few tries, but got back various cross products. I think I'll stick to the multiple smaller queries. Thanks.
yep, that’s one of the reasons why i prefer what i do - i can reason about them, heh
hello, for a "on premise" setup, I was considering postgresql as storage for datomic.. but then just read this post https://blog.clubhouse.io/using-datomic-heres-how-to-move-from-postgresql-to-dynamodb-local-79ad32dae97f about moving from postgres. Are there other opinions/docs about recommendations for on premise / small (few users, one host) datomic setup? latest/stable postgresql versions would probably be ok, right? or some other storage is more "native/optimized" to datomic implementation? it would be usefull to know current statistics "on premise" choices, if those could be shared some how.. perhaps by a poll?
is it sufficient to backup underlying SQL storage for production, or should the datomic backup-db from-db-uri to-backup-uri
feature be used?
@devth Backing up the storage backs up everything (i.e. all datomic databases in the table and all segments, including possible garbage segments) and cannot be moved to a different kind of storage. backup-db backs up a datomic db at a time, does not backup unused nodes (if not an incremental backup), and can be restored to arbitrary storages
so they have different abilities and tradeoffs. Whether storage-only backup is sufficient for you depends on what you need
basic guarantees about not losing data is really all i need at this point. we use Cloud SQL, which has an Automatic Backups feature. ideally i enable this and not have to worry about doing backup-db
.
my dim memories of mysql admin were that innodb never gave up filespace, even if it was optimized and compacted
sometimes when we do a big import, or delete a bunch of large datomic dbs, we will drop the table and restoredb everything
ah, ok. cool, good to know. i think i'll start with Automated Backups then later maybe setup backup-db
if and when I need it
I didn't think it was possible to intercept the hostname construction done by backup/restore
we would really like to just backup to google cloud storage directly. We've asked for that feature for years
but we had some zero-length segments once that caused silent db corruption, so we stopped
I don't see a feature request for Google Cloud Storage backups on http://receptive.io
if i have multiple instances listen to the same transaction queue, will the message be duplicated across instances or does reading it take it off the queue
sorry, meant to ask in here: https://clojurians.slack.com/archives/C03S1KBA2/p1496351133966888