package api
- Alphabetic
- Public
- All
Type Members
-
trait
GetJson[Obj, Tpl] extends JavaUtil
Data getter methods on molecules that return data as a Json String.
Data getter methods on molecules that return data as a Json String.
Attributes names are used as Json field names. -
trait
GetObjs[Obj, Tpl] extends AnyRef
Data getter methods on molecules that return data as Lists of objects with attribute properties.
Data getter methods on molecules that return data as Lists of objects with attribute properties.
Attributes names are used as object property names. -
trait
Molecule extends AnyRef
Base Molecule interface.
-
abstract
class
Molecule_0[Obj, Tpl] extends Marshalling[Obj, Tpl] with CastTypes with CastAggr with CastOptNested with JsonTypes with JsonAggr with JsonOptNested with GetTpls[Obj, Tpl] with GetObjs[Obj, Tpl] with GetJson[Obj, Tpl] with ShowInspect[Obj, Tpl] with Helpers
Core molecule interface defining actions that can be called on molecules.
Core molecule interface defining actions that can be called on molecules.
Groups of interfaces:
get Get molecule data. getAsOf Get molecule data asOf point in time. getSince Get molecule data since point in time. getWith Get molecule data with given data set. getHistory Get molecule data from history of database. save Save molecule with applied data. insert Insert multiple rows of data matching a molecule. update Update molecule with applied data. tx Molecule transaction data (input to `getWith`). inspect get Inspect calling get method on molecule. inspect operation Inspect calling save/insert/update method on molecule. - Tpl
Type of molecule (tuple of its attribute types)
- See also
For retract ("delete") methods, see molecule.datomic.base.api.EntityOps and molecule.datomic.base.api.DatomicEntity.
-
abstract
class
Molecule_1[Obj, I1] extends InputMolecule
Shared interfaces of input molecules awaiting 1 input.
Shared interfaces of input molecules awaiting 1 input.
// Input molecule awaiting 1 input for `name` val ageOfPersons = m(Person.name_(?).age) for { // Sample data set _ <- Person.name.age insert List( ("Joe", 42), ("Liz", 34) ) // Resolve input molecule with name input in various ways _ <- ageOfPersons("Joe").get.map(_ ==> List(42)) _ <- ageOfPersons("Joe", "Liz").get.map(_ ==> List(42, 34)) _ <- ageOfPersons("Joe" or "Liz").get.map(_ ==> List(42, 34)) _ <- ageOfPersons(Seq("Joe", "Liz")).get.map(_ ==> List(42, 34)) } yield ()
- I1
Type of input matching attribute with
?marker
-
abstract
class
Molecule_2[Obj, I1, I2] extends InputMolecule
Shared interfaces of input molecules awaiting 2 inputs.
Shared interfaces of input molecules awaiting 2 inputs.
// Input molecule awaiting 2 inputs for `profession` and `age` val profAge = m(Person.name.profession_(?).age_(?)) for { // Sample data set _ <- Person.name.profession.age insert List( ("Ann", "doctor", 37), ("Ben", "teacher", 37), ("Joe", "teacher", 32), ("Liz", "teacher", 28) ) // A. Pairs of input ................................. // One pair as params _ <- profAge("doctor", 37).get.map(_ ==> List("Ann")) // One or more pairs _ <- profAge(("doctor", 37)).get.map(_ ==> List("Ann")) _ <- profAge(("doctor", 37), ("teacher", 37)).get.map(_.sorted ==> List("Ann", "Ben")) // One or more logical pairs // [pair-expression] or [pair-expression] or ... _ <- profAge(("doctor" and 37) or ("teacher" and 32)).get.map(_.sorted ==> List("Ann", "Joe")) _ <- profAge(Seq(("doctor", 37), ("teacher", 37))).get.map(_.sorted ==> List("Ann", "Ben")) // List of pairs _ <- profAge(Seq(("doctor", 37))).get.map(_ ==> List("Ann")) // B. 2 groups of input, one for each input attribute ................................. // Two expressions // [profession-expression] and [age-expression] _ <- profAge("doctor" and 37).get.map(_ ==> List("Ann")) _ <- profAge(("doctor" or "teacher") and 37).get.map(_.sorted ==> List("Ann", "Ben")) _ <- profAge(("doctor" or "teacher") and (32 or 28)).get.map(_.sorted ==> List("Joe", "Liz")) // Two Lists _ <- profAge(Seq("doctor"), Seq(37)).get.map(_ ==> List("Ann")) _ <- profAge(Seq("doctor", "teacher"), Seq(37)).get.map(_.sorted ==> List("Ann", "Ben")) _ <- profAge(Seq("teacher"), Seq(37, 32)).get.map(_.sorted ==> List("Ben", "Joe")) _ <- profAge(Seq("doctor", "teacher"), Seq(37, 32)).get.map(_.sorted ==> List("Ann", "Ben", "Joe")) } yield ()
- I1
Type of input matching first attribute with
?marker (profession: String)- I2
Type of input matching second attribute with
?marker (age: Int)
-
abstract
class
Molecule_3[Obj, I1, I2, I3] extends InputMolecule
Shared interfaces of input molecules awaiting 3 inputs.
Shared interfaces of input molecules awaiting 3 inputs.
// Input molecule awaiting 3 inputs for `profession`, `age` and `score` val profAgeScore = m(Person.name.profession_(?).age_(?).score_(?)) for { // Sample data set Person.name.profession.age.score insert List( ("Ann", "doctor", 37, 1.0), ("Ben", "teacher", 37, 1.0), ("Joe", "teacher", 32, 1.0), ("Liz", "teacher", 28, 2.0) ) // A. Triples of input ................................. // One triple as params _ <- profAgeScore.apply("doctor", 37, 1.0).get.map(_ ==> List("Ann")) // One or more triples _ <- profAgeScore.apply(("doctor", 37, 1.0)).get.map(_ ==> List("Ann")) _ <- profAgeScore.apply(("doctor", 37, 1.0), ("teacher", 37, 1.0)).get.map(_.sorted ==> List("Ann", "Ben")) // One or more logical triples // [triple-expression] or [triple-expression] or ... _ <- profAgeScore.apply(("doctor" and 37 and 1.0) or ("teacher" and 32 and 1.0)).get.map(_.sorted ==> List("Ann", "Joe")) // List of triples _ <- profAgeScore.apply(Seq(("doctor", 37, 1.0))).get.map(_ ==> List("Ann")) _ <- profAgeScore.apply(Seq(("doctor", 37, 1.0), ("teacher", 37, 1.0))).get.map(_.sorted ==> List("Ann", "Ben")) // B. 3 groups of input, one for each input attribute ................................. // Three expressions // [profession-expression] and [age-expression] and [score-expression] _ <- profAgeScore.apply("doctor" and 37 and 1.0).get.map(_ ==> List("Ann")) _ <- profAgeScore.apply(("doctor" or "teacher") and 37 and 1.0).get.map(_.sorted ==> List("Ann", "Ben")) _ <- profAgeScore.apply(("doctor" or "teacher") and (37 or 32) and 1.0).get.map(_.sorted ==> List("Ann", "Ben", "Joe")) _ <- profAgeScore.apply(("doctor" or "teacher") and (37 or 32) and (1.0 or 2.0)).get.map(_.sorted ==> List("Ann", "Ben", "Joe")) // Three lists _ <- profAgeScore.apply(Seq("doctor"), Seq(37), Seq(1.0)).get.map(_ ==> List("Ann")) _ <- profAgeScore.apply(Seq("doctor", "teacher"), Seq(37), Seq(1.0)).get.map(_.sorted ==> List("Ann", "Ben")) } yield ()
- I1
Type of input matching first attribute with
?marker (profession: String)- I2
Type of input matching second attribute with
?marker (age: Int)- I3
Type of input matching third attribute with
?marker (score: Double)
- trait TxBundles extends Helpers with BooPicklers
-
trait
TxFunctions extends AnyRef
Transactional methods for bundled transactions and tx functions
Value Members
- object Keywords extends Keywords
-
object
Molecule_0
Arity 1-22 molecule implementation interfaces.
-
object
Molecule_1
Implementations of input molecules awaiting 1 input, output arity 1-22
-
object
Molecule_2
Implementations of input molecules awaiting 2 inputs, output arity 1-22
-
object
Molecule_3
Implementations of input molecules awaiting 3 inputs, output arity 1-22
-
object
OptionalMapOps extends OptionalMapOps
Optional implicit operations for optional Map attributes
Optional implicit operations for optional Map attributes
Is not imported in the default Molecule api imports since they are rather specialized. If needed, they can be made available with the following aditional import:
import molecule.api.optionalMapOps._ import molecule.datomic.api._ // Standard api import with any arity
Since this is a rather specialized
- object TxFunctions extends Helpers with JavaUtil

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