spicerack.core

assoc!

(assoc! m k v)

Write the key/value pair (k,v) to hashmap m. Returns v.

close

(close db)

Close this db.

commit

(commit db)

Commit pending changes to this database.

database-default-opts

dissoc!

(dissoc! m k)

Remove key k from hashmap m. Returns the removed value.

get-db

(get-db data-structure)

Get this data-structure instance’s underlying database. Useful if one wants to call commit in a context where the data-structure is in scope but DB is not.

open-database

(open-database filename & params)

Open a MapDB database backed by filename, attempting to create filename’s parent directories if needed. See database-default-opts for the defaults.

open-hashmap

(open-hashmap db hashmap-name & params)

Create or re-open a MapDB hashmap named hashmap-name in db. Params are: :key-serializer and :value-serializer to select serializers for keys and/or values (this is done for performance).

put!

Deprecated! Use assoc! instead. This is an alias for backwards compatibility.

remove!

Deprecated! Use dissoc! instead. This is an alias for backwards compatibility.

rollback

(rollback db)

Rollback pending changes to this database.

serializers

Lookup table of serializer types for MapDB. These are used as optional hints for the database to improve performance while serializing objects.

update!

(update! m k f & args)

Calls function f with the current value associated with k in hashmap m as the parameter, then writes the result back to m. If k has not yet been set, it’s previous value will be nil. Returns the value written.