Skip to content
Minimal project setup and initialization of Molecule to get started
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Molecule demo app

Try Molecule demo

See Molecule website for more info.

Clone this repo and play around:

  1. git clone
  2. cd molecule-demo
  3. sbt compile
  4. Open project in your IDE (you might need to refresh the SBT project within the IDE)
  5. Run DemoApp

Molecule in your own project

Add the following to your build files:




addSbtPlugin("org.scalamolecule" % "sbt-molecule" % "0.8.0")


lazy val yourProject ="demo"))
    resolvers ++= Seq(
      "datomic" at "",
      "clojars" at "",
    libraryDependencies ++= Seq(
      "org.scalamolecule" %% "molecule" % "0.18.3",
      "com.datomic" % "datomic-free" % "0.9.5697"
    moleculeSchemas := Seq("demo") // paths to your schema definition files...

(You might need to mark the lib folder as a library in your IDE so that it recognizes the created boilerplate class/source jars)

Molecule Schema creation workflow

Try and add a new attribute to the demo schema:

  1. In IDE: add val salary = oneDouble to the schema/YourDomainDefinition trait
  2. In terminal: sbt compile
  3. Update some code with the new attribute - copy this if you like:
// Load data
val johnId ="John").age(26).gender("male").salary(100000.00).save.eid

// Retrieve data
val (person, age, gender, salary) =

// Verify
s"$person is $age years old, $gender and earns $salary a year" ==
"John is 26 years old, male and earns 100000 a year"

Add more attributes and play around with queries...

You can’t perform that action at this time.