hyperphor.tunamelt.core

Public API (ClojureScript): as on the JVM, but every function returns a Promise. The default store is the IndexedDB database “tunamelt”.

configure!

(configure! {:keys [store realm]})

Set :store (a Store, or an IndexedDB database name) and/or :realm. Returns nil.

delete

(delete uri)

Promise of true if uri existed; deletes it and its history.

find

(find type)(find type opts)

Promise of {:uri :obj :meta} of type, newest first. opts as on the JVM: :realm, :since/:until (inst or epoch ms), :limit, :attrs {k v}.

get

(get uri)

Promise of the object at uri, or nil.

get-entry

(get-entry uri)

Promise of {:uri :obj :meta} for uri, or nil.

history

(history uri)

Promise of revisions of uri, newest first.

put

(put uri-or-type obj)(put uri-or-type obj opts)

Upsert obj at a URI, or at a new id under bare type. opts {:mode :mutable|:append-only}; mode is fixed at creation. Promise of {:uri :obj :meta}.

put-many

(put-many entries)

Put a seq of uri-or-type obj or uri-or-type obj opts in one transaction.

realm

(realm)

The configured default realm.

referrers

(referrers uri)(referrers uri opts)

Promise of entries (plus :attr) referring to uri, newest first. opts: :attr, :type.

refs

(refs uri)

Promise of the forward references of the object at uri: {attr uri …}.

types

(types)(types {:keys [realm counts?]})

Promise of a sorted seq of type names, or a sorted {type count} map with :counts?.