object ImplicitSyntax
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 provide for 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 }
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- ImplicitSyntax
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Type Members
- final case class Implicit[R](env: R) extends Product with Serializable
A new type that indicates that the value
Rshould be made available to the environment implicitly. - implicit final class ImplicitSyntaxOps[R, E, A] extends AnyVal
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()