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 generic
    Definition Classes
    core
  • trait GenericAVET extends AnyRef

    AVET Index.

    AVET Index.

    "The AVET index provides efficient access to particular combinations of attribute and value." (from Datomic documentation)

    Access the AVET Index in Molecule by instantiating an AVET object with one or more arguments and then add generic attributes:

    // Create AVET Index molecule with 1 entity id argument
    AVET(":Person/age").e.v.t.get === List(
      (e1, 42, t2),
      (e2, 37, t5)
      (e3, 14, t7),
    )
    
    // Narrow search with multiple arguments
    AVET(":Person/age", 42).e.t.get === List( (e1, t2) )
    AVET(":Person/age", 42, e1).e.v.get === List( (e1, t2) )
    AVET(":Person/age", 42, e1, t2).e.v.get === List( (e1, t2) )

    The AVET Index can be filtered by a range of values between from (inclusive) and until (exclusive) for an attribute:

    AVET.range(":Person/age", Some(14), Some(37)).v.e.t.get === List(
      (14, e4, t7) // 14 is included in value range
                   // 37 not included in value range
                   // 42 outside value range
    )
    
    // If `from` is None, the range starts from the beginning
    AVET.range(":Person/age", None, Some(40)).v.e.t.get === List(
      (14, e3, t7),
      (37, e2, t5),
    )
    
    // If `until` is None, the range goes to the end
    AVET.range(":Person/age", Some(20), None).v.e.t.get === List(
      (37, e2, t5),
      (42, e1, t2)
    )

    Index attributes available:

    • e - Entity id (Long)
    • a - Full attribute name like ":Person/name" (String)
    • v - Value of Datoms (Any)
    • t - Transaction pointer (Long/Int)
    • tx - Transaction entity id (Long)
    • txInstant - Transaction wall clock time (java.util.Date)
    • op - Operation status: assertion (true) / retraction (false)
    Definition Classes
    generic
    Note

    The Molecule Index API's don't allow returning the whole Index/the whole database. So omitting arguments constructing the Index object (like AVET.a.v.e.t.get) will throw an exception.
    Please use Datomics API if you need to return the whole database Index:
    conn.db.datoms(datomic.Database.AVET)

    from and until cannot both be None since Molecule doesn't allow returning all datoms.

  • AVET

object AVET extends AVET_0_0_L0[AVET_, Init] with FirstNS

AVET Index object to start AVET Index molecule.

Source
GenericAVET.scala
Linear Supertypes
FirstNS, AVET_0_0_L0[AVET_, Init], AVET_0_0[AVET_, Init], NS_0_00[AVET_, Init], NS, AVET, GenericNs, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AVET
  2. FirstNS
  3. AVET_0_0_L0
  4. AVET_0_0
  5. NS_0_00
  6. NS
  7. AVET
  8. GenericNs
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final class a[Stay, Next] extends OneString[Stay, Next] with Indexed
    Definition Classes
    AVET
  2. final class a$[Stay, Next] extends OneString$[Stay] with Indexed
    Definition Classes
    AVET
  3. final class e[Stay, Next] extends OneLong[Stay, Next] with Indexed
    Definition Classes
    AVET
  4. final class e$[Stay, Next] extends OneLong$[Stay] with Indexed
    Definition Classes
    AVET
  5. final class op[Stay, Next] extends OneBoolean[Stay, Next] with Indexed
    Definition Classes
    AVET
  6. final class op$[Stay, Next] extends OneBoolean$[Stay] with Indexed
    Definition Classes
    AVET
  7. final class t[Stay, Next] extends OneLong[Stay, Next] with Indexed
    Definition Classes
    AVET
  8. final class t$[Stay, Next] extends OneLong$[Stay] with Indexed
    Definition Classes
    AVET
  9. final class tx[Stay, Next] extends OneLong[Stay, Next] with Indexed
    Definition Classes
    AVET
  10. final class tx$[Stay, Next] extends OneLong$[Stay] with Indexed
    Definition Classes
    AVET
  11. final class txInstant[Stay, Next] extends OneDate[Stay, Next] with Indexed
    Definition Classes
    AVET
  12. final class txInstant$[Stay, Next] extends OneDate$[Stay] with Indexed
    Definition Classes
    AVET
  13. final class v[Stay, Next] extends OneAny[Stay, Next] with Indexed
    Definition Classes
    AVET
  14. final class v$[Stay, Next] extends OneAny$[Stay] with Indexed
    Definition Classes
    AVET
  15. type Next[Attr[_, _], Prop, Tpe] = Attr[AVET_0_1_L0[AVET_, Init with Prop, Tpe], Nothing] with AVET_0_1_L0[AVET_, Init with Prop, Tpe]
    Definition Classes
    AVET_0_0_L0
  16. type Stay[Attr[_, _], Prop, Tpe] = Attr[AVET_0_0_L0[AVET_, Init], Nothing] with AVET_0_0_L0[AVET_, Init]
    Definition Classes
    AVET_0_0_L0

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 lazy val a: Next[a, AVET_a, String]
    Definition Classes
    AVET_0_0_L0
  5. final def apply(a: String, v: Any, e: Long, t: Long): AVET_0_0_L0[AVET_, Init]

    Instantiate AVET Index filtered by attribute name, value, entity id and transaction entity id (tx) or point in time (t).

  6. final def apply(a: String, v: Any, e: Long): AVET_0_0_L0[AVET_, Init]

    Instantiate AVET Index filtered by attribute name, value and entity id.

  7. final def apply(a: String, v: Any): AVET_0_0_L0[AVET_, Init]

    Instantiate AVET Index filtered by attribute name and value.

  8. final def apply(a: String): AVET_0_0_L0[AVET_, Init]

    Instantiate AVET Index filtered by namespace-prefixed attribute name (":part_Ns/attr").

  9. final def apply: AVET_0_0_L0[AVET_, Init]

    Unfiltered AVET Index fetching ALL datoms (!)

  10. def apply(eids: expression.AttrExpressions.?): AnyRef

    Add entity id(s) input placeholder to the molecule.

    Add entity id(s) input placeholder to the molecule.
    At runtime, entity id(s) are applied as vararg(s) or list/sets.

    eids

    Iterable of entity ids, typically List, Seq or Set of ids.

    returns

    molecule to be further expanded with more attributes.

    Definition Classes
    FirstNS
  11. def apply(eids: Iterable[Long]): AnyRef

    Filter molecule by applying one or more entity ids of type Long.

    Filter molecule by applying one or more entity ids of type Long.

    eids

    Iterable of entity ids, typically List, Seq or Set of ids.

    returns

    molecule to be further expanded with more attributes.

    Definition Classes
    FirstNS
  12. def apply(eid: Long, eids: Long*): AnyRef

    Filter molecule by applying one or more entity ids of type Long.

    Filter molecule by applying one or more entity ids of type Long.

    eid

    First entity id

    eids

    Further entity ids (varargs)

    returns

    molecule to be further expanded with more attributes.

    Definition Classes
    FirstNS
  13. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  14. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  15. final lazy val e: Next[e, AVET_e, Long]
    Definition Classes
    AVET_0_0_L0
  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  18. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  19. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  20. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  22. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  23. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  24. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  25. final lazy val op: Next[op, AVET_op, Boolean]
    Definition Classes
    AVET_0_0_L0
  26. final def range(a: String, from: Option[Any], until: Option[Any]): AVET_0_0_L0[AVET_, Init]

    Range of values (using Datomic's Database.indexRange API)

    Range of values (using Datomic's Database.indexRange API)

    Values between from (inclusive) and until (exclusive)

    • From beginning if from is None
    • To end if until is None
  27. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  28. final lazy val t: Next[t, AVET_t, Long]
    Definition Classes
    AVET_0_0_L0
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. final lazy val tx: Next[tx, AVET_tx, Long]
    Definition Classes
    AVET_0_0_L0
  31. final lazy val txInstant: Next[txInstant, AVET_txInstant, Date]
    Definition Classes
    AVET_0_0_L0
  32. final lazy val v: Next[v, AVET_v, Any]
    Definition Classes
    AVET_0_0_L0
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from FirstNS

Inherited from AVET_0_0_L0[AVET_, Init]

Inherited from AVET_0_0[AVET_, Init]

Inherited from NS_0_00[AVET_, Init]

Inherited from NS

Inherited from AVET

Inherited from GenericNs

Inherited from AnyRef

Inherited from Any

Ungrouped