cruxをスタンドアローンrocksdbで動かす
deps.edn
code:clojure
{:deps {juxt/crux {:mvn/version "19.07-1.1.1-alpha"}
org.rocksdb/rocksdbjni {:mvn/version "5.17.2"}}}
config
code:clojure
(def ^crux.api.ICruxAPI system
(crux/start-standalone-system {:kv-backend "crux.kv.rocksdb.RocksKv"
:db-dir "data/db-dir-1"
:event-log-dir "data/eventlog-1"}))
rocksdbjniをdepsに足す
:kv-backendに"crux.kv.rocksdb.RocksKv"を指定する
:db-dir, :event-log-dirにデータを書く場所を指定する
データを書くと
code:clojure
(crux/submit-tx
system
[[:crux.tx/put
{:crux.db/id :clojure.company/toyokumo
:name "cstap"
:address "Tamachi"}
[:crux.tx/put
{:crux.db/id :clojure.company/toyokumo
:name "cstap"
:address "Gotanda"}
[:crux.tx/put
{:crux.db/id :clojure.company/toyokumo
:name "toyokumo"
:address "Gotanda"}
ファイルが現れる
https://gyazo.com/80cf4f2dc44316e52b0d7bf0d7e6f634