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

    api Molecule API.
    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.
    input Input molecules awaiting input.
    macros Internal macros generating molecule code from custom DSL molecule constructs.
    generic Interfaces to generic information about datoms and Datomic database.
    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.fulltext   // 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.fulltext
      val age     = oneInt
      val address = one[Address]
      val bought  = many[products.Item]
    }
    trait Address {
      val street = oneString.fulltext
      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
Content Hierarchy
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. Protected

Type Members

  1. class InOut extends Annotation with StaticAnnotation

    Arity annotation for number of molecule input/output attributes.

  2. trait many extends refOptionBuilder[many]

    Card-many reference.

    Card-many reference.

    See also

    Manual | Example

  3. trait manyBi extends refOptionBuilder[manyBi]

    Card-many bi-directional reference.

    Card-many bi-directional reference.

    See also

    Manual | Example

  4. trait manyBiEdge extends refOptionBuilder[manyBiEdge]

    Card-many bi-directional edge reference.

    Card-many bi-directional edge reference.

    See also

    Manual | Example

  5. trait manyBigDecimal extends number[manyBigDecimal, BigDecimal]

    Card-many BigDecimal attribute.

  6. trait manyBigInt extends number[manyBigInt, BigInt]

    Card-many BigInt attribute.

  7. trait manyBoolean extends optionBuilder[manyBoolean]

    Card-many Boolean attribute.

  8. trait manyByte extends optionBuilder[manyByte]

    Card-many Bytes attribute.

  9. trait manyDate extends optionBuilder[manyDate]

    Card-many Date attribute.

  10. trait manyDouble extends number[manyDouble, Double]

    Card-many Double attribute.

  11. trait manyEnum extends enum

    Card-many Enum attribute.

  12. trait manyFloat extends number[manyFloat, Float]

    Card-many Float attribute.

  13. trait manyInt extends number[manyInt, Int]

    Card-many Int attribute.

  14. trait manyLong extends number[manyLong, Long]

    Card-many Long attribute.

  15. trait manyString extends optionBuilder[manyString]

    Card-many String attribute.

  16. trait manyURI extends optionBuilder[manyURI]

    Card-many URI attribute.

  17. trait manyUUID extends optionBuilder[manyUUID]

    Card-many UUID attribute.

  18. trait mapBigDecimal extends number[mapBigDecimal, BigDecimal]

    BigDecimal map attribute.

  19. trait mapBigInt extends number[mapBigInt, BigInt]

    BigInt map attribute.

  20. trait mapBoolean extends optionBuilder[mapBoolean]

    Boolean map attribute.

  21. trait mapByte extends optionBuilder[mapByte]

    Bytes map attribute.

  22. trait mapDate extends optionBuilder[mapDate]

    Date map attribute.

  23. trait mapDouble extends number[mapDouble, Double]

    Double map attribute.

  24. trait mapFloat extends number[mapFloat, Float]

    Float map attribute.

  25. trait mapInt extends number[mapInt, Int]

    Int map attribute.

  26. trait mapLong extends number[mapLong, Long]

    Long map attribute.

  27. trait mapString extends optionBuilder[mapString]

    String map attribute.

  28. trait mapURI extends optionBuilder[mapURI]

    URI map attribute.

  29. trait mapUUID extends optionBuilder[mapUUID]

    UUID map attribute.

  30. trait one extends refOptionBuilder[one]

    Card-one reference.

    Card-one reference.

    See also

    Manual | Example

  31. trait oneBi extends refOptionBuilder[oneBi]

    Card-one bi-directional reference.

    Card-one bi-directional reference.

    See also

    Manual | Example

  32. trait oneBiEdge extends refOptionBuilder[oneBiEdge]

    Card-one bi-directional edge reference.

    Card-one bi-directional edge reference.

    See also

    Manual | Example

  33. trait oneBigDecimal extends number[oneBigDecimal, BigDecimal]

    Card-one BigDecimal attribute.

  34. trait oneBigInt extends number[oneBigInt, BigInt]

    Card-one BigInt attribute.

  35. trait oneBoolean extends optionBuilder[oneBoolean]

    Card-one Boolean attribute.

  36. trait oneByte extends optionBuilder[oneByte]

    Card-one Bytes attribute.

  37. trait oneDate extends optionBuilder[oneDate]

    Card-one Date attribute.

  38. trait oneDouble extends number[oneDouble, Double]

    Card-one Double attribute.

  39. trait oneEnum extends enum

    Card-one Enum attribute.

  40. trait oneFloat extends number[oneFloat, Float]

    Card-one Float attribute.

  41. trait oneInt extends number[oneInt, Int]

    Card-one Int attribute.

  42. trait oneLong extends number[oneLong, Long]

    Card-one Long attribute.

  43. trait oneString extends optionBuilder[oneString]

    Card-one String attribute.

  44. trait oneURI extends optionBuilder[oneURI]

    Card-one URI attribute.

  45. trait oneUUID extends optionBuilder[oneUUID]

    Card-one UUID attribute.

  46. sealed trait optionBuilder[Self] extends AnyRef

    Attribute options.

  47. trait refOptionBuilder[RefType] extends optionBuilder[RefType]
  48. trait target extends refOptionBuilder[target]

    Bi-directional edge target attribute.

    Bi-directional edge target attribute.

    See also

    Manual | Example

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(classOf[java.lang.CloneNotSupportedException]) @native()
  6. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  7. def equals(arg0: AnyRef): 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[_ <: AnyRef]
    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(classOf[java.lang.InterruptedException])
  18. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  19. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  20. object many extends many
  21. object manyBi extends manyBi
  22. object manyBiEdge extends manyBiEdge
  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 extends one
  49. object oneBi extends oneBi
  50. object oneBiEdge extends oneBiEdge
  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 extends target

Inherited from AnyRef

Inherited from Any

Setup

Options

Cardinality-one attributes

Cardinality-many attributes

Map attributes

References

Bidirectional references

Bidirectional edge references

Ungrouped