This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-12-22
Channels
- # adventofcode (1)
- # beginners (172)
- # boot (47)
- # cider (7)
- # cljs-dev (30)
- # cljsrn (43)
- # clojure (180)
- # clojure-dusseldorf (1)
- # clojure-greece (1)
- # clojure-italy (3)
- # clojure-russia (41)
- # clojure-spec (67)
- # clojure-uk (101)
- # clojurescript (128)
- # core-async (4)
- # cursive (13)
- # datomic (29)
- # devcards (5)
- # emacs (19)
- # events (1)
- # hoplon (38)
- # lein-figwheel (1)
- # luminus (8)
- # midje (1)
- # off-topic (47)
- # om (10)
- # onyx (23)
- # protorepl (1)
- # re-frame (11)
- # reagent (7)
- # ring (3)
- # ring-swagger (9)
- # rum (6)
- # sql (5)
- # untangled (4)
It seems that datomic.api/delete-db
does not free up the disk space. Does the API support freeing up the disk space, or do I need to delete the db
directory by hand?
@grav What storage are you using? You’re correct that delete-db does not reclaim the disk space. You need to run gc-deleted-dbs : http://docs.datomic.com/capacity.html#storage-size (very bottom) Then depending on your storage you’ll need to run compaction/vacuum/etc
Generally if you’re not in production it is easier to backup, delete the table entirely, recreate and restore
The other thing to keep in mind about disk space usage is that you need to run gcStorage periodically http://docs.datomic.com/capacity.html#garbage-collection on live databases to remove garbage segments
remember to use get-database-list to see what other dbs you have. i’ve deleted the http://www.stuttaford.me/codex database more than once doing that 😞
Anyone aware of a predicate that’ll return true for ordinary maps and EntityMaps, but not for vectors?
I can create a custom pred, of course, but I hate to do that on something intended as a general-purpose fn.
#(instance? clojure.lang.ILookup %)
will tell you whether it can do keyword lookup
if that’s not exactly what you need, I would consider writing a predicate that describes exactly the traits you expect to use rather than trying to figure out some common parent
(as there likely isn’t one)
No, keyword lookup was exactly what I was after. Thanks @alexmiller!
map?
corresponds to IPersistentMap
(which implies things like persistence)
associative?
corresponds to Associative
which is more about being able to look up val by key
if you have a datomic entity in hand, you can also look at what it implements with (supers (class entity))
kind of interesting to compare across different types
there’s also some interesting class diagrams out there
and Stuart has something similar somewhere
I found the latter particularly helpful before I had internalized a lot of that stuff