Packages

  • package root

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

    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.

    Definition Classes
    root
  • package core
    Definition Classes
    molecule
  • package api
    Definition Classes
    core
  • package exception
    Definition Classes
    api
  • package getAsyncObj

    Asynchronous getter methods to retrieve data as objects.

    Asynchronous getter methods to retrieve data as objects.

    For convenience, all synchronous getter methods from the get package are here wrapped in Futures.

    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 an option.

    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 4 groups of asynchronous getters for objects, each returning Futures of data in various formats:

    • GetAsyncObjArray - fastest retrieved typed data set. Can be traversed with a fast while loop
    • GetAsyncObjIterable - for lazily traversing row by row
    • GetAsyncObjList - default getter returning Lists of objects. Convenient typed data, suitable for smaller data sets
    • GetAsyncRaw - fastest retrieved raw un-typed data from Datomic

    Getters in each of the 4 groups come with 5 time-dependent variations:

    • getAsync [current data]
    • getAsyncAsOf
    • getAsyncSince
    • getAsyncWith
    • getAsyncHistory

    Each time variation has various overloads taking different parameters (see each group for more info).

    Definition Classes
    api
    See also

    equivalent synchronous getters in the getTpl package.

  • GetAsyncObjArray
  • GetAsyncObjIterable
  • GetAsyncObjList
  • package getAsyncTpl

    Asynchronous getter methods to retrieve tuples of data.

    Asynchronous getter methods to retrieve tuples of data.

    For convenience, all synchronous getter methods from the get package are here wrapped in Futures.

    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 an option.

    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 4 groups of asynchronous getters for tuples, each returning Futures of data in various formats:

    • GetAsyncTplArray - fastest retrieved typed data set. Can be traversed with a fast while loop
    • GetAsyncTplIterable - for lazily traversing row by row
    • GetAsyncTplList - default getter returning Lists of tuples. Convenient typed data, suitable for smaller data sets
    • GetAsyncRaw - fastest retrieved raw un-typed data from Datomic

    Getters in each of the 4 groups come with 5 time-dependent variations:

    • getAsync [current data]
    • getAsyncAsOf
    • getAsyncSince
    • getAsyncWith
    • getAsyncHistory

    Each time variation has various overloads taking different parameters (see each group for more info).

    Definition Classes
    api
    See also

    equivalent synchronous getters in the getTpl package.

  • package getObj

    Synchronous getter methods to retrieve data as objects.

    Synchronous getter methods to retrieve data as objects.

    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 an option.

    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 3 groups of synchronous object getters, each returning data in various formats:

    • GetObjArray - fastest retrieved typed data set. Can be traversed with a fast while loop
    • GetObjIterable - for lazily traversing row by row
    • GetObjList - default getter returning Lists of objects. Convenient typed data, suitable for smaller data sets

    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
    api
    See also

    equivalent asynchronous getters in the getAsyncTpl package.

  • package getTpl

    Synchronous getter methods to retrieve data as tuples.

    Synchronous getter methods to retrieve data as tuples.

    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 an option.

    Molecule has 4 groups of synchronous tuple getters, each returning data in various formats:

    • GetTplArray - fastest retrieved typed data set. Can be traversed with a fast while loop
    • GetTplIterable - for lazily traversing row by row
    • GetTplList - default getter returning Lists of tuples. Convenient typed data, suitable for smaller data sets
    • GetRaw - fastest retrieved raw un-typed data from Datomic

    Getters in each of the 4 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
    api
    See also

    equivalent asynchronous getters in the getAsyncTpl package.

p

molecule.core.api

getAsyncObj

package getAsyncObj

Asynchronous getter methods to retrieve data as objects.

For convenience, all synchronous getter methods from the get package are here wrapped in Futures.

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 an option.

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 4 groups of asynchronous getters for objects, each returning Futures of data in various formats:

  • GetAsyncObjArray - fastest retrieved typed data set. Can be traversed with a fast while loop
  • GetAsyncObjIterable - for lazily traversing row by row
  • GetAsyncObjList - default getter returning Lists of objects. Convenient typed data, suitable for smaller data sets
  • GetAsyncRaw - fastest retrieved raw un-typed data from Datomic

Getters in each of the 4 groups come with 5 time-dependent variations:

  • getAsync [current data]
  • getAsyncAsOf
  • getAsyncSince
  • getAsyncWith
  • getAsyncHistory

Each time variation has various overloads taking different parameters (see each group for more info).

Source
getAsyncObj.scala
See also

equivalent synchronous getters in the getTpl package.

Linear Supertypes
AnyRef, Any

Type Members

  1. trait GetAsyncObjArray[Obj, Tpl] extends AnyRef

    Asynchronous data getter methods on molecules returning Future[Array[Obj]].

    Asynchronous data getter methods on molecules returning Future[Array[Obj]].

    The fastest way of getting a large typed data set since data is applied to a super fast pre-allocated Array. The Array can then be traversed with a fast while loop.

    Ns.int.insert(1, 2, 3)
    
    // Map over Future
    Ns.int.getAsyncObjArray.map { rowObjects =>
      rowObjects.map(_.int) === Array(1, 2, 3)
    
      // Fast while loop
      var i = 0
      val length = rowObjects.length
      while(i < length) {
        println(rowObjects(i).int) // Do stuff with row object...
        i += 1
      }
    }

    Each asynchronous getter in this package simply wraps the result of its equivalent synchronous getter (in the get package) in a Future. getAsyncObjArrayAsOf thus wraps the result of getObjArrayAsOf in a Future and so on.

  2. trait GetAsyncObjIterable[Obj, Tpl] extends AnyRef

    Asynchronous data getter methods on molecules returning Future[Iterable[Obj]].

    Asynchronous data getter methods on molecules returning Future[Iterable[Obj]].

    Suitable for data sets that are lazily consumed.

    for {
      personsIterable <- Person.name.age.getAsyncObjIterable
    } yield {
      val firstPerson = personsIterable.iterator.next
      firstPerson.name === "Ben"
      firstPerson.age  === 42
    }

    Each asynchronous getter in this package simply wraps the result of its equivalent synchronous getter in a Future. getAsyncObjIterableAsOf thus wraps the result of getObjIterableAsOf in a Future and so on.

  3. trait GetAsyncObjList[Obj, Tpl] extends AnyRef

    Default asynchronous data getter methods on molecules returning Future[List[Obj]].

    Default asynchronous data getter methods on molecules returning Future[List[Obj]].

    For expected smaller result sets it's convenient to return Lists of objects of data.

    for {
      persons <- Person.name.age.getAsyncObjList
    } yield {
      persons.map(p => s"${p.name} is ${p.age} years old")) === List(
        "Ben is 42 years old",
        "Liz is 37 years old"
      )
    }

    Each asynchronous getter in this package simply wraps the result of its equivalent synchronous getter in a Future. getAsyncObjListAsOf thus wraps the result of getObjListAsOf in a Future and so on.

Inherited from AnyRef

Inherited from Any

Ungrouped