Liking cljdoc? Tell your friends :D

merkle-db.record

Core record specs and functions.

Core record specs and functions.
raw docstring

decode-entryclj

(decode-entry lexicoder id-field [rkey data])

Merge a record entry with an encoded key into a record data map with the decoded id in associated key fields.

Merge a record entry with an encoded key into a record data map with the
decoded id in associated key fields.
raw docstring

encode-entryclj

(encode-entry lexicoder id-field record)

Project a map of record data into an entry with the encoded key and a data map with the key fields removed.

Project a map of record data into an entry with the encoded key and a data
map with the key fields removed.
raw docstring

family-groupsclj

(family-groups families data)

Build a map from family keys to maps which contain the field data for the corresponding family. Fields not grouped in a family will be added to :base. Families which had no data will have an entry with a nil value, except :base which will be an empty map.

Build a map from family keys to maps which contain the field data for the
corresponding family. Fields not grouped in a family will be added to
`:base`. Families which had no data will have an entry with a `nil` value,
except `:base` which will be an empty map.
raw docstring

field-mergerclj

(field-merger spec)

Construct a new record updating function from the given merge spec. The resulting function accepts three arguments, the record id, the existing record data (or nil), and the new record data map.

If the merge spec is a function, it will be called with (f field-key old-val new-val) for each field in the record and the field-key will be set to the resulting value.

If the merge spec is a map, the keys will be used to look up a merge function for each field in the record, which will be called with (f old-val new-val). If a field has no entry in the spec, the new value is always used.

Construct a new record updating function from the given merge spec. The
resulting function accepts three arguments, the record id, the existing
record data (or nil), and the new record data map.

If the merge spec is a function, it will be called with
`(f field-key old-val new-val)` for each field in the record and the
field-key will be set to the resulting value.

If the merge spec is a map, the keys will be used to look up a merge function
for each field in the record, which will be called with `(f old-val new-val)`.
If a field has no entry in the spec, the new value is always used.
raw docstring

project-idclj

(project-id id-field record)

Projects a record into its uniquely-identifying value.

Projects a record into its uniquely-identifying value.
raw docstring

split-dataclj

(split-data families records)

Split new record values into collections grouped by family. Each configured family and :base will have an entry in the resulting map, containing a vector of record keys to new values. The values may be nil if the record had no data for that family, an empty map if the family is :base and all the record's data is in other families, or a map of field data belonging to that family.

{:base [[#merkle-db/key "00" {:a 123}] ...]
 :bc [[#merkle-db/key "00" {:b true, :c "cat"}] ...]
 ...}
Split new record values into collections grouped by family. Each configured
family and `:base` will have an entry in the resulting map, containing a
vector of record keys to new values. The values may be `nil` if the record
had no data for that family, an empty map if the family is `:base` and all
the record's data is in other families, or a map of field data belonging to
that family.

```
{:base [[#merkle-db/key "00" {:a 123}] ...]
 :bc [[#merkle-db/key "00" {:b true, :c "cat"}] ...]
 ...}
```
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close