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

    VAET reverse Index.

    VAET reverse Index.

    "The VAET index contains all and only datoms whose attribute has a :db/valueType of :db.type/ref. This is also known as the reverse index, since it allows efficient navigation of relationships in reverse." (from Datomic documentation)

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

    for {
      // Say we have 3 entities pointing to one entity:
      _ <- Release.e.name.Artists.e.name.get.map(_ ==> List(
        (r1, "Abbey Road", a1, "The Beatles"),
        (r2, "Magical Mystery Tour", a1, "The Beatles"),
        (r3, "Let it be", a1, "The Beatles"),
      ))
    
      // .. then we can get the reverse relationships with the VAET Index:
      _ <- VAET(a1).v.a.e.get.map(_ ==> List(
        (a1, ":Release/artists", r1),
        (a1, ":Release/artists", r2),
        (a1, ":Release/artists", r3),
      ))
    
      // Narrow search with multiple arguments
      _ <- VAET(a1, ":Release/artist").e.get.map(_ ==> List(r1, r2, r3))
      _ <- VAET(a1, ":Release/artist", r2).e.get.map(_ ==> List(r2))
      _ <- VAET(a1, ":Release/artist", r2, t7).e.get.map(_ ==> List(r2))
    } 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 VAET.v.a.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.VAET)

  • VAET

object VAET extends VAET_0_0_L0[VAET_, Init] with FirstNS

VAET Index object to start VAET reverse Index molecule.

Source
GenericVAET.scala
Linear Supertypes
FirstNS, VAET_0_0_L0[VAET_, Init], VAET_0_0[VAET_, Init], NS_0_00[VAET_, Init], NS, VAET, GenericNs, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. VAET
  2. FirstNS
  3. VAET_0_0_L0
  4. VAET_0_0
  5. NS_0_00
  6. NS
  7. VAET
  8. GenericNs
  9. AnyRef
  10. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

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

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, VAET_a, String]
    Definition Classes
    VAET_0_0_L0
  5. final def apply(refId: Long, a: String, e: Long, t: Long): VAET_0_0_L0[VAET_, Init]

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

  6. final def apply(refId: Long, a: String, e: Long): VAET_0_0_L0[VAET_, Init]

    Instantiate VAET reverse Index filtered by ref entity id value, attribute name and entity id.

  7. final def apply(refId: Long, a: String): VAET_0_0_L0[VAET_, Init]

    Instantiate VAET reverse Index filtered by ref entity id value and attribute name.

  8. final def apply(refId: Long): VAET_0_0_L0[VAET_, Init]

    Instantiate VAET reverse Index filtered by ref entity id value.

  9. final def apply: VAET_0_0_L0[VAET_, Init]

    Unfiltered VAET 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: VAET.this.type
    Definition Classes
    NS
  15. def asc2: VAET.this.type
    Definition Classes
    NS
  16. def asc3: VAET.this.type
    Definition Classes
    NS
  17. def asc4: VAET.this.type
    Definition Classes
    NS
  18. def asc5: VAET.this.type
    Definition Classes
    NS
  19. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  20. def desc1: VAET.this.type
    Definition Classes
    NS
  21. def desc2: VAET.this.type
    Definition Classes
    NS
  22. def desc3: VAET.this.type
    Definition Classes
    NS
  23. def desc4: VAET.this.type
    Definition Classes
    NS
  24. def desc5: VAET.this.type
    Definition Classes
    NS
  25. final lazy val e: Next[e, VAET_e, Long]
    Definition Classes
    VAET_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, VAET_op, Boolean]
    Definition Classes
    VAET_0_0_L0
  36. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  37. final lazy val t: Next[t, VAET_t, Long]
    Definition Classes
    VAET_0_0_L0
  38. def toString(): String
    Definition Classes
    AnyRef → Any
  39. final lazy val tx: Next[tx, VAET_tx, Long]
    Definition Classes
    VAET_0_0_L0
  40. final lazy val txInstant: Next[txInstant, VAET_txInstant, Date]
    Definition Classes
    VAET_0_0_L0
  41. final lazy val v: Next[v, VAET_v, Any]
    Definition Classes
    VAET_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 VAET_0_0_L0[VAET_, Init]

Inherited from VAET_0_0[VAET_, Init]

Inherited from NS_0_00[VAET_, Init]

Inherited from NS

Inherited from VAET

Inherited from GenericNs

Inherited from AnyRef

Inherited from Any

Ungrouped