Liking cljdoc? Tell your friends :D

Get Started

This guide contains simple steps showing how to transact data and run a simple query. However, there are a few topics you might benefit from learning about before you get too far with attempting to use Crux:

  • EDN – the extensible data notation format used throughout the Crux APIs, see Essential EDN for Crux.

  • The Datalog query language – Crux supports an EDN-flavoured version of Datalog. The Queries section within this documentation provides a good overview. You can also find an interactive tutorial for EDN-flavoured Datalog here.

  • Clojure – whilst a complete Java API is provided, a basic understanding of Clojure is recommended – Clojure is a succinct and pragmatic data-oriented language with strong support for immutability and parallelism. See Clojure.org.

Setting Up

If you want to start playing about, it is advised you run Crux in a standalone configuration first.

Alternatively, if you just want to try using the REST API, follow these steps to use a self-contained demonstration image from Docker Hub and refer to the REST API section.

Transacting

link:./examples.clj[role=include]

Note that the ID for the Kafka transaction and the ID within the Crux document must be the same. Restating the ID within the Crux document is currently necessary although this may change in the future, as the standard API evolves.

Querying

link:./examples.clj[role=include]

You should get:

link:./examples.clj[role=include]

An entity query would be:

link:./examples.clj[role=include]

You should get:

link:./examples.clj[role=include]

Next Steps

Now you know the basics of how to interact with Crux you may want to dive into a tutorial or continue on to read about the kinds of things you are able to do with Queries.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close