Save form middleware for Datalevin database adapter.
Save form middleware for Datalevin database adapter.
(append-to-raw-txn env forms)Append native Datalevin transaction forms to the save environment.
forms is a sequential collection of raw Datalevin transaction operations
(e.g. [[:db/ensuremy.ns/open? "acct"]]`) that will be appended to the
generated transaction for each affected schema during the save.
Intended for use by save middleware wrapping wrap-datalevin-save: modify the
env before delegating to the datalevin save handler. See dlo/raw-txn.
NOTE: In a multi-schema save the forms are appended to each schema's transaction; reference entities that exist within a single schema.
Append native Datalevin transaction forms to the save environment. `forms` is a sequential collection of raw Datalevin transaction operations (e.g. `[[:db/ensure `my.ns/open? "acct"]]`) that will be appended to the generated transaction for each affected schema during the save. Intended for use by save middleware wrapping `wrap-datalevin-save`: modify the env before delegating to the datalevin save handler. See `dlo/raw-txn`. NOTE: In a multi-schema save the forms are appended to each schema's transaction; reference entities that exist within a single schema.
(delta->txn env delta)Convert RAD form delta to Datalevin transaction data.
Arguments:
Returns vector of Datalevin transaction operations.
Convert RAD form delta to Datalevin transaction data. Arguments: - env: environment map with ::attr/key->attribute - delta: RAD form delta map Returns vector of Datalevin transaction operations.
(keys-in-delta delta)Extract all keys from delta
Extract all keys from delta
(save-form! env {:com.fulcrologic.rad.form/keys [delta]})Do all of the possible datalevin operations for the given form delta (save to all datalevin databases involved).
Any native Datalevin transaction forms accumulated under dlo/raw-txn in the
env (e.g. [:db/ensure ...] post-conditions) are appended to each affected
schema's transaction. See append-to-raw-txn.
Do all of the possible datalevin operations for the given form delta (save to all datalevin databases involved). Any native Datalevin transaction forms accumulated under `dlo/raw-txn` in the env (e.g. `[:db/ensure ...]` post-conditions) are appended to each affected schema's transaction. See `append-to-raw-txn`.
(schemas-for-delta {:com.fulcrologic.rad.attributes/keys [key->attribute]}
delta)Extract all schemas referenced in delta
Extract all schemas referenced in delta
(tempid->result-id tx-result delta)Extract the mapping from tempids to real ids from transaction result.
Extract the mapping from tempids to real ids from transaction result.
(wrap-datalevin-save)(wrap-datalevin-save handler)Form save middleware to accomplish datalevin saves.
Form save middleware to accomplish datalevin saves.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |