Learn Datomic Datalog

This interactive website will help you learn how to query a Datomic database using Datalog.

Datalog is a declarative, logic-based query language. Like SQL, you describe what you want rather than how to find it. Unlike SQL, Datalog works by matching patterns against facts, making it a natural fit for Datomic's data model. By the end of this guide you will be able to filter, aggregate, and traverse relationships across a real database of all 151 original Pokémon.

Click the "Run" button below to run your first Datomic Datalog query.

[:find ?name :where [?entity :pokemon/type "Grass"] [?entity :pokemon/name ?name]]

Try editing the query above to return Pokemon of other types like Fire or Electric.

Next