Idiomatic Clojure client for ScrivaDB.
Functions take and return plain Clojure maps; streaming RPCs (find, watch,
aggregate, snapshot) return lazy seqs. Every call carries the x-api-key
gRPC metadata automatically.
(require '[scriva.client :as scriva])
(let [db (scriva/connect {:host "localhost" :port 5433 :api-key "dev-key"})]
(scriva/create-collection db "users")
(let [id (scriva/insert db "users" {"name" "Alice" "age" 30})]
(println (get-in (scriva/find-by-id db "users" id) [:data "name"])))
(scriva/close db))
Idiomatic Clojure client for ScrivaDB.
Functions take and return plain Clojure maps; streaming RPCs (find, watch,
aggregate, snapshot) return lazy seqs. Every call carries the `x-api-key`
gRPC metadata automatically.
(require '[scriva.client :as scriva])
(let [db (scriva/connect {:host "localhost" :port 5433 :api-key "dev-key"})]
(scriva/create-collection db "users")
(let [id (scriva/insert db "users" {"name" "Alice" "age" 30})]
(println (get-in (scriva/find-by-id db "users" id) [:data "name"])))
(scriva/close db))End-to-end example mirroring the Java client's BasicExample: connect, manage collections, CRUD, keyed CRUD + CAS (N1), keyset pagination + multi-field ordering (N3), aggregations (N4), and a lazy-seq watch.
Requires a running server (make run from the repo root). Run with:
lein run -m scriva.example
End-to-end example mirroring the Java client's BasicExample: connect, manage collections, CRUD, keyed CRUD + CAS (N1), keyset pagination + multi-field ordering (N3), aggregations (N4), and a lazy-seq watch. Requires a running server (`make run` from the repo root). Run with: lein run -m scriva.example
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 |