11. Simplifying Datomic Syntax by Writing a DSL

The context here is that creating schema and writing inserts for Datomic are unnecessarily verbose, especially for people who think in Clojure. The idea is to take advantage of this “expressiveness gap” and use Clojure to write a DSL to make writing Datomic schema and inserts less verbose. We’ll reduce and map over Clojure maps to generate the Datomic syntax for schema creation and adding datoms. Instead of using the Datomic shell, we’ll use an in-memory version of Datomic that we access from Clojure.

Assumptions

In this chapter we assume the following:

Image You have Leiningen installed.

Using the ...

Get Clojure Recipes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.