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
  • package index

    Datomic Index APIs in Molecule.

    Datomic Index APIs in Molecule.

    Datomic maintains four indexes that contain ordered sets of datoms. Each of these indexes is named based on the sort order used:

    • EAVT - Datoms sorted by Entity-Attribute-Value-Transaction
    • AVET - Datoms sorted by Attribute-Value-Entity-Transaction
    • AEVT - Datoms sorted by Attribute-Entity-Value-Transaction
    • VAET - "Reverse index" for reverse lookup of ref types

    Create an Index molecule by instantiating an Index object with one or more arguments in the order of the Index's elements. Datoms are returned as tuples of data depending of which generic attributes you add to the Index molecule:

    // Create EAVT Index molecule with 1 entity id argument
    EAVT(e1).e.a.v.t.get === List(
      (e1, ":Person/name", "Ben", t1),
      (e1, ":Person/age", 42, t2),
      (e1, ":Golf/score", 5.7, t2)
    )
    
    // Maybe we are only interested in the attribute/value pairs:
    EAVT(e1).a.v.get === List(
      (":Person/name", "Ben"),
      (":Person/age", 42),
      (":Golf/score", 5.7)
    )
    
    // Two arguments to narrow the search
    EAVT(e1, ":Person/age").a.v.get === List(
      (":Person/age", 42)
    )
    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 EAVT.e.a.v.t.get) will throw an exception.
    Please use Datomics API if you need to return the whole database Index:
    conn.db.datoms(datomic.Database.EAVT)

  • trait GenericAVET extends AnyRef

    Container for AVET Index object.

    Container for AVET Index object.

    Definition Classes
    index
  • AVET

object AVET extends AVET_0 with FirstNS

AVET Index object to start AVET Index molecule.

Source
AVET.scala
Linear Supertypes
FirstNS, AVET_0, OutIndex_0, NS00[Nothing], NS, AVET, GenericNs, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. AVET
  2. FirstNS
  3. AVET_0
  4. OutIndex_0
  5. NS00
  6. NS
  7. AVET
  8. GenericNs
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final class a[Ns, In] extends OneString[Ns, In] with Indexed

    (Partition)-Namespace-prefixed attribute name (":part_Ns/attr")

    (Partition)-Namespace-prefixed attribute name (":part_Ns/attr")

    Definition Classes
    AVET
  2. final class e[Ns, In] extends OneLong[Ns, In] with Indexed

    Entity id (Long)

    Entity id (Long)

    Definition Classes
    AVET
  3. final class op[Ns, In] extends OneBoolean[Ns, In] with Indexed

    Transaction operation: assertion (true) or retraction (false)

    Transaction operation: assertion (true) or retraction (false)

    Definition Classes
    AVET
  4. final class t[Ns, In] extends OneLong[Ns, In] with Indexed

    Transaction point in time t (Long/Int)

    Transaction point in time t (Long/Int)

    Definition Classes
    AVET
  5. final class tx[Ns, In] extends OneLong[Ns, In] with Indexed

    Transaction entity id (Long)

    Transaction entity id (Long)

    Definition Classes
    AVET
  6. final class txInstant[Ns, In] extends OneDate[Ns, In] with Indexed

    Transaction wall-clock time (Date)

    Transaction wall-clock time (Date)

    Definition Classes
    AVET
  7. final class v[Ns, In] extends OneAny[Ns, In] with Indexed

    Datom value (Any)

    Datom value (Any)

    Definition Classes
    AVET
  8. type Next_[Attr[_, _], Type] = Attr[AVET_1[Type], P2[_, _]] with AVET_1[Type]
    Definition Classes
    AVET_0

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, String]
    Definition Classes
    AVET_0
  5. final def apply(a: String, v: Any, e: Long, t: Long): AVET_0

    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

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

  7. final def apply(a: String, v: Any): AVET_0

    Instantiate AVET Index filtered by attribute name and value.

  8. final def apply(a: String): AVET_0

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

  9. final def apply: AVET_0

    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( ... ) @native()
  15. final lazy val e: Next_[e, Long]
    Definition Classes
    AVET_0
  16. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. def equals(arg0: Any): 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[_]
    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, Boolean]
    Definition Classes
    AVET_0
  26. final def range(a: String, from: Option[Any], until: Option[Any]): AVET_0

    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, Long]
    Definition Classes
    AVET_0
  29. def toString(): String
    Definition Classes
    AnyRef → Any
  30. final lazy val tx: Next_[tx, Long]
    Definition Classes
    AVET_0
  31. final lazy val txInstant: Next_[txInstant, Date]
    Definition Classes
    AVET_0
  32. final lazy val v: Next_[v, Any]
    Definition Classes
    AVET_0
  33. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  34. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from FirstNS

Inherited from AVET_0

Inherited from OutIndex_0

Inherited from NS00[Nothing]

Inherited from NS

Inherited from AVET

Inherited from GenericNs

Inherited from AnyRef

Inherited from Any

Ungrouped