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 generic
    Definition Classes
    molecule
  • package schema

    Generic Schema attribute interfaces of all arities.

    Generic Schema attribute interfaces of all arities.

    The generic Schema interface provides attributes to build molecules that query the Schema structure of the current database.

    // List of attribute entity ids
    val attrIds: Seq[Long] = Schema.id.get
    
    // Attribute name elements
    Schema.a.part.ns.nsFull.attr.get === List (
      (":sales_Customer/name", "sales", "Customer", "sales_Customer", "name"),
      (":sales_Customer/name", "sales", "Customer", "sales_Customer", "name"),
      // etc..
    )
    
    // Datomic type and cardinality of attributes
    Schema.a.tpe.card.get === List (
      (":sales_Customer/name", "string", "one"),
      (":accounting_Invoice/invoiceLine", "ref", "many"),
    )
    
    // Optional docs and attribute options
    // These can be retrieved as mandatory or optional values
    Schema.a
          .index
          .doc$
          .unique$
          .fulltext$
          .isComponent$
          .noHistory$
          .get === List(
      (":sales_Customer/name",
        true,            // indexed
        "Customer name", // doc
        None,            // Uniqueness not set
        Some(true),      // Fulltext search set so that we can search for names
        None,            // Not a component
        None             // History is preserved (noHistory not set)
        ),
      (":accounting_Invoice/invoiceLine",
        true,                   // indexed
        "Ref to Invoice lines", // doc
        None,                   // Uniqueness not set
        None,                   // Fulltext search not set
        Some(true),             // Invoice is a component - owns invoice lines
        None                    // History is preserved (noHistory not set)
        ),
    )
    
    // Defined enum values
    Schema.a.enum.get.groupBy(_._1).map(g => g._1 -> g._2) === Map(
      ":Person/gender" -> List("female", "male"),
      ":Interests/sports" -> List("golf", "basket", "badminton")
    )
    
    // Schema transaction times
    Schema.t.tx.txInstant.get === List(
      (t1, tx1, <Date: 2018-11-07 09:28:10>), // Initial schema transaction
      (t2, tx2, <Date: 2019-01-12 12:43:27>), // Additional schema attribute definitions...
    )

    Apply expressions to narrow the returned selection of Schema data:

    // Namespaces in the "gen" partition (partition name tacit)
    Schema.part_("location").ns.get === List("Country", "Region", etc...)
    
    // Attributes in the "Person" namespace
    Schema.ns_("Person").attr.get === List("name", "age", "hobbies", etc...)
    
    // How many enum attributes?
    Schema.enum_.a(count).get === List(2)
    Definition Classes
    generic
    Note

    Schema attributes defined in Datomic's bootstrap process that are not related to the current database are transparently filtered out from all Schema queries.

    See also

    Tests for more Schema query examples.

  • GenericSchema
  • Schema
  • Schema_0
  • Schema_1
  • Schema_10
  • Schema_11
  • Schema_12
  • Schema_13
  • Schema_14
  • Schema_15
  • Schema_16
  • Schema_17
  • Schema_18
  • Schema_19
  • Schema_2
  • Schema_20
  • Schema_21
  • Schema_22
  • Schema_3
  • Schema_4
  • Schema_5
  • Schema_6
  • Schema_7
  • Schema_8
  • Schema_9

trait Schema_21[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U] extends Schema with OutSchema_21[Schema_21, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U]

Source
Schema_21.scala
Linear Supertypes
OutSchema_21[Schema_21, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U], AggregateSchema21[Schema_21, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U], NS21[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U], NS, Schema, GenericNs, AnyRef, Any
Type Hierarchy
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Schema_21
  2. OutSchema_21
  3. AggregateSchema21
  4. NS21
  5. NS
  6. Schema
  7. GenericNs
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. final class a[Ns, In] extends OneString[Ns, In] with Indexed

    (Partition-)Namespace-prefixed attribute name (":part_Ns/attr" or ":Ns/attr" if no partitions).

    (Partition-)Namespace-prefixed attribute name (":part_Ns/attr" or ":Ns/attr" if no partitions).

    Definition Classes
    Schema
  2. final class attr[Ns, In] extends OneString[Ns, In] with Indexed

    Isolated attribute name without namespace prefix ("attr").

    Isolated attribute name without namespace prefix ("attr").

    Definition Classes
    Schema
  3. final class card[Ns, In] extends OneString[Ns, In] with Indexed

    Cardinality: one/many.

    Cardinality: one/many.

    Definition Classes
    Schema
  4. final class doc[Ns, In] extends OneString[Ns, In] with Indexed with Fulltext[Ns, In]

    Documentation string.

    Documentation string.

    Definition Classes
    Schema
  5. final class doc$[Ns, In] extends OneString$[Ns] with Indexed with Fulltext[Ns, In]

    Optional documentation string.

    Optional documentation string.

    Definition Classes
    Schema
  6. final class enum[Ns, In] extends OneString[Ns, In] with Indexed

    Enum attributes.

    Enum attributes.

    Definition Classes
    Schema
  7. final class fulltext[Ns, In] extends OneBoolean[Ns, In] with Indexed

    Attribute fulltext search status (true/not set).

    Attribute fulltext search status (true/not set).

    Definition Classes
    Schema
  8. final class fulltext$[Ns, In] extends OneBoolean$[Ns] with Indexed

    Optional attribute fulltext search status (true/not set).

    Optional attribute fulltext search status (true/not set).

    Definition Classes
    Schema
  9. final class id[Ns, In] extends OneLong[Ns, In] with Indexed

    Attribute definition entity id.

    Attribute definition entity id.

    Definition Classes
    Schema
  10. final class index[Ns, In] extends OneBoolean[Ns, In] with Indexed

    Attribute index status (true/not set).

    Attribute index status (true/not set).

    Definition Classes
    Schema
  11. final class index$[Ns, In] extends OneBoolean$[Ns] with Indexed

    Optional attribute index status (true/not set).

    Optional attribute index status (true/not set).

    Definition Classes
    Schema
  12. final class isComponent[Ns, In] extends OneBoolean[Ns, In] with Indexed

    Attribute isComponent status (true/not set).

    Attribute isComponent status (true/not set).

    Definition Classes
    Schema
  13. final class isComponent$[Ns, In] extends OneBoolean$[Ns] with Indexed

    Optional attribute isComponent status (true/not set).

    Optional attribute isComponent status (true/not set).

    Definition Classes
    Schema
  14. final class noHistory[Ns, In] extends OneBoolean[Ns, In] with Indexed

    Attribute noHistory status (true/not set).

    Attribute noHistory status (true/not set).

    Definition Classes
    Schema
  15. final class noHistory$[Ns, In] extends OneBoolean$[Ns] with Indexed

    Optional attribute noHistory status (true/not set).

    Optional attribute noHistory status (true/not set).

    Definition Classes
    Schema
  16. final class ns[Ns, In] extends OneString[Ns, In] with Indexed

    Namespace name ("ns").

    Namespace name ("ns").

    Definition Classes
    Schema
  17. final class nsFull[Ns, In] extends OneString[Ns, In] with Indexed

    Namespace name with partition prefix ("part_Ns" or simply "ns" if partitions are not defined).

    Namespace name with partition prefix ("part_Ns" or simply "ns" if partitions are not defined).

    Definition Classes
    Schema
  18. final class part[Ns, In] extends OneString[Ns, In] with Indexed

    Partition name (if partitions are not defined it will be an empty string "").

    Partition name (if partitions are not defined it will be an empty string "").

    Definition Classes
    Schema
  19. final class t[Ns, In] extends OneLong[Ns, In] with Indexed

    Attribute definition transaction point in time.

    Attribute definition transaction point in time.

    Definition Classes
    Schema
  20. final class tpe[Ns, In] extends OneString[Ns, In] with Indexed

    Datomic attribute type.

    Datomic attribute type.

    Some Datomic types map to two Scala types:

    Datomic/Scala types:

    • string - String
    • boolean - Boolean
    • long - Int, Long
    • float - Float
    • double - Double
    • bigint - BigInt
    • bigdec - BigDecimal
    • instant - java.util.Date
    • uuid - java.util.UUID
    • uri - java.net.URI
    • ref - Long
    Definition Classes
    Schema
  21. final class tx[Ns, In] extends OneLong[Ns, In] with Indexed

    Attribute definition transaction entity id.

    Attribute definition transaction entity id.

    Definition Classes
    Schema
  22. final class txInstant[Ns, In] extends OneDate[Ns, In] with Indexed

    Attribute definition transaction wall-clock time.

    Attribute definition transaction wall-clock time.

    Definition Classes
    Schema
  23. final class unique[Ns, In] extends OneString[Ns, In] with Indexed

    Attribute uniqueness status (true/not set).

    Attribute uniqueness status (true/not set).

    Definition Classes
    Schema
  24. final class unique$[Ns, In] extends OneString$[Ns] with Indexed

    Optional attribute uniqueness status (true/not set).

    Optional attribute uniqueness status (true/not set).

    Definition Classes
    Schema
  25. type Next[Attr[_, _], Type] = Attr[Schema_22[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, Type], P23[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] with Schema_22[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, Type]
  26. type Stay[Attr[_, _], Type] = Attr[Schema_21[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U], P22[_, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _, _]] with Schema_21[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U]

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 lazy val a: Next[a, String]
  5. final lazy val a_: Stay[a, String]
  6. def apply(v: api.core.count): Schema_21[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, Int]
    Definition Classes
    AggregateSchema21
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. final lazy val attr: Next[attr, String]
  9. final lazy val attr_: Stay[attr, String]
  10. final lazy val card: Next[card, String]
  11. final lazy val card_: Stay[card, String]
  12. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  13. final lazy val doc: Next[doc, String]
  14. final lazy val doc$: Next[doc$, Option[String]]
  15. final lazy val doc_: Stay[doc, String]
  16. final lazy val enum: Next[enum, String]
  17. final lazy val enum_: Stay[enum, String]
  18. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  20. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  21. final lazy val fulltext: Next[fulltext, Boolean]
  22. final lazy val fulltext$: Next[fulltext$, Option[Boolean]]
  23. final lazy val fulltext_: Stay[fulltext, Boolean]
  24. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  25. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  26. final lazy val id: Next[id, Long]
  27. final lazy val id_: Stay[id, Long]
  28. final lazy val index: Next[index, Boolean]
  29. final lazy val index$: Next[index$, Option[Boolean]]
  30. final lazy val index_: Stay[index, Boolean]
  31. final lazy val isComponent: Next[isComponent, Boolean]
  32. final lazy val isComponent$: Next[isComponent$, Option[Boolean]]
  33. final lazy val isComponent_: Stay[isComponent, Boolean]
  34. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  35. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  36. final lazy val noHistory: Next[noHistory, Boolean]
  37. final lazy val noHistory$: Next[noHistory$, Option[Boolean]]
  38. final lazy val noHistory_: Stay[noHistory, Boolean]
  39. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  40. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  41. final lazy val ns: Next[ns, String]
  42. final lazy val nsFull: Next[nsFull, String]
  43. final lazy val nsFull_: Stay[nsFull, String]
  44. final lazy val ns_: Stay[ns, String]
  45. final lazy val part: Next[part, String]
  46. final lazy val part_: Stay[part, String]
  47. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  48. final lazy val t: Next[t, Long]
  49. final lazy val t_: Stay[t, Long]
  50. def toString(): String
    Definition Classes
    AnyRef → Any
  51. final lazy val tpe: Next[tpe, String]
  52. final lazy val tpe_: Stay[tpe, String]
  53. final lazy val tx: Next[tx, Long]
  54. final lazy val txInstant: Next[txInstant, Date]
  55. final lazy val txInstant_: Stay[txInstant, Date]
  56. final lazy val tx_: Stay[tx, Long]
  57. final lazy val unique: Next[unique, String]
  58. final lazy val unique$: Next[unique$, Option[String]]
  59. final lazy val unique_: Stay[unique, String]
  60. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  61. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  62. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Inherited from OutSchema_21[Schema_21, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U]

Inherited from AggregateSchema21[Schema_21, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U]

Inherited from NS21[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U]

Inherited from NS

Inherited from Schema

Inherited from GenericNs

Inherited from AnyRef

Inherited from Any

Ungrouped