Packages

  • package root

    Documentation/API for the Molecule library - a meta DSL for the Datomic database.

    Manual | 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.

    See api package for various api imports to start using Molecule.

    Sub-packages

    action Actions on molecules and entities.
    api Molecule import interfaces of various arities.
    ast Internal Molecule ASTs.
    boilerplate Internal interfaces for auto-generated DSL boilerplate code.
    composition    Builder methods to compose molecules.
    exceptions Exceptions thrown by Molecule.
    expression Attribute expressions and operations.
    facade Molecule facades to Datomic.
    factory Implicit macro methods `m` to instantiate molecules from custom DSL molecule constructs.
    generic Interfaces to generic information about datoms and Datomic database.
    input Input molecules awaiting input.
    macro Internal macros generating molecule code from custom DSL molecule constructs.
    ops Internal operational helpers for transforming DSL to molecule.
    schema Schema definition DSL.
    transform Internal transformers from DSL to Model/Query/Transaction.
    util Internal Java database functions for Datomic.

    Definition Classes
    root
  • package action

    Various actions and operations on molecules and entities.

    Various actions and operations on molecules and entities.

    Definition Classes
    molecule
  • package exception
    Definition Classes
    action
  • package get

    Package with various synchronous getter methods to retrieve data from Datomic with molecules.

    Package with various synchronous getter methods to retrieve data from Datomic with molecules.

    For the Datomic Peer model, Datomic returns data synchronously. The Peer lives in application memory and caches data aggressively to save roundtrips to disk or memcached. Query results that can fit in memory will therefore have near-zero latency and return extremely fast.

    Molecule has not yet addressed the Client api although the query engine would be the same as for the current Peer version.

    Molecule has 5 groups of getters each returning data in various formats:

    • GetList - default getter returning Lists of tuples. Convenient typed data, suitable for smaller data sets
    • GetArray - fastest retrieved typed data set. Can be traversed with a fast while loop
    • GetIterable - for lazily traversing row by row
    • GetRaw - fastest retrieved raw un-typed data from Datomic
    • GetJson - data formatted as Json string

    Getters in each of the 5 groups come with 5 time-dependent variations:

    • get [current data]
    • getAsOf
    • getSince
    • getWith
    • getHistory

    Each time variation has various overloads taking different parameters (see each group for more info).

    Definition Classes
    action
  • CompositeInserts
  • Entity
  • EntityOps
  • Molecule
  • OptionalMapOps
  • ShowDebug
t

molecule.action

EntityOps

trait EntityOps extends AnyRef

Operations on multiple entities.

Source
EntityOps.scala
Linear Supertypes
AnyRef, Any
Type Hierarchy
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. EntityOps
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. 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)

  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  9. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  10. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  12. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  13. 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

  14. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  15. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  16. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  17. 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

    See also

    Manual | Test

  18. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  19. def toString(): String
    Definition Classes
    AnyRef → Any
  20. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  22. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from AnyRef

Inherited from Any

Entity operations

Ungrouped