Packages

  • package root

    Documentation/API for the Molecule library - a meta DSL for the Datomic database.

    Manual | scalamolecule.org | Github | Forum

    Definition Classes
    root
  • package molecule

    Molecule library - a Scala 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.

    Sub-packages

    action Actions on molecules and entities.
    api Molecule import interfaces of various arities.
    ast Internal Molecule ASTs.
    boilerplate Internal interfaces for auto-generated DSL boilerplate code.
    composition    Builder methods to compose molecules.
    exceptions Exceptions thrown by Molecule.
    expression Attribute expressions and operations.
    facade Molecule facades to Datomic.
    factory Implicit macro methods `m` to instantiate molecules from custom DSL molecule constructs.
    generic Interfaces to generic information about datoms and Datomic database.
    input Input molecules awaiting input.
    macro Internal macros generating molecule code from custom DSL molecule constructs.
    ops Internal operational helpers for transforming DSL to molecule.
    schema Schema definition DSL.
    transform Internal transformers from DSL to Model/Query/Transaction.
    util Internal Java database functions for Datomic.

    Definition Classes
    root
  • package action

    Various actions and operations on molecules and entities.

    Various actions and operations on molecules and entities.

    Definition Classes
    molecule
  • package exception
    Definition Classes
    action
  • package get

    Package with various synchronous getter methods to retrieve data from Datomic with molecules.

    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 while loop
    • 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).

    Definition Classes
    action
  • GetArray
  • GetIterable
  • GetJson
  • GetList
  • GetRaw

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 while loop
  • 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
Linear Supertypes
AnyRef, Any
Content Hierarchy

Type Members

  1. 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 fast while loop.

  2. 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.

  3. 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 namespace Person with an attribute name we get:

    • "person.name"

    To distinguis fields of multiple relationships to the same namespace like friends and enemies pointing to other Person'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 tx too:

    • "tx.person.name"
    • "tx.friends.person.name"
    See also

    Json tests

  4. 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 (get instead of getList).

  5. 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.

Inherited from AnyRef

Inherited from Any

Ungrouped