package qzio
Type Members
- class ResultSetIterator[T] extends BufferedIterator[T]
In order to allow a ResultSet to be consumed by an Observable, a ResultSet iterator must be created.
In order to allow a ResultSet to be consumed by an Observable, a ResultSet iterator must be created. Since Quill provides a extractor for an individual ResultSet row, a single row can easily be cached in memory. This allows for a straightforward implementation of a hasNext method.
- abstract class ZioJdbcContext[+Dialect <: SqlIdiom, +Naming <: NamingStrategy] extends ZioContext[Dialect, Naming] with JdbcContextTypes[Dialect, Naming] with ProtoContext[Dialect, Naming] with ContextVerbStream[Dialect, Naming] with ContextVerbPrepare with ZioTranslateContext
Quill context that executes JDBC queries inside of ZIO.
Quill context that executes JDBC queries inside of ZIO. Unlike most other contexts that require passing in a Data Source, this context takes in a java.sql.Connection as a resource dependency which can be provided later (see
ZioJdbcfor helper methods that assist in doing this).The resource dependency itself is just a
Connection. Since this is frequently used The typeQIO[T]i.e. Quill-IO has been defined as an alias forZIO[Connection, SQLException, T].Since in most JDBC use-cases, a connection-pool datasource i.e. Hikari is used it would actually be much more useful to interact with
ZIO[DataSource, SQLException, T]. The extension method.onDataSourceinio.getquill.context.ZioJdbc.QuillZioExtwill perform this conversion (for even more brevity useonDSwhich is an alias for this method). {{ import ZioJdbc._ val zioDs = DataSourceLayer.fromPrefix("testPostgresDB") MyZioContext.run(query[Person]).onDataSource.provideCustomLayer(zioDS) }}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]).provideLayer(zioDS)) }}
Note however that the one exception to these cases are the
preparemethods where aZIO[Connection, SQLException, PreparedStatement]is being returned. In those situations the acquire-action-release pattern does not make any sense because thePrepareStatementis only held open while it's host-connection exists. - abstract class ZioJdbcUnderlyingContext[+Dialect <: SqlIdiom, +Naming <: NamingStrategy] extends ZioContext[Dialect, Naming] with JdbcContextVerbExecute[Dialect, Naming] with ContextVerbStream[Dialect, Naming] with ZioPrepareContext[Dialect, Naming] with ZioTranslateContext
- trait ZioPrepareContext[+Dialect <: SqlIdiom, +Naming <: NamingStrategy] extends ZioContext[Dialect, Naming] with ContextVerbPrepare