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 schema

    Schema definition DSL and API.

    Schema definition DSL and API.

    Definition Classes
    molecule
  • SchemaTransaction
  • definition
o

molecule.schema

definition

object definition

Schema definition DSL.

Define Datomic database schema in a Schema Definition file.

For small projects, the schema can be defined without partition definitions where all namespaces reside in a default tacit partition:

package path.to.your.project
import molecule.schema.definition._       // import schema definition DSL

@InOut(1, 8)                              // Set input/output arity
object SeattleDefinition {                // Schema definition object

  trait Person {                          // Namespace
    val name = oneString.fulltextSearch   // String attribute definition with fulltext search
    val age  = oneInt                     // Int attribute definition
  }

  // Additional namespaces...
}

For larger projects, it is recommended to group namespaces in partitions:

package path.to.your.project
import molecule.schema.definition._

@InOut(3, 15)
object SeattleDefinition {

  object customer {
    trait Person {
      val name    = oneString.fulltextSearch
      val age     = oneInt
      val address = one[Address]
      val bought  = many[products.Item]
    }
    trait Address {
      val street = oneString.fulltextSearch
      val city   = oneInt
    }
    // ..more namespaces in the `customer` partition
  }

  object products {
    trait Item {
      val title   = oneString
      val inStock = oneInt
    }
    // ..more namespaces in the `products` partition
  }

  // Additional partitions...
}
Source
definition.scala
See also

Manual | Tests: Schema without partitions, Schema with partitions, Bidirectionals

Linear Supertypes
AnyRef, Any
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. definition
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. class InOut extends Annotation with StaticAnnotation

    Arity annotation for number of molecule input/output attributes.

  2. trait manyBigDecimal extends number[manyBigDecimal, BigDecimal]

    Card-many BigDecimal attribute.

  3. trait manyBigInt extends number[manyBigInt, BigInt]

    Card-many BigInt attribute.

  4. trait manyBoolean extends optionBuilder[manyBoolean]

    Card-many Boolean attribute.

  5. trait manyByte extends optionBuilder[manyByte]

    Card-many Bytes attribute.

  6. trait manyDate extends optionBuilder[manyDate]

    Card-many Date attribute.

  7. trait manyDouble extends number[manyDouble, Double]

    Card-many Double attribute.

  8. trait manyEnum extends enum

    Card-many Enum attribute.

  9. trait manyFloat extends number[manyFloat, Float]

    Card-many Float attribute.

  10. trait manyInt extends number[manyInt, Int]

    Card-many Int attribute.

  11. trait manyLong extends number[manyLong, Long]

    Card-many Long attribute.

  12. trait manyString extends optionBuilder[manyString]

    Card-many String attribute.

  13. trait manyURI extends optionBuilder[manyURI]

    Card-many URI attribute.

  14. trait manyUUID extends optionBuilder[manyUUID]

    Card-many UUID attribute.

  15. trait mapBigDecimal extends number[mapBigDecimal, BigDecimal]

    BigDecimal map attribute.

  16. trait mapBigInt extends number[mapBigInt, BigInt]

    BigInt map attribute.

  17. trait mapBoolean extends optionBuilder[mapBoolean]

    Boolean map attribute.

  18. trait mapByte extends optionBuilder[mapByte]

    Bytes map attribute.

  19. trait mapDate extends optionBuilder[mapDate]

    Date map attribute.

  20. trait mapDouble extends number[mapDouble, Double]

    Double map attribute.

  21. trait mapFloat extends number[mapFloat, Float]

    Float map attribute.

  22. trait mapInt extends number[mapInt, Int]

    Int map attribute.

  23. trait mapLong extends number[mapLong, Long]

    Long map attribute.

  24. trait mapString extends optionBuilder[mapString]

    String map attribute.

  25. trait mapURI extends optionBuilder[mapURI]

    URI map attribute.

  26. trait mapUUID extends optionBuilder[mapUUID]

    UUID map attribute.

  27. trait oneBigDecimal extends number[oneBigDecimal, BigDecimal]

    Card-one BigDecimal attribute.

  28. trait oneBigInt extends number[oneBigInt, BigInt]

    Card-one BigInt attribute.

  29. trait oneBoolean extends optionBuilder[oneBoolean]

    Card-one Boolean attribute.

  30. trait oneByte extends optionBuilder[oneByte]

    Card-one Bytes attribute.

  31. trait oneDate extends optionBuilder[oneDate]

    Card-one Date attribute.

  32. trait oneDouble extends number[oneDouble, Double]

    Card-one Double attribute.

  33. trait oneEnum extends enum

    Card-one Enum attribute.

  34. trait oneFloat extends number[oneFloat, Float]

    Card-one Float attribute.

  35. trait oneInt extends number[oneInt, Int]

    Card-one Int attribute.

  36. trait oneLong extends number[oneLong, Long]

    Card-one Long attribute.

  37. trait oneString extends optionBuilder[oneString]

    Card-one String attribute.

  38. trait oneURI extends optionBuilder[oneURI]

    Card-one URI attribute.

  39. trait oneUUID extends optionBuilder[oneUUID]

    Card-one UUID attribute.

  40. sealed trait optionBuilder[Self] extends AnyRef

    Attribute options.

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. 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[java.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
    @native() @throws( ... )
  20. object many

    Card-many reference.

    Card-many reference.

    See also

    Manual | Example

  21. object manyBi

    Card-many bi-directional reference.

    Card-many bi-directional reference.

    See also

    Manual | Example

  22. object manyBiEdge

    Card-many bi-directional edge reference.

    Card-many bi-directional edge reference.

    See also

    Manual | Example

  23. object manyBigDecimal extends manyBigDecimal
  24. object manyBigInt extends manyBigInt
  25. object manyBoolean extends manyBoolean
  26. object manyByte extends manyByte
  27. object manyDate extends manyDate
  28. object manyDouble extends manyDouble
  29. object manyEnum extends manyEnum
  30. object manyFloat extends manyFloat
  31. object manyInt extends manyInt
  32. object manyLong extends manyLong
  33. object manyString extends manyString
  34. object manyURI extends manyURI
  35. object manyUUID extends manyUUID
  36. object mapBigDecimal extends mapBigDecimal
  37. object mapBigInt extends mapBigInt
  38. object mapBoolean extends mapBoolean
  39. object mapByte extends mapByte
  40. object mapDate extends mapDate
  41. object mapDouble extends mapDouble
  42. object mapFloat extends mapFloat
  43. object mapInt extends mapInt
  44. object mapLong extends mapLong
  45. object mapString extends mapString
  46. object mapURI extends mapURI
  47. object mapUUID extends mapUUID
  48. object one

    Card-one reference.

    Card-one reference.

    See also

    Manual | Example

  49. object oneBi

    Card-one bi-directional reference.

    Card-one bi-directional reference.

    See also

    Manual | Example

  50. object oneBiEdge

    Card-one bi-directional edge reference.

    Card-one bi-directional edge reference.

    See also

    Manual | Example

  51. object oneBigDecimal extends oneBigDecimal
  52. object oneBigInt extends oneBigInt
  53. object oneBoolean extends oneBoolean
  54. object oneByte extends oneByte
  55. object oneDate extends oneDate
  56. object oneDouble extends oneDouble
  57. object oneEnum extends oneEnum
  58. object oneFloat extends oneFloat
  59. object oneInt extends oneInt
  60. object oneLong extends oneLong
  61. object oneString extends oneString
  62. object oneURI extends oneURI
  63. object oneUUID extends oneUUID
  64. object target

    Bi-directional edge target attribute.

    Bi-directional edge target attribute.

    See also

    Manual | Example

Inherited from AnyRef

Inherited from Any

Setup

Options

Cardinality-one attributes

Cardinality-many attributes

Map attributes

References

Bidirectional references

Bidirectional edge references

Ungrouped