hyperphor.tunamelt.core

Public API: put/get/find/delete/history of JSON-able objects under hyperphor://realm/type/id URIs.

ClojureScript (IndexedDB) API docs: cljs/index.html.

configure!

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

Set :store (a Store, or a SQLite path string) and/or :realm. Returns nil.

delete

(delete uri)

Delete uri and its history. Returns true if it existed.

find

(find type)(find type opts)

Seq of {:uri :obj :meta} of type, newest first. opts: :realm, :since/:until (inst or epoch ms), :limit, :attrs {k v} where v is a scalar (matches any value), a vector (must contain all), or nil (attr absent).

get

(get uri)

Return the object at uri, or nil.

get-entry

(get-entry uri)

Return {:uri :obj :meta} for uri, or nil.

history

(history uri)

Revisions of uri, newest first (a single entry for :mutable objects).

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. Returns {:uri :obj :meta}. Keyword values read back as strings.

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)

Entries (plus :attr) of objects referring to uri, newest first. opts: :attr, :type.

refs

(refs uri)

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

types

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

Sorted seq of stored type names, or a sorted {type count} map if :counts? is true. opts: :realm limits to one realm.