Datalevin (LMDB) implementation of hive-spi.kg.protocol/IKGStore. Schema, value-type map, db-path and cache-limit are injected by the host — the store carries no domain schema or config resolution of its own.
Datalevin (LMDB) implementation of hive-spi.kg.protocol/IKGStore. Schema, value-type map, db-path and cache-limit are injected by the host — the store carries no domain schema or config resolution of its own.
(create-store &
[{:keys [db-path base-schema extra-schema value-type-map
recovery-policy cache-limit]}])Create a Datalevin-backed IKGStore.
opts:
:db-path (required) on-disk LMDB directory
:base-schema DataScript-shaped KG schema map, injected by the host
:extra-schema per-store schema additions, merged over base-schema
:value-type-map attr -> :db/valueType overrides (default
default-value-type-map)
:cache-limit bounds the Datalog index-cache LRU forwarded to get-conn;
nil leaves upstream behaviour untouched
:recovery-policy forwarded to recovery/heal-and-open!
{:strategy :throw|:audit|:truncate|:quarantine|[..]
:max-attempts pos-int}
Config/schema resolution is the host's responsibility — this fn does not read env or config.edn. Returns nil on construction failure (rescue-wrapped).
Create a Datalevin-backed IKGStore.
opts:
:db-path (required) on-disk LMDB directory
:base-schema DataScript-shaped KG schema map, injected by the host
:extra-schema per-store schema additions, merged over base-schema
:value-type-map attr -> :db/valueType overrides (default
`default-value-type-map`)
:cache-limit bounds the Datalog index-cache LRU forwarded to get-conn;
nil leaves upstream behaviour untouched
:recovery-policy forwarded to `recovery/heal-and-open!`
{:strategy :throw|:audit|:truncate|:quarantine|[..]
:max-attempts pos-int}
Config/schema resolution is the host's responsibility — this fn does not read
env or config.edn. Returns nil on construction failure (rescue-wrapped).DataScript attribute -> Datalevin :db/valueType. The host may override or extend via create-store's :value-type-map. Attributes absent here keep the translated schema's inferred type.
DataScript attribute -> Datalevin :db/valueType. The host may override or extend via create-store's :value-type-map. Attributes absent here keep the translated schema's inferred type.
(translate-schema ds-schema value-type-map)Translate a DataScript-shaped schema to a Datalevin schema, stamping
:db/valueType from value-type-map where present and dropping :db/doc.
Translate a DataScript-shaped schema to a Datalevin schema, stamping :db/valueType from `value-type-map` where present and dropping :db/doc.
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 |