Skip to content

Instantly share code, notes, and snippets.

@ezhulenev
Created November 22, 2013 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ezhulenev/7602364 to your computer and use it in GitHub Desktop.
Save ezhulenev/7602364 to your computer and use it in GitHub Desktop.
Datomic Schema
object DatomicPricing {
object Schema extends VersionedSchemaComponent("0.0.1") {
object ns {
val pricing = new Namespace("Pricing")
}
val isIndexed = true
val isComponent = true
val quoteId = Attribute(ns.pricing / "QuoteId", SchemaType.string, Cardinality.one).withUnique(Unique.identity)
val years = Attribute(ns.pricing / "Years", SchemaType.ref, Cardinality.many).withIsComponent(isComponent)
}
}
object DatomicPricingYear {
object Schema extends VersionedSchemaComponent("0.0.1") {
object ns {
val pricing = new Namespace("Pricing")
}
val isIndexed = true
val isComponent = true
val year = Attribute(ns.pricing / "Year", SchemaType.bigint, Cardinality.one)
val january = Attribute(ns.pricing / "January", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val february = Attribute(ns.pricing / "February", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val march = Attribute(ns.pricing / "March", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val april = Attribute(ns.pricing / "April", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val may = Attribute(ns.pricing / "May", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val june = Attribute(ns.pricing / "June", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val july = Attribute(ns.pricing / "July", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val august = Attribute(ns.pricing / "August", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val september = Attribute(ns.pricing / "September", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val october = Attribute(ns.pricing / "October", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val november = Attribute(ns.pricing / "November", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val december = Attribute(ns.pricing / "December", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
}
object DatomicPricingMonth {
object Schema extends VersionedSchemaComponent("0.0.1") {
object ns {
val pricing = new Namespace("Pricing")
}
val isComponent = true
val month = Attribute(ns.pricing / "Month", SchemaType.bigint, Cardinality.one)
val _1 = Attribute(ns.pricing / "1", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _2 = Attribute(ns.pricing / "2", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _3 = Attribute(ns.pricing / "3", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _4 = Attribute(ns.pricing / "4", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _5 = Attribute(ns.pricing / "5", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _6 = Attribute(ns.pricing / "6", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _7 = Attribute(ns.pricing / "7", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _8 = Attribute(ns.pricing / "8", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _9 = Attribute(ns.pricing / "9", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _10 = Attribute(ns.pricing / "10", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _11 = Attribute(ns.pricing / "11", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _12 = Attribute(ns.pricing / "12", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _13 = Attribute(ns.pricing / "13", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _14 = Attribute(ns.pricing / "14", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _15 = Attribute(ns.pricing / "15", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _16 = Attribute(ns.pricing / "16", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _17 = Attribute(ns.pricing / "17", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _18 = Attribute(ns.pricing / "18", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _19 = Attribute(ns.pricing / "19", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _20 = Attribute(ns.pricing / "20", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _21 = Attribute(ns.pricing / "21", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _22 = Attribute(ns.pricing / "22", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _23 = Attribute(ns.pricing / "23", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _24 = Attribute(ns.pricing / "24", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _25 = Attribute(ns.pricing / "25", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _26 = Attribute(ns.pricing / "26", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _27 = Attribute(ns.pricing / "27", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _28 = Attribute(ns.pricing / "28", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _29 = Attribute(ns.pricing / "29", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _30 = Attribute(ns.pricing / "30", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
val _31 = Attribute(ns.pricing / "31", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
}
object DatomicPrice {
object Schema extends VersionedSchemaComponent("0.0.1") {
object ns {
val price = new Namespace("Price")
}
val isComponent = true
val quoteId = Attribute(ns.price / "QuoteId", SchemaType.string, Cardinality.one)
val tradeDate = Attribute(ns.price / "TradeDate", SchemaType.string, Cardinality.one)
val priceSchema = Attribute(ns.price / "PriceSchema", SchemaType.string, Cardinality.one)
val price = Attribute(ns.price / "Price", SchemaType.ref, Cardinality.one).withIsComponent(isComponent)
}
...
and specific prices for different types of instruments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment