classCassandraZioContext[N <: NamingStrategy] extends CassandraRowContext[N] with ZioContext[CqlIdiom, N] with Context[CqlIdiom, N]
Quill context that executes Cassandra queries inside of ZIO.
Quill context that executes Cassandra queries inside of ZIO. Unlike most other contexts
that require passing in a Data Source, this context takes in a CassandraZioSession
as a resource dependency which can be provided later (see the CassandraZioSession object for helper methods
that assist in doing this).
The resource dependency itself is just a Has[CassandraZioSession]
Various methods in the io.getquill.CassandraZioSession can assist in simplifying it's creation, for example, you can
provide a Config object instead of a CassandraZioSession like this
(note that the resulting CassandraZioSession has a closing bracket).
{{
val zioSession =
CassandraZioSession.fromPrefix("testStreamDB")
}}
If you are using a Plain Scala app however, you will need to manually run it e.g. using zio.Runtime
{{
Runtime.default.unsafeRun(MyZioContext.run(query[Person]).provideCustomLayer(zioSession))
}}
case classCassandraZioSession(session: CqlSession, preparedStatementCacheSize: Long) extends CassandraSession with SyncCache with AsyncFutureCache with AutoCloseable with Product with Serializable
Quill context that executes Cassandra queries inside of ZIO. Unlike most other contexts that require passing in a Data Source, this context takes in a
CassandraZioSession
as a resource dependency which can be provided later (see theCassandraZioSession
object for helper methods that assist in doing this).The resource dependency itself is just a Has[CassandraZioSession]
Various methods in the
io.getquill.CassandraZioSession
can assist in simplifying it's creation, for example, you can provide aConfig
object instead of aCassandraZioSession
like this (note that the resulting CassandraZioSession has a closing bracket). {{ val zioSession = CassandraZioSession.fromPrefix("testStreamDB") }}If you are using a Plain Scala app however, you will need to manually run it e.g. using zio.Runtime {{ Runtime.default.unsafeRun(MyZioContext.run(query[Person]).provideCustomLayer(zioSession)) }}