The clj.intracel.kv-store.interface
namespace defines polylith a interface for the KV-Store.
Generally, this is the namespace users of the KV-Store will put in their [[require]] statement
to use the component.
The `clj.intracel.kv-store.interface` namespace defines polylith a interface for the KV-Store. Generally, this is the namespace users of the KV-Store will put in their [[require]] statement to use the component.
(create-kv-store-context ctx-opts)
Starts up the KV-Store context which hosts the embedded database.
| Parameter | Description |
| ------------|-------------|
| ctx-opts
| Map containing options to adjust the behavior of the environment at start-up.|
| | | :Key: | :Description: |
| | | -------------------------------------------------| --------------|
| | | :intracel.kv-store/type
| Used to determine which type of data store to create. Currently only option is :lmdb
.|
| | | :intracel.kv-store.lmdb/keyspace-max-mem-size
| The total size (in bytes) allowed. |
| | | :intracel.kv-store.lmdb/num-dbs
| The number of independent, concurrent DB objects to support.|
| | | :intracel.kv-store.lmdb/storage-path
| Local filesystem path where the data will be persisted to disk.||
Returns: A [[clj.intracel.api.interface.protocols/KVStoreContext]] with the :ctx and :db-ctxs fields set.
Starts up the KV-Store context which hosts the embedded database. | Parameter | Description | | ------------|-------------| | `ctx-opts` | Map containing options to adjust the behavior of the environment at start-up.| | | | :Key: | :Description: | | | | -------------------------------------------------| --------------| | | | `:intracel.kv-store/type` | Used to determine which type of data store to create. Currently only option is `:lmdb`.| | | | `:intracel.kv-store.lmdb/keyspace-max-mem-size` | The total size (in bytes) allowed. | | | | `:intracel.kv-store.lmdb/num-dbs` | The number of independent, concurrent DB objects to support.| | | | `:intracel.kv-store.lmdb/storage-path` | Local filesystem path where the data will be persisted to disk.|| Returns: A [[clj.intracel.api.interface.protocols/KVStoreContext]] with the :ctx and :db-ctxs fields set.
(db kvs-db-ctx db-name)
(db kvs-db-ctx db-name chan-opts)
(db kvs-db-ctx db-name chan-opts db-opts)
(db kvs-db-ctx
db-name
chan-opts
db-opts
pre-del-hook-fn
pre-get-hook-fn
pre-put-hook-fn)
Returns a hosted embedded database. See clj.intracel.api.interface.protocols/KVStoreDbiApi
.
Depends on: create-kv-store-db-context
Returns a hosted embedded database. See [[clj.intracel.api.interface.protocols/KVStoreDbiApi]]. Depends on: [[create-kv-store-db-context]]
(kv-del kvs-db key)
(kv-del kvs-db key key-serde)
Removes a key and its corresponding value from the KV-Store. This is a multi-arity function with the 2-parameter version using the default SerDe (see set-key-serde
), and the 3-parameter version allowing the caller to provide its own key SerDe. See [[clj.intracel.api.kv-store/KVStoreDb]].
Depends on: db
Removes a key and its corresponding value from the KV-Store. This is a multi-arity function with the 2-parameter version using the default SerDe (see [[set-key-serde]]), and the 3-parameter version allowing the caller to provide its own key SerDe. See [[clj.intracel.api.kv-store/KVStoreDb]]. Depends on: [[db]]
(kv-get kvs-db key)
(kv-get kvs-db key key-serde val-serde)
Gets a value from the KV-Store. If set, the pre-get-hook
fn will be called on the key provided. This is a multi-arity function with the 2-parameter version using the default SerDe (see set-key-serde
, set-val-serde
) and the 4-parameter version allowing the caller to provide its own key and value SerDes. See [[clj.intracel.api.kv-store/KVStoreDb]].
Depends on: db
Gets a value from the KV-Store. If set, the `pre-get-hook` fn will be called on the key provided. This is a multi-arity function with the 2-parameter version using the default SerDe (see [[set-key-serde]], [[set-val-serde]]) and the 4-parameter version allowing the caller to provide its own key and value SerDes. See [[clj.intracel.api.kv-store/KVStoreDb]]. Depends on: [[db]]
(kv-put kvs-db key value)
(kv-put kvs-db key value key-serde val-serde)
Puts a value into the KV-Store.
This is a multi-arity function with the 3-parameter version using the default SerDe (see set-key-serde
, set-val-serde
) and the 5-parameter version allowing the caller to provide its own key and value SerDes. See [[clj.intracel.api.kv-store/KVStoreDb]].
Depends on: db
.
Puts a value into the KV-Store. This is a multi-arity function with the 3-parameter version using the default SerDe (see [[set-key-serde]], [[set-val-serde]]) and the 5-parameter version allowing the caller to provide its own key and value SerDes. See [[clj.intracel.api.kv-store/KVStoreDb]]. Depends on: [[db]].
(kv-put-async kvs-db key value)
(kv-put-async kvs-db key value key-serde val-serde)
Puts a value into the KV-Store asynchronously returning a core.async channel that can be used to check when the put completes.
This is a multi-arity function with the 3-parameter version using the default SerDe (see set-key-serde
, set-val-serde
) and the 5-parameter version allowing the caller to provide its own key and value SerDes. See [[clj.intracel.api.kv-store/KVStoreDb]].
Depends on: db
.
Puts a value into the KV-Store asynchronously returning a core.async channel that can be used to check when the put completes. This is a multi-arity function with the 3-parameter version using the default SerDe (see [[set-key-serde]], [[set-val-serde]]) and the 5-parameter version allowing the caller to provide its own key and value SerDes. See [[clj.intracel.api.kv-store/KVStoreDb]]. Depends on: [[db]].
Polymorphic constructor for producing a specific implementation that will be assigned to the :ctx
field in the [[clj.intracel.api.interface.protocols/KVStoreContext]].
This function requires the ctx-opts map to contain the :intracel.kv-store/type
field and will determine the correct implementation to generate based on the value provided.
Parameter | Description |
---|---|
ctx-opts | Map containing options to adjust the behavior of the environment at start-up. |
Returns:
A data structure to be assigned to the :ctx
field in the [[clj.intracel.api.interface.protocols/KVStoreContext]]
Polymorphic constructor for producing a specific implementation that will be assigned to the `:ctx` field in the [[clj.intracel.api.interface.protocols/KVStoreContext]]. This function requires the ctx-opts map to contain the `:intracel.kv-store/type` field and will determine the correct implementation to generate based on the value provided. | Parameter | Description | | ------------|-------------| | `ctx-opts` | Map containing options to adjust the behavior of the environment at start-up.| | | | :Key: | :Description: | | | | -------------------------------------------------| --------------| | | | `:intracel.kv-store/type` | Used to determine which type of data store to create. Currently only option is `:lmdb`.| | | | `:intracel.kv-store.lmdb/keyspace-max-mem-size` | The total size (in bytes) allowed. | | | | `:intracel.kv-store.lmdb/num-dbs` | The number of independent, concurrent DB objects to support.| | | | `:intracel.kv-store.lmdb/storage-path` | Local filesystem path where the data will be persisted to disk.|| Returns: A data structure to be assigned to the `:ctx` field in the [[clj.intracel.api.interface.protocols/KVStoreContext]]
(set-key-serde kvs-db key-serde)
Sets the default key SerDe used for serializing and deserializing to and from the database. See [[clj.intracel.api.kv-store/KVStoreDb]].
Depends on: db
Sets the default key SerDe used for serializing and deserializing to and from the database. See [[clj.intracel.api.kv-store/KVStoreDb]]. Depends on: [[db]]
(set-pre-del-hook kvs-db pre-fn)
This enables the caller to customize the behavior performed when doing a key removal in kv-del
by allowing caller code to pre-process the key. See [[clj.intracel.api.kv-store/KVStoreDb]].
Depends on: db
This enables the caller to customize the behavior performed when doing a key removal in [[kv-del]] by allowing caller code to pre-process the key. See [[clj.intracel.api.kv-store/KVStoreDb]]. Depends on: [[db]]
(set-pre-get-hook kvs-db pre-fn)
This enables the caller to customize the behavior performed when doing a key look-up in kv-get
by allowing caller code to pre-process the key. See [[clj.intracel.api.kv-store/KVStoreDb]].
Depends on: db
This enables the caller to customize the behavior performed when doing a key look-up in [[kv-get]] by allowing caller code to pre-process the key. See [[clj.intracel.api.kv-store/KVStoreDb]]. Depends on: [[db]]
(set-pre-put-hook kvs-db pre-fn)
This enables the caller to customize the behavior performed when writing a key/value paire in kv-put
or kv-put-async
by allowing caller code to pre-process the key and value. See [[clj.intracel.api.kv-store/KVStoreDb]].
Depends on: db
This enables the caller to customize the behavior performed when writing a key/value paire in [[kv-put]] or [[kv-put-async]] by allowing caller code to pre-process the key and value. See [[clj.intracel.api.kv-store/KVStoreDb]]. Depends on: [[db]]
(set-val-serde kvs-db val-serde)
Sets the default value SerDe used for serializing and deserializing to and from the database. See [[clj.intracel.api.kv-store/KVStoreDb]].
Depends on: db
Sets the default value SerDe used for serializing and deserializing to and from the database. See [[clj.intracel.api.kv-store/KVStoreDb]]. Depends on: [[db]]
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close