https://github.com/replikativ/datahike-client
A datahike remote client
https://github.com/replikativ/datahike-client
Last synced: 9 months ago
JSON representation
A datahike remote client
- Host: GitHub
- URL: https://github.com/replikativ/datahike-client
- Owner: replikativ
- License: epl-2.0
- Created: 2020-11-10T13:42:18.000Z (about 5 years ago)
- Default Branch: development
- Last Pushed: 2021-06-07T08:25:25.000Z (over 4 years ago)
- Last Synced: 2024-05-01T11:48:02.231Z (over 1 year ago)
- Language: Clojure
- Size: 52.7 KB
- Stars: 3
- Watchers: 4
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# datahike-client
Datahike Client is a library to interact with Datahike Server from your Clojure and
Clojurescript applications.
This project is early stage and considered instable. Expect changes to the API and
to the underlying parts.
## Usage
```
(require [datahike-client.api :as d]))
(defonce config {:timeout 300
:endpoint "http://localhost:3000"
:token "secret"
:db-name "config-test"})
(def client (d/client config))
(def connection (d/connect client (:db-name config)))
(d/transact connection {:db-name (:db-name config)
:tx-data [{:name "Alice", :age 20}
{:name "Bob", :age 30}
{:name "Charlie", :age 40}
{:age 15}]})
(d/q connection
{:query '[:find ?v
:where [_ :name ?v]]}) ; => [["Charlie"] ["Alice"] ["Bob"]]
```
Take a look at [cljdoc.org](https://cljdoc.org/d/io.replikativ/datahike-client).