package get
Package with various synchronous getter methods to retrieve data from Datomic with molecules.
For the Datomic Peer model, Datomic returns data synchronously. The Peer lives in application memory and caches data aggressively to save roundtrips to disk or memcached. Query results that can fit in memory will therefore have near-zero latency and return extremely fast.
Molecule has not yet addressed the Client api although the query engine would be the same as for the current Peer version.
Molecule has 5 groups of getters each returning data in various formats:
- GetList - default getter returning Lists of tuples. Convenient typed data, suitable for smaller data sets
- GetArray - fastest retrieved typed data set. Can be traversed with a fast
whileloop - GetIterable - for lazily traversing row by row
- GetRaw - fastest retrieved raw un-typed data from Datomic
- GetJson - data formatted as Json string
Getters in each of the 5 groups come with 5 time-dependent variations:
- get [current data]
- getAsOf
- getSince
- getWith
- getHistory
Each time variation has various overloads taking different parameters (see each group for more info).
- Source
- package.scala
Type Members
-
trait
GetArray[Tpl] extends AnyRef
Data getter methods on molecules that return Array[Tpl].
Data getter methods on molecules that return Array[Tpl].
The fastest way of getting a typed data set. Can then be traversed with a fastwhileloop. -
trait
GetIterable[Tpl] extends AnyRef
Data getter methods on molecules that return Iterable[Tpl].
Data getter methods on molecules that return Iterable[Tpl].
Suitable for data sets that are lazily consumed. -
trait
GetJson extends AnyRef
Data getter methods on molecules that return a Json String.
Data getter methods on molecules that return a Json String.
Molecule builds a Json String directly from the untyped raw Datomic data.
Attributes names are used as Json field names. In order to distinguish fields from each other, all attribute names are prepended with the namespace name (in lowercase). For a namespacePersonwith an attributenamewe get:- "person.name"
To distinguis fields of multiple relationships to the same namespace like
friendsandenemiespointing to otherPerson's require us to add a relationship name prefix too:- "friends.person.name"
- "enemies.person.name"
Furthermore, if the attribute is part of a transaction meta-data molecule, we prefix that with
txtoo:- "tx.person.name"
- "tx.friends.person.name"
- See also
-
trait
GetList[Tpl] extends GetArray[Tpl]
Default data getter methods on molecules that return List[Tpl].
Default data getter methods on molecules that return List[Tpl].
For expected smaller result sets it's convenient to return Lists of tuples of data. Considered as the default getter, no postfix has been added (getinstead ofgetList). -
trait
GetRaw extends AnyRef
Data getter methods on molecules that return raw untyped Datomic data.
Data getter methods on molecules that return raw untyped Datomic data.
Returns raw untyped java.util.Collection[java.util.List[Object]] directly from Datomic and is therefore the fastest (but untyped) way of retrieving data. Can be useful where typed data is not needed.

Documentation/API for the Molecule library - a meta DSL for the Datomic database.
Manual | scalamolecule.org | Github | Forum