Documentation/API for the Molecule library - a meta DSL for the Datomic database.
Molecule library - a Scala meta-DSL for the Datomic database.
See api package for various api imports to start using Molecule.
Public interface to be imported to use Molecule.
To make the Molecule macro materializations as fast as possible we try to
import as few macro implicits as possible. If your application code build molecules
with at the most 10 attributes, then you can do the following import to start using Molecule:
out means "output molecule" , and 10 the maximum arity or number of attributes
of your molecules.
If you use input molecules awaiting an input then you can add inX where X is
how many inputs (1, 2 or 3) you will use, for instance:
This way we keep the implicit macro def lookups to a minimum and compilation speed
as fast as possible.
Arities can be changed anytime you like. But not to a lower arity than that of the
molecules you use in scope of the import.
Synchronous getter methods to retrieve data from Datomic.
The Datomic On-Prem(ises) server model provides a Peer that returns data synchronously.
The Peer which lives in application memory caches data aggressively and for data
fitting in memory latency can be extremely low and queries return very fast. And
even when access to disk is needed, clever branching is used. Memcached is also
The Datomic Cloud model data returns data asynchronously. If Datomic creates a
Java API for the Cloud model, Molecule could relatively easy adapt to this model too.
In the meanwhile, Future-wrapped methods in this package can be used.
Molecule has 5 groups of synchronous getters, each returning data in various formats:
Getters in each of the 5 groups come with 5 time-dependent variations:
Each time variation has various overloads taking different parameters (see each group for more info).
equivalent asynchronous getters in the getAsync package.
Asynchronous getter methods to retrieve data from Datomic.
For convenience, all synchronous getter methods from the get package are here wrapped in Futures.
Molecule has 5 groups of asynchronous getters, each returning Futures of data in various formats:
equivalent synchronous getters in the get package.