Packages

o

molecule.api

in1_out2

object in1_out2 extends core with Molecule_Factory2 with Molecule_In_1_Factory2 with CompositeInserts with Composite_Factory2 with Composite_In_1_Factory2

Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. in1_out2
  2. Composite_In_1_Factory2
  3. Composite_Factory2
  4. CompositeInserts
  5. Helpers
  6. Molecule_In_1_Factory2
  7. Molecule_Factory2
  8. core
  9. EntityOps
  10. LogicImplicits
  11. AggregateKeywords
  12. AttrExpressions
  13. Datomic
  14. AnyRef
  15. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. type ?? = expression.AttrExpressions.?
    Definition Classes
    AttrExpressions
  2. trait avg extends AnyRef

    Average of attribute values.

    Average of attribute values.

    Apply avg keyword to attribute to return average of attribute values of entities matching the molecule.

    Match.score.insert(1, 2, 4)
    Match.score(avg).get.head === 2.3333333333333335 // (1 + 2 + 4) / 3
    returns

    Double

    Definition Classes
    AggregateKeywords
  3. trait count extends AnyRef

    Count of attribute values.

    Count of attribute values.

    Apply count keyword to attribute to return count of attribute values of entities matching the molecule.

    Person.firstName.lastName.age insert List(
      ("Ben", "Hayday", 42),
      ("Liz", "Taylor", 34),
      ("Liz", "Swifty", 34),
      ("Liz", "Mooray", 25)
    )
    Person.firstName.age(count).get === List(
      ("Ben", 1),
      ("Liz", 3) // 34, 34, 25
    )
    returns

    Int

    Definition Classes
    AggregateKeywords
  4. trait countDistinct extends AnyRef

    Count of distinct attribute values.

    Count of distinct attribute values.

    Apply countDistinct keyword to attribute to return count of distinct attribute values of entities matching the molecule.

    Person.firstName.lastName.age insert List(
      ("Ben", "Hayday", 42),
      ("Liz", "Taylor", 34),
      ("Liz", "Swifty", 34),
      ("Liz", "Mooray", 25)
    )
    Person.firstName.age(countDistinct).get === List(
      ("Ben", 1),
      ("Liz", 2) // 34, 25
    )
    returns

    Int

    Definition Classes
    AggregateKeywords
  5. trait distinct extends AnyRef

    Distinct attribute values.

    Distinct attribute values.

    Apply distinct keyword to attribute to return Vector of distinct attribute values of entities matching the molecule.

    Person.firstName.lastName.age insert List(
      ("Ben", "Hayday", 42),
      ("Liz", "Taylor", 34),
      ("Liz", "Swifty", 34),
      ("Liz", "Mooray", 25)
    )
    Person.firstName.age(distinct) insert List(
      ("Ben", 42),
      ("Liz", Vector(34, 25)) // only single 34 returned
    )
    returns

    List[attribute-type]

    Definition Classes
    AggregateKeywords
  6. trait max extends AnyRef

    Maximum attribute value(s).

    Maximum attribute value(s).

    Apply max keyword to attribute to return the maximum attribute value of entities matching the molecule.

    Person.age.insert(25, 34, 37, 42, 70)
    Person.age(max).get.head === 70

    Apply max(n) to return Vector of the n biggest values.

    Person.age(max(3)).get.head === Vector(37, 42, 70)
    Definition Classes
    AggregateKeywords
    Note

    max/max(n) supports all value types (via comparators).
    max(n) Can at most return the number of values that match.

  7. trait maxs extends AnyRef
    Definition Classes
    AggregateKeywords
  8. trait median extends AnyRef

    Median of attribute values.

    Median of attribute values.

    Apply median keyword to attribute to return median of attribute values of entities matching the molecule.

    Match.score.insert(1, 2, 4)
    Match.score(median).get.head === 2

    OBS: When it comes to an even number of values, Datomic has a special implementation of median that is different from the one described on the Wiki entry on the median function.

    Datomic calculates the median of even number of values as the average of the two middle numbers rounded down to nearest whole number

    Match.score.insert(1, 2, 3, 4)
    Match.score(median).get.head === 2 // (2 + 3) / 2 = 2.5 rounded down to 2

    With decimal numbers this can go wrong:

    Match.score.insert(1.0, 2.5, 2.5, 3.0)
    Match.score(median).get.head === 2 // (2.5 + 2.5) / 2 = 2.5 rounded down to 2 (This is wrong and bug report has been filed)
    returns

    Value of Attribute type

    Definition Classes
    AggregateKeywords
  9. trait min extends AnyRef

    Minimum attribute value(s).

    Minimum attribute value(s).

    Apply min keyword to attribute to return the minimum attribute value of entities matching the molecule.

    Person.age.insert(25, 34, 37, 42, 70)
    Person.age(min).get.head === 25

    Apply min(n) to return Vector of the n smallest values.

    Person.age(min(3)).get.head === Vector(25, 34, 37)
    Definition Classes
    AggregateKeywords
    Note

    min/min(n) supports all value types (via comparators).
    min(n) Can at most return the number of values that match.

  10. trait mins extends AnyRef
    Definition Classes
    AggregateKeywords
  11. trait rand extends AnyRef

    Random attribute value(s).

    Random attribute value(s).

    Apply random keyword to attribute to return a single random attribute of entities matching the molecule.

    Person.age.insert(25, 34, 37, 42, 70)
    Person.age(random).get.head === 34 // or other..

    Apply random(n) to return Vector of n random values. Observe though that duplicate random values can re-occur.

    Person.age(random(3)).get.head === Vector(42, 25, 42) // or other..

    To get distinct values only, use the sample(n) keyword instead.

    Definition Classes
    AggregateKeywords
  12. trait rands extends AnyRef
    Definition Classes
    AggregateKeywords
  13. trait sample extends AnyRef

    Sample attribute value(s).

    Sample attribute value(s).

    Apply sample keyword to attribute to return a single sample (random) attribute value of entities matching the molecule.

    Person.age.insert(25, 34, 37, 42, 70)
    Person.age(sample).get.head === 42 // or other..

    Apply sample(n) to return Vector of up to n distinct sample values.

    Person.age(sample(3)).get.head === Vector(70, 25, 37) // or other..

    If values don't need to be distinct, random(n) can be used also.

    Definition Classes
    AggregateKeywords
    Note

    Can at most return the number of values that match.

  14. trait samples extends AnyRef
    Definition Classes
    AggregateKeywords
  15. trait stddev extends AnyRef

    Variance of attribute values.

    Variance of attribute values.

    Apply stddev keyword to attribute to return variance of attribute values of entities matching the molecule.

    Match.score.insert(1, 2, 4)
    Match.score(stddev).get.head === 1.247219128924647
    returns

    Double

    Definition Classes
    AggregateKeywords
  16. trait sum extends AnyRef

    Sum of attribute values.

    Sum of attribute values.

    Apply sum keyword to attribute to return sum of attribute values of entities matching the molecule.

    Match.score.insert(1, 2, 4)
    Match.score(sum).get.head === 7
    returns

    Value of Attribute type

    Definition Classes
    AggregateKeywords
  17. trait variance extends AnyRef

    Variance of attribute values.

    Variance of attribute values.

    Apply variance keyword to attribute to return variance of attribute values of entities matching the molecule.

    Match.score.insert(1, 2, 4)
    Match.score(variance).get.head === 1.5555555555555556
    returns

    Double

    Definition Classes
    AggregateKeywords
  18. trait ? extends AnyRef

    Turn molecule into input molecule awaiting input.

    Turn molecule into input molecule awaiting input.

    Apply input marker ? to attribute to turn molecule into an 'input molecule'.

    At runtime the input molecule expects input for the attribute in place of the ? marker.

    // Input molecule created at compile time.
    val ageOfPersons = m(Person.name_(?).age) // awaiting name of type String
    
    // At runtime, "Ben" is applied as input replacing the `?` placeholder and we can get the age.
    ageOfPersons("Ben").get === List(42)
    Definition Classes
    AttrExpressions
    Note

    Data can only be retrieved from input molecules once they have been resolved with input.
    Input molecule queries are cached and optimized by Datomic.

  19. trait AttrExpr[Ns, T] extends AnyRef

    Expression methods common for all attributes.

    Expression methods common for all attributes.

    Definition Classes
    AttrExpressions
  20. trait FulltextSearchExpr[Ns, In] extends AnyRef

    Expression methods of String attributes with fulltext search.

    Expression methods of String attributes with fulltext search.

    Definition Classes
    AttrExpressions
  21. trait ManyAttrExpr[Ns, Add, OldNew, Rem] extends AnyRef

    Value update methods for card-many attributes.

    Value update methods for card-many attributes.

    Definition Classes
    AttrExpressions
  22. trait ManyExpr[Ns, In, T] extends ValueAttrExpr[Ns, In, T] with ManyAttrExpr[Ns, T, (T, T), T]

    Expression methods of card-many attributes.

    Expression methods of card-many attributes.

    Definition Classes
    AttrExpressions
  23. trait ManyRefAttrExpr[Ns, In] extends AttrExpr[Ns, Long] with ManyAttrExpr[Ns, Long, (Long, Long), Long]

    Expression methods of card-many ref attributes.

    Expression methods of card-many ref attributes.

    Definition Classes
    AttrExpressions
  24. trait MapAttrExpr[Ns, In, T] extends ValueAttrExpr[Ns, In, T] with ManyAttrExpr[Ns, (String, T), (String, T), String]

    Expression methods of map attributes.

    Expression methods of map attributes.

    Definition Classes
    AttrExpressions
  25. trait OneExpr[Ns, In, T] extends ValueAttrExpr[Ns, In, T]

    Expression methods of card-one attributes.

    Expression methods of card-one attributes.

    Definition Classes
    AttrExpressions
  26. trait OneRefAttrExpr[Ns, In] extends AttrExpr[Ns, Long]

    Expression methods of card-one ref attributes.

    Expression methods of card-one ref attributes.

    Definition Classes
    AttrExpressions
  27. trait OptionalExpr[Ns, T] extends AnyRef

    Expression methods of optional attributes.

    Expression methods of optional attributes.

    Definition Classes
    AttrExpressions
  28. trait ValueAttrExpr[Ns, In, T] extends AttrExpr[Ns, T]

    Expression methods of value attributes.

    Expression methods of value attributes.

    Definition Classes
    AttrExpressions
  29. trait unify extends AnyRef

    Unify attribute value in self-join.

    Unify attribute value in self-join.

    Apply unify marker to attribute to unify its value with previous values of the same attribute in the molecule in a self-join.

    m(Person.age.name.Beverages * Beverage.name.rating) insert List(
        (23, "Joe", List(("Coffee", 3), ("Cola", 2), ("Pepsi", 3))),
        (25, "Ben", List(("Coffee", 2), ("Tea", 3))),
        (23, "Liz", List(("Coffee", 1), ("Tea", 3), ("Pepsi", 1))))
    
    // What beverages do pairs of 23- AND 25-year-olds like in common?
    // Drink name is unified - Joe and Ben both drink coffee, etc..
    Person.age_(23).name.Beverages.name._Ns.Self
          .age_(25).name.Beverages.name_(unify).get.sorted === List(
      ("Joe", "Coffee", "Ben"),
      ("Liz", "Coffee", "Ben"),
      ("Liz", "Tea", "Ben")
    )
    Definition Classes
    AttrExpressions

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. implicit final def bigDec2Model(v: BigDecimal): TermValue[BigDecimal]

    Definition Classes
    LogicImplicits
  6. implicit final def bigDecSet2Model(set: Set[BigDecimal]): TermValue[Set[BigDecimal]]

    Definition Classes
    LogicImplicits
  7. implicit final def bigInt2Model(v: BigInt): TermValue[BigInt]

    Definition Classes
    LogicImplicits
  8. implicit final def bigIntSet2Model(set: Set[BigInt]): TermValue[Set[BigInt]]

    Definition Classes
    LogicImplicits
  9. implicit final def boolean2Model(v: Boolean): TermValue[Boolean]

    Definition Classes
    LogicImplicits
  10. implicit final def booleanSet2Model(set: Set[Boolean]): TermValue[Set[Boolean]]

    Definition Classes
    LogicImplicits
  11. final def cast(value: Any): String
    Attributes
    protected
    Definition Classes
    Helpers
  12. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  13. final def date(s: String): Date
    Attributes
    protected
    Definition Classes
    Helpers
  14. implicit final def date2Model(v: Date): TermValue[Date]

    Definition Classes
    LogicImplicits
  15. implicit final def dateSet2Model(set: Set[Date]): TermValue[Set[Date]]

    Definition Classes
    LogicImplicits
  16. def debugInsert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15], m16: Molecule[T16], m17: Molecule[T17], m18: Molecule[T18], m19: Molecule[T19], m20: Molecule[T20], m21: Molecule[T21], m22: Molecule[T22])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  17. def debugInsert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15], m16: Molecule[T16], m17: Molecule[T17], m18: Molecule[T18], m19: Molecule[T19], m20: Molecule[T20], m21: Molecule[T21])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  18. def debugInsert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15], m16: Molecule[T16], m17: Molecule[T17], m18: Molecule[T18], m19: Molecule[T19], m20: Molecule[T20])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  19. def debugInsert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15], m16: Molecule[T16], m17: Molecule[T17], m18: Molecule[T18], m19: Molecule[T19])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  20. def debugInsert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15], m16: Molecule[T16], m17: Molecule[T17], m18: Molecule[T18])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  21. def debugInsert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15], m16: Molecule[T16], m17: Molecule[T17])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  22. def debugInsert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15], m16: Molecule[T16])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  23. def debugInsert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  24. def debugInsert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  25. def debugInsert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  26. def debugInsert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  27. def debugInsert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  28. def debugInsert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  29. def debugInsert[T1, T2, T3, T4, T5, T6, T7, T8, T9](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  30. def debugInsert[T1, T2, T3, T4, T5, T6, T7, T8](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  31. def debugInsert[T1, T2, T3, T4, T5, T6, T7](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7])(data: Seq[(T1, T2, T3, T4, T5, T6, T7)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  32. def debugInsert[T1, T2, T3, T4, T5, T6](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6])(data: Seq[(T1, T2, T3, T4, T5, T6)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  33. def debugInsert[T1, T2, T3, T4, T5](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5])(data: Seq[(T1, T2, T3, T4, T5)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  34. def debugInsert[T1, T2, T3, T4](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4])(data: Seq[(T1, T2, T3, T4)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  35. def debugInsert[T1, T2, T3](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3])(data: Seq[(T1, T2, T3)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit
    Definition Classes
    CompositeInserts
  36. def debugInsert[T1, T2](m1: Molecule[T1], m2: Molecule[T2])(data: Seq[(T1, T2)])(txMolecules: MoleculeBase*)(implicit conn: Conn): Unit

    Debug composite insert with 2 sub-molecules/tuples

    Debug composite insert with 2 sub-molecules/tuples

    A composite insert can be debugged to see the expected transaction in advance without affecting the database:

    debugInsert(
      Article.name.author, Tag.name.weight
    )(
      List(
        (("Battle of Waterloo", "Ben Bridge"), ("serious", 5)),
        (("Best jokes ever", "John Cleese"), ("fun", 3))
      )
    )(
      MetaData.submitter("Brenda Johnson").usecase("AddReviews")
    )

    This will print debugging info about the composite insert to output (without affecting the database):

    ## 1 ## Composite arity-2 insert debug
    =================================================================================================================
    1      Model(
      1      Atom(article,name,String,1,VarValue,None,List(),List())
      2      Atom(article,author,String,1,VarValue,None,List(),List())
      3      Atom(tag,name,String,1,VarValue,None,List(),List())
      4      Atom(tag,weight,Long,1,VarValue,None,List(),List())
      5      TxMetaData(
        1      Atom(metaData,submitter,String,1,Eq(List(Brenda Johnson)),None,List(),List())
        2      Atom(metaData,usecase,String,1,Eq(List(AddReviews)),None,List(),List())))
    ------------------------------------------------
    2      List(
      1      :db/add    'tempId    :article/name          'arg                                     Card(1)
      2      :db/add    'e         :article/author        'arg                                     Card(1)
      3      :db/add    'e         :tag/name              'arg                                     Card(1)
      4      :db/add    'e         :tag/weight            'arg                                     Card(1)
      5      :db/add    'tx        :metaData/submitter    Values(Eq(List(Brenda Johnson)),None)    Card(1)
      6      :db/add    'tx        :metaData/usecase      Values(Eq(List(AddReviews)),None)        Card(1))
    ------------------------------------------------
    3      List(
      1      List(
        1      :db/add    #db/id[:db.part/user -1000097]    :article/name          Battle of Waterloo    Card(1)
        2      :db/add    #db/id[:db.part/user -1000097]    :article/author        Ben Bridge            Card(1)
        3      :db/add    #db/id[:db.part/user -1000097]    :tag/name              serious               Card(1)
        4      :db/add    #db/id[:db.part/user -1000097]    :tag/weight            5                     Card(1))
      2      List(
        1      :db/add    #db/id[:db.part/user -1000098]    :article/name          Best jokes ever       Card(1)
        2      :db/add    #db/id[:db.part/user -1000098]    :article/author        John Cleese           Card(1)
        3      :db/add    #db/id[:db.part/user -1000098]    :tag/name              fun                   Card(1)
        4      :db/add    #db/id[:db.part/user -1000098]    :tag/weight            3                     Card(1))
      3      List(
        1      :db/add    #db/id[:db.part/tx -1000100]      :metaData/submitter    Brenda Johnson        Card(1)
        2      :db/add    #db/id[:db.part/tx -1000100]      :metaData/usecase      AddReviews            Card(1)))
    =================================================================================================================

    The two first sections are internal Molecule representations.

    The third shows the transactional data sent to Datomic, in this case two rows of data (each with 4 datoms) and one row of transaction data (2 datoms).

    T1

    Type of first data tuple (can be single type too)

    T2

    Type of second data tuple (can be single type too)

    m1

    First molecule of type Molecule[T1]

    m2

    Second molecule of type Molecule[T2]

    data

    List of tuples (rows) of sub-tuples, type: Seq[(T1, T2)]

    txMolecules

    Optional transaction molecule(s) with tx meta data applied to tx attributes.

    conn

    Implicit Conn in scope

    returns

    Unit (prints to output)

    Definition Classes
    CompositeInserts
    See also

    Manual: Composite inserts

  37. def debugRetract(eids: Iterable[Long], txMetaDataMolecules: MoleculeBase*)(implicit conn: Conn): Unit

    Debug retracting multiple entities with optional transaction meta data.

    Debug retracting multiple entities with optional transaction meta data.

    Without affecting the database, a multiple entity retract action can be debugged by adding a 'D' (for 'Debug') to the retract method.

    Here we debug a possible retraction of two comment entities with transaction meta data asserting that the retraction was done by Ben Goodman:

    debugRetract(Seq(commentEid1, commentEid2), MetaData.user("Ben Goodman"))

    This will print debugging info about the retraction to output (without affecting the database):

    ## 1 ## molecule.Datomic.debugRetract
    ===================================================================================================================
    1      Model(
      1      TxMetaData(
        1      Atom(metaData,user,String,1,Eq(List(Ben Goodman)),None,List(),List())))
    ------------------------------------------------
    2      List(
      1      :db/add     'tx                             :metaData/user     Values(Eq(List(Ben Goodman)),None)   Card(1))
    ------------------------------------------------
    3      List(
      1      List(
        1      :db.fn/retractEntity   17592186045445
        2      :db.fn/retractEntity   17592186045446
        3      :db/add   #db/id[:db.part/tx -1000097]    :metaData/user     b                                    Card(1)))
    ===================================================================================================================
    eids

    Iterable of entity ids of type Long

    txMetaDataMolecules

    Zero or more transaction meta data molecules

    conn

    Implicit Conn value in scope

    returns

    Unit (prints to output)

    Definition Classes
    EntityOps
  38. implicit final def double2Model(v: Double): TermValue[Double]

    Definition Classes
    LogicImplicits
  39. implicit final def doubleSet2Model(set: Set[Double]): TermValue[Set[Double]]

    Definition Classes
    LogicImplicits
  40. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  41. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  42. final def f(a: Any): Any
    Attributes
    protected
    Definition Classes
    Helpers
  43. final def f2(a: Any): Any
    Attributes
    protected
    Definition Classes
    Helpers
  44. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  45. implicit final def float2Model(v: Float): TermValue[Float]

    Definition Classes
    LogicImplicits
  46. implicit final def floatSet2Model(set: Set[Float]): TermValue[Set[Float]]

    Definition Classes
    LogicImplicits
  47. final def format(date: Date): String
    Attributes
    protected
    Definition Classes
    Helpers
  48. final def format2(date: Date): String
    Attributes
    protected
    Definition Classes
    Helpers
  49. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  50. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  51. def insert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15], m16: Molecule[T16], m17: Molecule[T17], m18: Molecule[T18], m19: Molecule[T19], m20: Molecule[T20], m21: Molecule[T21], m22: Molecule[T22])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21, T22)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  52. def insert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15], m16: Molecule[T16], m17: Molecule[T17], m18: Molecule[T18], m19: Molecule[T19], m20: Molecule[T20], m21: Molecule[T21])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20, T21)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  53. def insert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15], m16: Molecule[T16], m17: Molecule[T17], m18: Molecule[T18], m19: Molecule[T19], m20: Molecule[T20])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19, T20)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  54. def insert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15], m16: Molecule[T16], m17: Molecule[T17], m18: Molecule[T18], m19: Molecule[T19])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  55. def insert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15], m16: Molecule[T16], m17: Molecule[T17], m18: Molecule[T18])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  56. def insert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15], m16: Molecule[T16], m17: Molecule[T17])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  57. def insert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15], m16: Molecule[T16])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  58. def insert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14], m15: Molecule[T15])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  59. def insert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13], m14: Molecule[T14])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  60. def insert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12], m13: Molecule[T13])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  61. def insert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11], m12: Molecule[T12])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  62. def insert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10], m11: Molecule[T11])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  63. def insert[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9], m10: Molecule[T10])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  64. def insert[T1, T2, T3, T4, T5, T6, T7, T8, T9](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8], m9: Molecule[T9])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8, T9)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  65. def insert[T1, T2, T3, T4, T5, T6, T7, T8](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7], m8: Molecule[T8])(data: Seq[(T1, T2, T3, T4, T5, T6, T7, T8)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  66. def insert[T1, T2, T3, T4, T5, T6, T7](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6], m7: Molecule[T7])(data: Seq[(T1, T2, T3, T4, T5, T6, T7)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  67. def insert[T1, T2, T3, T4, T5, T6](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5], m6: Molecule[T6])(data: Seq[(T1, T2, T3, T4, T5, T6)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  68. def insert[T1, T2, T3, T4, T5](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4], m5: Molecule[T5])(data: Seq[(T1, T2, T3, T4, T5)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  69. def insert[T1, T2, T3, T4](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3], m4: Molecule[T4])(data: Seq[(T1, T2, T3, T4)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  70. def insert[T1, T2, T3](m1: Molecule[T1], m2: Molecule[T2], m3: Molecule[T3])(data: Seq[(T1, T2, T3)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport
    Definition Classes
    CompositeInserts
  71. def insert[T1, T2](m1: Molecule[T1], m2: Molecule[T2])(data: Seq[(T1, T2)])(txMolecules: MoleculeBase*)(implicit conn: Conn): TxReport

    Composite insert with 2 sub-molecules/tuples:

    Composite insert with 2 sub-molecules/tuples:

    insert(
      Article.name.author, Tag.name.weight
    )(
      List(
        (("Battle of Waterloo", "Ben Bridge"), ("serious", 5)),
        (("Best jokes ever", "John Cleese"), ("fun", 3))
      )
    )(
      MetaData.submitter("Brenda Johnson").usecase("AddReviews")
    )
    T1

    Type of first data tuple (can be single type too)

    T2

    Type of second data tuple (can be single type too)

    m1

    First molecule of type Molecule[T1]

    m2

    Second molecule of type Molecule[T2]

    data

    List of tuples (rows) of sub-tuples, type: Seq[(T1, T2)]

    txMolecules

    Optional transaction molecule(s) with tx meta data applied to tx attributes

    conn

    Implicit Conn in scope

    returns

    TxReport with result of insert

    Definition Classes
    CompositeInserts
    See also

    Manual: Composite inserts

  72. implicit final def int2Model(v: Int): TermValue[Int]

    Definition Classes
    LogicImplicits
  73. implicit final def intSet2Model(set: Set[Int]): TermValue[Set[Int]]

    Definition Classes
    LogicImplicits
  74. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  75. implicit final def long2Entity(id: Long)(implicit conn: Conn): Entity

    Long -> Entity api implicit.

    Long -> Entity api implicit.

    Convenience implicit to allow calling Entity methods directly on entity Long value.

    // Get entity id of Ben
    val benId = Person.e.name_("Ben").get.head
    
    // Retract Ben entity directly on his entity id
    benId.retract
    id

    Entity id of type Long

    conn

    Implicit Conn value in scope

    Definition Classes
    EntityOps
  76. implicit final def long2Model(v: Long): TermValue[Long]

    Definition Classes
    LogicImplicits
  77. implicit final def longSet2Model(set: Set[Long]): TermValue[Set[Long]]

    Definition Classes
    LogicImplicits
  78. macro def m[I1, T1, T2](dsl: Composite_In_1_02[I1, T1, T2]): InputMolecule_1_02[I1, T1, T2]

    Macro creation of composite input molecule awaiting 1 input from user-defined DSL with 2 output groups (arity 2).

    Macro creation of composite input molecule awaiting 1 input from user-defined DSL with 2 output groups (arity 2).

    The builder pattern is used to add one or more attributes to an initial namespace like Person from the example below. Further non-related attributes can be tied together with the ~ method to form "composite molecules" that is basically just attributes sharing the same entity id.

    Applying the ? marker to an attribute changes the semantics of the composite molecule to become a "composite input molecule" that awaits input at runtime for the attribute marked with ?.

    Once the composite input molecule models the desired data structure and has been resolved with input we can call various actions on it, like get that retrieves matching data from the database.

    // Apply `?` to `score` attribute to create composite input molecule
    val personsWithScore = m(Person.name ~ Tag.score(?))
    
    // At runtime, a `score` value is applied to get the Person's name
    personsWithScore(7).get.head === ("Ben", 7)

    Composite input molecules of arity 2 has two sub-molecules with output attribute(s). If a sub-molecule has multiple output attributes, a tuple is returned, otherwise just the single value. The two groups of either a single type or tuple are then tied together in an outer composite tuple:

    Composite input molecule          Composite type (2 output groups)
    
    A.a1    ~ B.b1(?)           =>    (a1, b1)
    A.a1    ~ B.b1(?).b2        =>    (a1, (b1, b2))
    A.a1.a2 ~ B.b1(?)           =>    ((a1, a2), b1)
    A.a1.a2 ~ B.b1(?).b2        =>    ((a1, a2), (b1, b2)) etc...
    
    We could even have additional non-output sub-molecules:
    A.a1.a2 ~ B.b1.b2 ~ C.c1_(?)     =>    ((a1, a2), (b1, b2)) etc...

    Translating into the example:

    m(Person.name     ~ Tag.score(?)      )(7).get.head === ("Ben", 7)
    m(Person.name     ~ Tag.score(?).flags)(7).get.head === ("Ben", (7, 3))
    m(Person.name.age ~ Tag.score(?)      )(7).get.head === (("Ben", 42), 7)
    m(Person.name.age ~ Tag.score(?).flags)(7).get.head === (("Ben", 42), (7, 3))
    
    m(Person.name.age ~
      Tag.score.flags ~
      Cat.name_(?))("pitcher").get.head === (("Ben", 42), (7, 3))
    I1

    Type of input attribute 1 (score: Int)

    T1

    Type of output group 1

    T2

    Type of output group 2

    dsl

    User-defined DSL structure modelling the composite input molecule awaiting 1 input

    returns

    Composite input molecule awaiting 1 input

    Definition Classes
    Composite_In_1_Factory2
  79. macro def m[I1, T1](dsl: Composite_In_1_01[I1, T1]): InputMolecule_1_01[I1, T1]

    Macro creation of composite input molecule awaiting 1 input from user-defined DSL with 1 output group (arity 1).

    Macro creation of composite input molecule awaiting 1 input from user-defined DSL with 1 output group (arity 1).

    The builder pattern is used to add one or more attributes to an initial namespace like Person from the example below. Further non-related attributes can be tied together with the ~ method to form "composite molecules" that is basically just attributes sharing the same entity id.

    Applying the ? marker to an attribute changes the semantics of the composite molecule to become a "composite input molecule" that awaits input at runtime for the attribute marked with ?.

    Once the composite input molecule models the desired data structure and has been resolved with input we can call various actions on it, like get that retrieves matching data from the database.

    // Apply `?` to `score` attribute to create composite input molecule
    val personsWithScore = m(Person.name ~ Tag.score_(?))
    
    // At runtime, a `score` value is applied to get the Person's name
    personsWithScore(7).get.head === "Ben"

    Composite input molecules of arity 1 has only one sub-molecule with output attribute(s). If the sub-molecule has multiple output attributes, a tuple is returned, otherwise just the single value:

    Composite input molecule         Composite type (1 output group)
    
    A.a1       ~ B.b1_(?)      =>    a1
    A.a1.a2    ~ B.b1_(?)      =>    (a1, a2)
    A.a1.a2.a3 ~ B.b1_(?)      =>    (a1, a2, a3)
    
    A.a1_(?) ~ B.b1            =>    b1
    A.a1_(?) ~ B.b1.b2         =>    (b1, b2)
    A.a1_(?) ~ B.b1.b2.b3      =>    (b1, b2, b3)
    
    We could even have multiple tacit sub-molecules with multiple tacit attributes
    A.a1_(?).a2_ ~ B.b1_ ~ C.c1.c2_.c3     =>    (c1, c3)

    So, given two output attributes, a tuple is returned:

    m(Person.name.age ~ Tag.score_(?))(7).get.head === ("Ben", 42)
    //  A   . a1 . a2 ~  B .   b1_(?)               => (  a1 , a2)
    I1

    Type of input attribute 1 (score: Int)

    T1

    Type of output group

    dsl

    User-defined DSL structure modelling the composite input molecule awaiting 1 input

    returns

    Composite input molecule awaiting 1 input

    Definition Classes
    Composite_In_1_Factory2
  80. implicit final macro def m[T1, T2](dsl: Composite02[T1, T2]): Molecule02[T1, T2]

    Macro creation of composite molecule from user-defined DSL structure with 2 output groups.

    Macro creation of composite molecule from user-defined DSL structure with 2 output groups.

    The builder pattern is used to add one or more attributes to an initial namespace like Person from the example below. Further non-related attributes can be tied together with the ~ method to form "composite molecules" that is basically just attributes sharing the same entity id.

    Once the composite molecule models the desired data structure we can call various actions on it, like get that retrieves matching data from the database.

    // Explicitly calling `m` to create composite molecule with 2 output attributes
    m(Person.name ~ Tag.score).get.head === ("Ben", 7)
    
    // Alternatively we can create the composite molecule implicitly
    Person.name.~(Tag.score).get.head === ("Ben", 7)

    Composite molecules of arity 2 has two sub-molecules with output attribute(s). If a sub-molecule has multiple output attributes, a tuple is returned, otherwise just the single value. The two groups of either a single type or tuple are then tied together in an outer composite tuple:

    Composite molecule          Composite type (2 output groups)
    
    A.a1    ~ B.b1        =>    (a1, b1)
    A.a1    ~ B.b1.b2     =>    (a1, (b1, b2))
    A.a1.a2 ~ B.b1        =>    ((a1, a2), b1)
    A.a1.a2 ~ B.b1.b2     =>    ((a1, a2), (b1, b2)) etc...
    
    We could even have additional non-output sub-molecules:
    A.a1.a2 ~ B.b1.b2 ~ C.c1_     =>    ((a1, a2), (b1, b2)) etc...

    Translating into the example:

    m(Person.name ~ Tag.score.flags).get.head                         === ("Ben", (7, 3))
    m(Person.name.age ~ Tag.score).get.head                           === (("Ben", 42), 7)
    m(Person.name.age ~ Tag.score.flags).get.head                     === (("Ben", 42), (7, 3))
    
    m(Person.name.age ~
      Tag.score.flags ~
      Cat.name_("pitcher")).get.head === (("Ben", 42), (7, 3))
    T1

    Type of output group 1

    T2

    Type of output group 2

    dsl

    User-defined DSL structure modelling the composite molecule

    returns

    Composite molecule

    Definition Classes
    Composite_Factory2
  81. implicit final macro def m[T1](dsl: Composite01[T1]): Molecule01[T1]

    Macro creation of composite molecule from user-defined DSL structure with 1 output group.

    Macro creation of composite molecule from user-defined DSL structure with 1 output group.

    The builder pattern is used to add one or more attributes to an initial namespace like Person from the example below. Further non-related attributes can be tied together with the ~ method to form "composite molecules" that is basically just attributes sharing the same entity id.

    Once the composite molecule models the desired data structure we can call various actions on it, like get that retrieves matching data from the database.

    // Explicitly calling `m` to create composite molecule
    // with 1 output attribute (`name`) and 1 tacit attribute (`score`).
    m(Person.name ~ Tag.score_).get.head === "Ben"
    
    // Alternatively we can create the composite molecule implicitly
    Person.name.~(Tag.score_).get.head === "Ben"

    Composite molecules of arity 1 has only one sub-molecule with output attribute(s). If the sub-molecule has multiple output attributes, a tuple is returned, otherwise just the single value:

    Composite molecule           Composite type (1 output group)
    
    A.a1       ~ B.b1_     =>    a1
    A.a1.a2    ~ B.b1_     =>    (a1, a2)
    A.a1.a2.a3 ~ B.b1_     =>    (a1, a2, a3) etc...
    
    A.a1_ ~ B.b1           =>    b1
    A.a1_ ~ B.b1.b2        =>    (b1, b2)
    A.a1_ ~ B.b1.b2.b3)    =>    (b1, b2, b3) etc...
    
    We could even have multiple tacit sub-molecules with multiple tacit attributes
    A.a1_.a2_ ~ B.b1_ ~ C.c1.c2_.c3     =>    (c1, c3) etc...

    So, given two output attributes, a tuple is returned:

    m(Person.name.age ~ Tag.score_).get.head === ("Ben", 42)
    //  A   . a1 . a2 ~  B .  b1              => (  a1 , a2)
    T1

    Type of output group 1

    dsl

    User-defined DSL structure modelling the composite molecule

    returns

    Composite molecule

    Definition Classes
    Composite_Factory2
  82. macro def m[In1_2[_, _, _], In1_3[_, _, _, _], In2_2[_, _, _, _], In2_3[_, _, _, _, _], I1, A, B](dsl: In_1_2[In1_2, In1_3, In2_2, In2_3, I1, A, B]): InputMolecule_1_02[I1, A, B]

    Macro creation of input molecule awaiting 1 input from user-defined DSL structure with 2 output attributes (arity 2).

    Macro creation of input molecule awaiting 1 input from user-defined DSL structure with 2 output attributes (arity 2).

    Molecules are build by adding one or more attributes to an initial namespace like Person from the example below.

    Applying the ? marker to an attribute changes the semantics of a molecule to become an "input molecule" that awaits input at runtime for the attribute marked with ?.

    Once the input molecule has been resolved with input, we can call various actions on it, like get that retrieves matching data from the database.

    // Apply `?` to `age` attribute to create input molecule
    val personOfAge = m(Person.name.age_(?).score)
    
    // At runtime, an `age` value is applied to get the Person's name and score
    personOfAge(42).get.head === ("Ben", 7)
    In1_2

    Internal builder pattern type

    In1_3

    Internal builder pattern type

    In2_2

    Internal builder pattern type

    In2_3

    Internal builder pattern type

    I1

    Type of input attribute 1 (age: Int)

    A

    Type of output attribute 1 (name: String)

    B

    Type of output attribute 2 (score: Int)

    dsl

    User-defined DSL structure modelling the input molecule

    returns

    Input molecule ready to be resolved

    Definition Classes
    Molecule_In_1_Factory2
  83. macro def m[In1_1[_, _], In1_2[_, _, _], In2_1[_, _, _], In2_2[_, _, _, _], I1, A](dsl: In_1_1[In1_1, In1_2, In2_1, In2_2, I1, A]): InputMolecule_1_01[I1, A]

    Macro creation of input molecule awaiting 1 input from user-defined DSL structure with 1 output attribute (arity 1).

    Macro creation of input molecule awaiting 1 input from user-defined DSL structure with 1 output attribute (arity 1).

    Molecules are build by adding one or more attributes to an initial namespace like Person from the example below.

    Applying the ? marker to an attribute changes the semantics of a molecule to become an "input molecule" that awaits input at runtime for the attribute marked with ?.

    Once the input molecule has been resolved with input, we can call various actions on it, like get that retrieves matching data from the database.

    // Apply `?` to `age` attribute to create input molecule
    val personOfAge = m(Person.name.age_(?))
    
    // At runtime, an `age` value is applied to get the Person's name
    personOfAge(42).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.

    In1_1

    Internal builder pattern type

    In1_2

    Internal builder pattern type

    In2_1

    Internal builder pattern type

    In2_2

    Internal builder pattern type

    I1

    Type of input attribute 1 (age: Int)

    A

    Type of output attribute 1 (name: String)

    dsl

    User-defined DSL structure modelling the input molecule

    returns

    Input molecule ready to be resolved

    Definition Classes
    Molecule_In_1_Factory2
  84. implicit final macro def m[Ns2[_, _], Ns3[_, _, _], In1_2[_, _, _], In1_3[_, _, _, _], A, B](dsl: Out_2[Ns2, Ns3, In1_2, In1_3, 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 like Person from the example below. Once the molecule models the desired data structure we can call various actions on it, like get 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)
    Ns2

    Internal builder pattern type

    Ns3

    Internal builder pattern type

    In1_2

    Internal builder pattern type

    In1_3

    Internal builder pattern type

    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])

    Definition Classes
    Molecule_Factory2
  85. implicit final macro def m[Ns1[_], Ns2[_, _], In1_1[_, _], In1_2[_, _, _], A](dsl: Out_1[Ns1, Ns2, In1_1, In1_2, 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 like Person from the example below. Once the molecule models the desired data structure we can call various actions on it, like get 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.

    Ns1

    Internal builder pattern type

    Ns2

    Internal builder pattern type

    In1_1

    Internal builder pattern type

    In1_2

    Internal builder pattern type

    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])

    Definition Classes
    Molecule_Factory2
  86. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  87. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  88. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  89. final def o(opt: Option[Any]): String
    Attributes
    protected
    Definition Classes
    Helpers
  90. def recreateDbFrom(schema: SchemaTransaction, identifier: String = "", protocol: String = "mem"): Conn

    Deletes existing database (!) and creates a new empty db with schema from Schema Transaction file.

    Deletes existing database (!) and creates a new empty db with schema from Schema Transaction file.

    A typical development cycle in the initial stages of creating the db schema:

    1. Edit schema definition file
    2. sbt compile to update boilerplate code in generated jars
    3. Obtain a fresh connection to new empty db with updated schema:
      implicit val conn = recreateDbFrom(YourDomainSchema)
    schema

    Auto-generated YourDomainSchema Transaction object
    (in package yourdomain.schema of generated source jar)

    identifier

    Optional String identifier to name database (default empty string creates a randomUUID)

    protocol

    Datomic protocol. Defaults to "mem" for in-memory database.

    returns

    Conn

    Definition Classes
    Datomic
  91. def recreateDbFromRaw(schemaData: List[_], identifier: String = "", protocol: String = "mem"): Conn

    Deletes existing database (!) and creates a new empty db with schema from schema data structure.

    Deletes existing database (!) and creates a new empty db with schema from schema data structure.

    Schema data structure is a java List of Map's of key/value pairs defining the schema.

    Can be an EDN file like the mbrainz example.

    schemaData

    java.util.List of java.util.Maps of key/values defining a Datomic schema

    identifier

    Optional String identifier to name database (default empty string creates a randomUUID)

    protocol

    Datomic protocol. Defaults to "mem" for in-memory database.

    returns

    Conn

    Definition Classes
    Datomic
    See also

    https://docs.datomic.com/on-prem/data-structure-literals.html

  92. def retract(eids: Iterable[Long], txMetaDataMolecules: MoleculeBase*)(implicit conn: Conn): TxReport

    Retract multiple entities with optional transaction meta data.

    Retract multiple entities with optional transaction meta data.

    0 or more transaction meta data molecules can be asserted together with a retraction of entities.

    Here we retract two comment entities with transaction meta data asserting that the retraction was done by Ben Goodman:

    retract(Seq(commentEid1, commentEid2), MetaData.user("Ben Goodman"))

    We can then later see what comments Ben Goodman retracted (op_(false)):

    Comment.e.text.op_(false).Tx(MetaData.user_("Ben Goodman")).getHistory === List(
      (commentEid1, "I like this"),
      (commentEid2, "I hate this")
    )
    eids

    Iterable of entity ids of type Long

    txMetaDataMolecules

    Zero or more transaction meta data molecules

    conn

    Implicit Conn value in scope

    returns

    TxReport with result of retract

    Definition Classes
    EntityOps
    See also

    Manual | Test

  93. final lazy val sdf: SimpleDateFormat
    Attributes
    protected
    Definition Classes
    Helpers
  94. final def seq[T](values: Seq[T]): String
    Attributes
    protected
    Definition Classes
    Helpers
  95. implicit final def string2Model(v: String): TermValue[String]

    Definition Classes
    LogicImplicits
  96. implicit final def stringSet2Model(set: Set[String]): TermValue[Set[String]]

    Definition Classes
    LogicImplicits
  97. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  98. final def time(n: Int, prev: Int = 0): Unit
    Attributes
    protected
    Definition Classes
    Helpers
  99. def toString(): String
    Definition Classes
    AnyRef → Any
  100. def transactSchema(schema: SchemaTransaction, identifier: String, protocol: String = "mem"): Conn

    Transact schema from auto-generated schema transaction data.

    Transact schema from auto-generated schema transaction data.

    schema

    sbt-plugin auto-generated Transaction file path.to.schema.YourDomainSchema

    Definition Classes
    Datomic
  101. implicit final def tuple2Model[A, B](tpl: (A, B)): TermValue[(A, B)]

    Definition Classes
    LogicImplicits
  102. final def tupleToSeq(arg: Any): Seq[Any]
    Attributes
    protected
    Definition Classes
    Helpers
  103. implicit final def uri2Model(v: URI): TermValue[URI]

    Definition Classes
    LogicImplicits
  104. implicit final def uriSet2Model(set: Set[URI]): TermValue[Set[URI]]

    Definition Classes
    LogicImplicits
  105. implicit final def uuid2Model(v: UUID): TermValue[UUID]

    Definition Classes
    LogicImplicits
  106. implicit final def uuidSet2Model(set: Set[UUID]): TermValue[Set[UUID]]

    Definition Classes
    LogicImplicits
  107. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  108. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  109. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  110. object ? extends expression.AttrExpressions.?
    Definition Classes
    core
  111. object avg extends core.avg
    Definition Classes
    core
  112. object count extends core.count
    Definition Classes
    core
  113. object countDistinct extends core.countDistinct
    Definition Classes
    core
  114. object distinct extends core.distinct
    Definition Classes
    core
  115. object max extends core.max
    Definition Classes
    core
  116. object median extends core.median
    Definition Classes
    core
  117. object min extends core.min
    Definition Classes
    core
  118. object mkDate
    Attributes
    protected
    Definition Classes
    Helpers
  119. object rand extends core.rand
    Definition Classes
    core
  120. object sample extends core.sample
    Definition Classes
    core
  121. object stddev extends core.stddev
    Definition Classes
    core
  122. object sum extends core.sum
    Definition Classes
    core
  123. object unify extends core.unify
    Definition Classes
    core
  124. object variance extends core.variance
    Definition Classes
    core

Inherited from Composite_In_1_Factory2

Inherited from Composite_Factory2

Inherited from CompositeInserts

Inherited from Helpers

Inherited from Molecule_In_1_Factory2

Inherited from Molecule_Factory2

Inherited from core

Inherited from EntityOps

Inherited from LogicImplicits

Inherited from AggregateKeywords

Inherited from AttrExpressions

Inherited from Datomic

Inherited from AnyRef

Inherited from Any

Database operations

Entity operations

Attribute markers

Markers applied to attributes that change the semantics of the attribute/molecule.

Expression implicits

Turns basic types into TermValue's that can be used in Expression

Aggregate keywords

Keywords applied to attributes that return aggregated value(s).

Number aggregation keywords

Keywords applied to number attributes that return aggregated value(s).

Composite inserts (arity 2-22)

Insert composite data with optional transaction data. See Composite insert

molecule

input1

composite

composite1

Ungrouped