package qzio
Ordering
- Alphabetic
Visibility
- Public
- Protected
Type Members
- trait ZioContext[Idiom <: Idiom, Naming <: NamingStrategy] extends Context[Idiom, Naming] with ContextVerbStream[Idiom, Naming]
- trait ZioTranslateContext extends ContextTranslateMacro
Value Members
- object ImplicitSyntax
Use to provide
run(myQuery)calls with a context implicitly saving the need to provide things multiple times.Use to provide
run(myQuery)calls with a context implicitly saving the need to provide things multiple times. For example in JDBC:case class MyQueryService(ds: DataSource) { import Ctx._ implicit val env = Implicit(Has(ds)) val joes = Ctx.run(query[Person].filter(p => p.name == "Joe")).implicitly val jills = Ctx.run(query[Person].filter(p => p.name == "Jill")).implicitly val alexes = Ctx.run(query[Person].filter(p => p.name == "Alex")).implicitly }
Normally you would have to do a separate
providefor each clause:val joes = Ctx.run(query[Person].filter(p => p.name == "Joe")).provide(Has(ds)) val jills = Ctx.run(query[Person].filter(p => p.name == "Jill")).provide(Has(ds)) val alexes = Ctx.run(query[Person].filter(p => p.name == "Alex")).provide(Has(ds))
For other contexts e.g. Cassandra the functionality is identical.
case class MyQueryService(cs: CassandraZioSession) { import Ctx._ implicit val env = Implicit(cs) def joes = Ctx.run { query[Person].filter(p => p.name == "Joe") }.implicitly def jills = Ctx.run { query[Person].filter(p => p.name == "Jill") }.implicitly def alexes = Ctx.run { query[Person].filter(p => p.name == "Alex") }.implicitly }