The ClojureScript client of stratus (Clojars com.stratus-db/client), for server-side callers (Node): transit-json requests (keywords, UUIDs and instants native), gzipped transit-json responses (fetch inflates them). Every function returns a js/Promise.
The hosted API (https://api.stratus-db.com), with an API key:
(def conn (client/connect "https://api.stratus-db.com" {:api-key (.-STRATUS_API_KEY js/process.env)})) (-> (client/create-db! conn {:name "orders" :primary-key :order/id}) (.then (fn [{:keys [id]}] (client/transact! conn id {:tx [{:order/id (client/squuid) :total 5}]}))))
Databases are at <url>/v1/dbs/<id>/..., the key sent as "Authorization: Bearer <key>". Busy databases answer 429: retried with backoff. The high-level functions resolve to the response body and reject with an ex-info {:status :error :message} on an error; call gives {:status :body} as it is. The query language: docs/query.md.
The ClojureScript client of stratus (Clojars com.stratus-db/client), for server-side callers
(Node): transit-json requests (keywords, UUIDs and instants native), gzipped transit-json
responses (fetch inflates them). Every function returns a js/Promise.
The hosted API (https://api.stratus-db.com), with an API key:
(def conn (client/connect "https://api.stratus-db.com" {:api-key (.-STRATUS_API_KEY js/process.env)}))
(-> (client/create-db! conn {:name "orders" :primary-key :order/id})
(.then (fn [{:keys [id]}] (client/transact! conn id {:tx [{:order/id (client/squuid) :total 5}]}))))
Databases are at <url>/v1/dbs/<id>/..., the key sent as "Authorization: Bearer <key>". Busy
databases answer 429: retried with backoff. The high-level functions resolve to the response
body and reject with an ex-info {:status :error :message} on an error; call gives
{:status :body} as it is. The query language: docs/query.md.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 |