trait Molecule_Factory2 extends AnyRef
Implicit molecule factory methods of arity 1-22.
Molecules are type-safe custom Scala models of data structures in a Datomic database.
Molecules are build with your custom meta-DSL that is auto-generated from your Schema Definition file.
Calling m
on your modelled DSL structure lets Molecule macros create a custom molecule,
ready for retrieving or manipulating data in the Datomic database.
Each molecule consists of one or more attributes that can have values or expressions applied.
The arity of a molecule is determined by the number of attributes that will return data when the
molecule is queried against the Datomic database. Attributes returning data are called "output attributes".
For brevity, only arity 1 and 2 method signatures are shown. Arity 3-22 follow the same pattern.
- Source
- Molecule_Factory.scala
- See also
- Grouped
- Alphabetic
- By Inheritance
- Molecule_Factory2
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- implicit final macro def m[A, B](dsl: NS02[A, B]): Molecule02[A, B]
Macro creation of molecule from user-defined DSL structure with 2 output attributes.
Macro creation of molecule from user-defined DSL structure with 2 output attributes.
Molecules can be created explicitly or implicitly by building a DSL structure using boilerplate code generated from the schema definition file.
The builder pattern is used to add one or more attributes to an initial namespace likePerson
from the example below. Once the molecule models the desired data structure we can call various actions on it, likeget
that retrieves matching data from the database.
Data structures are returned as tuples of values type-safely matching the molecule attribute types// Explicitly calling `m` to create Person molecule with 2 attributes m(Person.name.age).get.head === ("Ben", 42) // Molecule implicitly created so we can call `get` Person.name.age.get.head === ("Ben", 42)
- A
Type of output attribute 1 (
name
: String)- B
Type of output attribute 2 (
age
: Int)- dsl
User-defined DSL structure modelling the molecule
- returns
Molecule of arity-2 typed to two attributes (Molecule02[A, B])
- implicit final macro def m[A](dsl: NS01[A]): Molecule01[A]
Macro creation of molecule from user-defined DSL structure with 1 output attribute.
Macro creation of molecule from user-defined DSL structure with 1 output attribute.
Molecules can be created explicitly or implicitly by building a DSL structure using boilerplate code generated from the schema definition file.
The builder pattern is used to add one or more attributes to an initial namespace likePerson
from the example below. Once the molecule models the desired data structure we can call various actions on it, likeget
that retrieves matching data from the database.// Explicitly calling `m` to create Person molecule with 1 output attribute m(Person.name).get === List("Ben") // Molecule implicitly created so we can call `get` Person.name.get.head === "Ben"
For arity-many molecules, data structures are returned as tuples. But for arity-1 molecules (like the example having only 1 output attribute,
name
) there's no need for a tuple, so values type-safely matching the attribute are returned directly in the list.- A
Type of output attribute 1 (
name
: String)- dsl
User-defined DSL structure modelling the molecule
- returns
Molecule of arity-1 typed to first attribute (Molecule01[A])
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
Documentation/API for the Molecule library - a meta DSL for the Datomic database.
Manual | scalamolecule.org | Github | Forum