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 GenericEAVT extends AnyRef

    EAVT Index.

    EAVT Index.

    "The EAVT index provides efficient access to everything about a given entity. Conceptually this is very similar to row access style in a SQL database, except that entities can possess arbitrary attributes rather then being limited to a predefined set of columns." (from Datomic documentation)

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

    for {
      // Create EAVT Index molecule with 1 entity id argument
      _ <- EAVT(e1).e.a.v.t.get.map(_ ==> List(
        (e1, ":Person/name", "Ben", t1),
        (e1, ":Person/age", 42, t2),
        (e1, ":Golf/score", 5.7, t2)
      ))
    
      // Narrow search with multiple arguments
      _ <- EAVT(e1, ":Person/age").a.v.get.map(_ ==> List( (":Person/age", 42) ))
      _ <- EAVT(e1, ":Person/age", 42).a.v.get.map(_ ==> List( (":Person/age", 42) ))
      _ <- EAVT(e1, ":Person/age", 42, t1).a.v.get.map(_ ==> List( (":Person/age", 42) ))
    } yield ()

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

  • EAVT

object EAVT extends EAVT_0_0_L0[EAVT_, Init] with FirstNS

EAVT Index object to instantiate EAVT Index molecule.

Source
GenericEAVT.scala
Linear Supertypes
FirstNS, EAVT_0_0_L0[EAVT_, Init], EAVT_0_0[EAVT_, Init], NS_0_00[EAVT_, Init], NS, EAVT, GenericNs, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. EAVT
  2. FirstNS
  3. EAVT_0_0_L0
  4. EAVT_0_0
  5. NS_0_00
  6. NS
  7. EAVT
  8. GenericNs
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final class a[Stay, Next] extends OneString[Stay, Next] with Indexed
    Definition Classes
    EAVT
  2. final class a$[Stay, Next] extends OneString$[Stay] with Indexed
    Definition Classes
    EAVT
  3. final class e[Stay, Next] extends OneLong[Stay, Next] with Indexed
    Definition Classes
    EAVT
  4. final class e$[Stay, Next] extends OneLong$[Stay] with Indexed
    Definition Classes
    EAVT
  5. final class op[Stay, Next] extends OneBoolean[Stay, Next] with Indexed
    Definition Classes
    EAVT
  6. final class op$[Stay, Next] extends OneBoolean$[Stay] with Indexed
    Definition Classes
    EAVT
  7. final class t[Stay, Next] extends OneLong[Stay, Next] with Indexed
    Definition Classes
    EAVT
  8. final class t$[Stay, Next] extends OneLong$[Stay] with Indexed
    Definition Classes
    EAVT
  9. final class tx[Stay, Next] extends OneLong[Stay, Next] with Indexed
    Definition Classes
    EAVT
  10. final class tx$[Stay, Next] extends OneLong$[Stay] with Indexed
    Definition Classes
    EAVT
  11. final class txInstant[Stay, Next] extends OneDate[Stay, Next] with Indexed
    Definition Classes
    EAVT
  12. final class txInstant$[Stay, Next] extends OneDate$[Stay] with Indexed
    Definition Classes
    EAVT
  13. final class v[Stay, Next] extends OneAny[Stay, Next] with Indexed
    Definition Classes
    EAVT
  14. final class v$[Stay, Next] extends OneAny$[Stay] with Indexed
    Definition Classes
    EAVT
  15. type Next[Attr[_, _], Prop, Tpe] = Attr[EAVT_0_1_L0[EAVT_, Init with Prop, Tpe], Nothing] with EAVT_0_1_L0[EAVT_, Init with Prop, Tpe]
    Definition Classes
    EAVT_0_0_L0
  16. type Stay[Attr[_, _], Prop, Tpe] = Attr[EAVT_0_0_L0[EAVT_, Init], Nothing] with EAVT_0_0_L0[EAVT_, Init]
    Definition Classes
    EAVT_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, EAVT_a, String]
    Definition Classes
    EAVT_0_0_L0
  5. final def apply(e: Long, a: String, v: Any, t: Long): EAVT_0_0_L0[EAVT_, Init]

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

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

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

  7. final def apply(e: Long, a: String): EAVT_0_0_L0[EAVT_, Init]

    Instantiate EAVT Index filtered by entity id and namespace-prefixed attribute name (":part_Ns/attr").

  8. final def apply(e: Long): EAVT_0_0_L0[EAVT_, Init]

    Instantiate EAVT Index filtered by entity id.

  9. final def apply: EAVT_0_0_L0[EAVT_, Init]

    Unfiltered EAVT Index fetching ALL datoms (!)

  10. def apply(eids: expression.AttrExpressions.qm): 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 asc1: EAVT.this.type
    Definition Classes
    NS
  15. def asc2: EAVT.this.type
    Definition Classes
    NS
  16. def asc3: EAVT.this.type
    Definition Classes
    NS
  17. def asc4: EAVT.this.type
    Definition Classes
    NS
  18. def asc5: EAVT.this.type
    Definition Classes
    NS
  19. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  20. def desc1: EAVT.this.type
    Definition Classes
    NS
  21. def desc2: EAVT.this.type
    Definition Classes
    NS
  22. def desc3: EAVT.this.type
    Definition Classes
    NS
  23. def desc4: EAVT.this.type
    Definition Classes
    NS
  24. def desc5: EAVT.this.type
    Definition Classes
    NS
  25. final lazy val e: Next[e, EAVT_e, Long]
    Definition Classes
    EAVT_0_0_L0
  26. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  27. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  28. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  29. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  30. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  31. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  32. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  35. final lazy val op: Next[op, EAVT_op, Boolean]
    Definition Classes
    EAVT_0_0_L0
  36. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  37. final lazy val t: Next[t, EAVT_t, Long]
    Definition Classes
    EAVT_0_0_L0
  38. def toString(): String
    Definition Classes
    AnyRef → Any
  39. final lazy val tx: Next[tx, EAVT_tx, Long]
    Definition Classes
    EAVT_0_0_L0
  40. final lazy val txInstant: Next[txInstant, EAVT_txInstant, Date]
    Definition Classes
    EAVT_0_0_L0
  41. final lazy val v: Next[v, EAVT_v, Any]
    Definition Classes
    EAVT_0_0_L0
  42. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from FirstNS

Inherited from EAVT_0_0_L0[EAVT_, Init]

Inherited from EAVT_0_0[EAVT_, Init]

Inherited from NS_0_00[EAVT_, Init]

Inherited from NS

Inherited from EAVT

Inherited from GenericNs

Inherited from AnyRef

Inherited from Any

Ungrouped