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 api
    Definition Classes
    core
  • abstract class Molecule_0[Obj, Tpl] extends Marshalling[Obj, Tpl] with CastTypes with CastAggr with CastOptNested with JsonTypes with JsonAggr with JsonOptNested with GetTpls[Obj, Tpl] with GetObjs[Obj, Tpl] with GetJson[Obj, Tpl] with ShowInspect[Obj, Tpl] with Helpers

    Core molecule interface defining actions that can be called on molecules.

    Core molecule interface defining actions that can be called on molecules.

    Groups of interfaces:

    get Get molecule data.
    getAsOf Get molecule data asOf point in time.
    getSince Get molecule data since point in time.
    getWith Get molecule data with given data set.
    getHistory Get molecule data from history of database.
    save Save molecule with applied data.
    insert Insert multiple rows of data matching a molecule.
    update Update molecule with applied data.
    tx Molecule transaction data (input to `getWith`).
    inspect get Inspect calling get method on molecule.
    inspect operation     Inspect calling save/insert/update method on molecule.

    Tpl

    Type of molecule (tuple of its attribute types)

    Definition Classes
    api
    See also

    For retract ("delete") methods, see molecule.datomic.base.api.EntityOps and molecule.datomic.base.api.DatomicEntity.

  • AsJava
  • AsJavaCollection
  • AsJavaDictionary
  • AsJavaEnumeration
  • AsScala
  • Regex
  • getInsertStmts
  • insert
  • inspectInsert
  • log
  • raw2list

trait insert extends AnyRef

Insert one or more rows of data matching a molecule.

Returns Future with TxReport having info about the result of the insert transaction.

Data matching the types of the molecule can be inserted either as individual args or an Iterable (List, Set etc) of tuples:

val singleInsertFuture: Future[TxReport] = Person.name.age.insert("Ann", 28)

// Insert multiple rows of data. Accepts Iterable[Tpl]
val multipleInsertFuture: Future[TxReport] = Person.name.age insert List(
  ("Ben", 42),
  ("Liz", 37)
)

for {
  // Insert single row of data with individual args
  _ <- Person.name.age.insert("Ann", 28)

  // Insert multiple rows of data. Accepts Iterable[Tpl]
  _ <- Person.name.age insert List(
    ("Ben", 42),
    ("Liz", 37)
  )
  _ <- Person.name.age.get.map(_ ==> List(
    ("Ann", 28),
    ("Ben", 42),
    ("Liz", 37)
  ))
} yield ()

The insert operation is asynchronous and non-blocking. Internally calls Datomic's asynchronous API.

Source
Molecule_0.scala
Linear Supertypes
AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. insert
  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[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  10. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  11. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  14. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  15. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  16. def toString(): String
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()

Inherited from AnyRef

Inherited from Any

Ungrouped