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

    Internal Molecule ASTs.

    Internal Molecule ASTs.

    Definition Classes
    core
  • package composition

    Methods to build transaction, composite and nested molecules.

    Methods to build transaction, composite and nested molecules.

    Definition Classes
    core
  • package data

    Data model DSL and API.

    Data model DSL and API.

    Definition Classes
    core
  • package dsl

    Internal interfaces for auto-generated DSL boilerplate code.

    Internal interfaces for auto-generated DSL boilerplate code.

    Interfaces to the generated schema-defined DSL boilerplate code that the sbt-plugin generates when doing a sbt-compile. Molecule macros can then type-safely deduct the type structure of composed molecules.

    Definition Classes
    core
  • package exceptions

    Exceptions thrown by Molecule.

    Exceptions thrown by Molecule.

    Definition Classes
    core
  • package expression

    Attribute expressions and operations.

    Attribute expressions and operations.

    Refine attribute matches with various attribute expressions:

    Person.age(42)                           // equality
    Person.name.contains("John")             // fulltext search
    Person.age.!=(42)                        // negation (or `not`)
    Person.age.<(42)                         // comparison (< > <= >=)
    Person.name("John" or "Jonas")           // OR-logic
    Person.age()                             // apply empty value to retract value(s) in updates
    Person.hobbies.assert("golf")            // add value(s) to card-many attributes
    Person.hobbies.retract("golf")           // retract value(s) of card-many attributes
    Person.hobbies.replace("golf", "diving") // replace value(s) of card-many attributes
    Person.tags.k("en")                      // match values of map attributes by key
    Person.age(Nil)                          // match non-asserted datoms (null)
    Person.name(?)                           // initiate input molecules awaiting input at runtime
    Person.name(unify)                       // Unify attributes in self-joins

    Apply aggregate keywords to aggregate attribute value(s):

    // Aggregates on any attribute type
    Person.age(count).get.map(_.head ==> 3)         // count of asserted `age` attribute values
    Person.age(countDistinct).get.map(_.head ==> 3) // count of asserted distinct `age` attribute values
    Person.age(max).get.map(_.head ==> 38)          // maximum `age` value (using `compare`)
    Person.age(min).get.map(_.head ==> 5)           // maximum `age` value (using `compare`)
    Person.age(rand).get.map(_.head ==> 25)         // single random `age` value
    Person.age(sample).get.map(_.head ==> 27)       // single sample `age` value (when single value, same as random)
    
    // Aggregates on any attribute type, returning multiple values
    Person.age(distinct).get.map(_.head ==> Vector(5, 7, 38)) // distinct `age` values
    Person.age(max(2)).get.map(_.head ==> Vector(38, 7))      // 2 maximum `age` values
    Person.age(min(2)).get.map(_.head ==> Vector(5, 7))       // 2 minimum `age` values
    Person.age(rand(2)).get.map(_.head ==> Stream(5, ?))      // 2 random `age` values (values can re-occur)
    Person.age(sample(2)).get.map(_.head ==> Vector(7, 38))   // 2 sample `age` values
    
    // Aggregates on number attributes
    Person.age(sum).get.map(_.head ==> 50)                  // sum of all `age` numbers
    Person.age(avg).get.map(_.head ==> 16.66666667)         // average of all `age` numbers
    Person.age(median).get.map(_.head ==> 7)                // median of all `age` numbers
    Person.age(stddev).get.map(_.head ==> 15.107025591499)  // standard deviation of all `age` numbers
    Person.age(variance).get.map(_.head ==> 228.2222222222) // variance of all `age` numbers
    Definition Classes
    core
  • package factory

    Factory methods m to instantiate molecules from custom DSL molecule constructs.

    Factory methods m to instantiate molecules from custom DSL molecule constructs.

    Definition Classes
    core
  • package generic
    Definition Classes
    core
  • package macros
    Definition Classes
    core
  • package marshalling
    Definition Classes
    core
  • package convert
  • package unpackAttr
  • package unpackers
  • BooPicklers
  • ConnProxy
  • DatomicDevLocalProxy
  • DatomicPeerProxy
  • DatomicPeerServerProxy
  • DbException
  • IndexArgs
  • Marshalling
  • MoleculeRpc
  • MoleculeRpcHandler
  • nodes
  • package ops
    Definition Classes
    core
  • package transform
    Definition Classes
    core
  • package util

    Internal database functions for Datomic.

    Internal database functions for Datomic.

    Definition Classes
    core
p

molecule.core

marshalling

package marshalling

Ordering
  1. Alphabetic
Visibility
  1. Public
  2. All

Type Members

  1. trait BooPicklers extends Helpers
  2. sealed trait ConnProxy extends AnyRef

    Proxy connection on the client side.

    Proxy connection on the client side.

    To create molecules on the client side, an implicit Conn_Js object holding a proxy connection object needs to be in scope. Depending on which db system is used, one of the three available proxy connections can be supplied.

    Here's an example of how to create an in-mem Peer proxy connection for a custom Person schema:

    implicit val conn = Future(Conn_Js(
      DatomicPeerProxy("mem", "", PersonSchema.datomicPeer, PersonSchema.attrMap), "localhost", 9000
    ))
  3. case class DatomicDevLocalProxy(protocol: String, system: String, storageDir: String, dbName: String, schema: Seq[String], attrMap: Map[String, (Int, String)], testDbStatus: Int = 0, testDbView: Option[DbView] = None, adhocDbView: Option[DbView] = None, uuid: String = UUID.randomUUID().toString) extends ConnProxy with Product with Serializable

    Datomic dev-local proxy connection for locally testing against the Datomic Client api

    Datomic dev-local proxy connection for locally testing against the Datomic Client api

    protocol

    Datomic protocol: mem, dev or pro

    system

    Name of Datomic system which translates into a directory in the datomic distributions folder where databases will be saved

    storageDir

    Path to the downloaded dev-local directory

    dbName

    Name of database, like "mbrainz-1968-1973"

    schema

    Seq of schema transaction data from generated boilerplate code

    attrMap

    Map of attribute data from generated boilerplate code

    testDbStatus

    Internally applied setting, not intended to be set by user

    testDbView

    Internally applied setting, not intended to be set by user

    adhocDbView

    Internally applied setting, not intended to be set by user

    uuid

    Internally applied setting, not intended to be set by user

  4. case class DatomicPeerProxy(protocol: String, dbIdentifier: String, schema: Seq[String], attrMap: Map[String, (Int, String)], testDbStatus: Int = 0, testDbView: Option[DbView] = None, adhocDbView: Option[DbView] = None, uuid: String = UUID.randomUUID().toString) extends ConnProxy with Product with Serializable

    Datomic Peer proxy connection

    Datomic Peer proxy connection

    protocol

    Datomic protocol: mem, dev or pro

    dbIdentifier

    Datomic db identifier, like "localhost:4334/mbrainz-1968-1973"

    schema

    Seq of schema transaction data from generated boilerplate code

    attrMap

    Map of attribute data from generated boilerplate code

    testDbStatus

    Internally applied setting, not intended to be set by user

    testDbView

    Internally applied setting, not intended to be set by user

    adhocDbView

    Internally applied setting, not intended to be set by user

    uuid

    Internally applied setting, not intended to be set by user

  5. case class DatomicPeerServerProxy(accessKey: String, secret: String, endpoint: String, dbName: String, schema: Seq[String], attrMap: Map[String, (Int, String)], testDbStatus: Int = 0, testDbView: Option[DbView] = None, adhocDbView: Option[DbView] = None, uuid: String = UUID.randomUUID().toString) extends ConnProxy with Product with Serializable

    Datomic Peer Server proxy connection

    Datomic Peer Server proxy connection

    accessKey

    Peer Server access key

    secret

    Peer Server secret password

    endpoint

    Peer Server network endpoint, like "localhost:8998"

    dbName

    Name of database, like "mbrainz-1968-1973"

    schema

    Seq of schema transaction data from generated boilerplate code

    attrMap

    Map of attribute data from generated boilerplate code

    testDbStatus

    Internally applied setting, not intended to be set by user

    testDbView

    Internally applied setting, not intended to be set by user

    adhocDbView

    Internally applied setting, not intended to be set by user

    uuid

    Internally applied setting, not intended to be set by user

  6. case class DbException(msg: String) extends Exception with Product with Serializable
  7. case class IndexArgs(e: Long = -1L, a: String = "", v: String = "", tpe: String = "", t: Long = -1L, inst: Long = -1L, v2: String = "", tpe2: String = "") extends Product with Serializable
  8. abstract class Marshalling[Obj, Tpl] extends Molecule with Helpers

    Marshalling methods

    Marshalling methods

    Methods are implemented by macros for either JS or JVM platform

  9. trait MoleculeRpc extends AnyRef
  10. case class MoleculeRpcHandler(interface: String, port: Int) extends BooPicklers with Product with Serializable

Value Members

  1. object nodes

Ungrouped