Fork me on GitHub
#datomic
<
2016-12-22
>
grav07:12:17

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?

marshall13:12:09

@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

marshall13:12:36

Generally if you’re not in production it is easier to backup, delete the table entirely, recreate and restore

marshall13:12:40

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

robert-stuttaford15:12:32

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 😞

eggsyntax20:12:54

Anyone aware of a predicate that’ll return true for ordinary maps and EntityMaps, but not for vectors?

eggsyntax20:12:14

(map? my-entity-map) is false; (associative? vector) is true.

eggsyntax20:12:54

I can create a custom pred, of course, but I hate to do that on something intended as a general-purpose fn.

Alex Miller (Clojure team)21:12:57

#(instance? clojure.lang.ILookup %) will tell you whether it can do keyword lookup

eggsyntax21:12:41

Ooh, very nice.

Alex Miller (Clojure team)21:12:44

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

Alex Miller (Clojure team)21:12:49

(as there likely isn’t one)

eggsyntax21:12:02

No, keyword lookup was exactly what I was after. Thanks @alexmiller!

Alex Miller (Clojure team)21:12:35

map? corresponds to IPersistentMap (which implies things like persistence)

Alex Miller (Clojure team)21:12:00

associative? corresponds to Associative which is more about being able to look up val by key

eggsyntax21:12:22

Ah, and since you can look up items in vectors by index...

Alex Miller (Clojure team)21:12:04

if you have a datomic entity in hand, you can also look at what it implements with (supers (class entity))

eggsyntax21:12:23

Cool, wasn't aware of that one, thanks!

Alex Miller (Clojure team)21:12:44

kind of interesting to compare across different types

Alex Miller (Clojure team)21:12:57

there’s also some interesting class diagrams out there

eggsyntax21:12:04

Yeah, I'm going to end up doing that just to satisfy some curiosity 🙂

Alex Miller (Clojure team)21:12:35

and Stuart has something similar somewhere

Alex Miller (Clojure team)21:12:29

I found the latter particularly helpful before I had internalized a lot of that stuff

eggsyntax21:12:30

My new wallpaper 😉

jsimon22:12:34

Where can I find docs for older versions of datomic? Looking specifically for 0.9.5344