io.getquill.context.qzio
Members list
Type members
Classlikes
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.
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.
Attributes
- Supertypes
-
trait BufferedIterator[T]trait Iterator[T]trait IterableOnceOps[T, Iterator, Iterator[T]]trait IterableOnce[T]class Objecttrait Matchableclass AnyShow all
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 ZioJdbc
for helper methods that assist in doing this).
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 ZioJdbc
for helper methods that assist in doing this).
The resource dependency itself is just a Has[Connection]
. Since this is frequently used The type QIO[T]
i.e. Quill-IO has been defined as an alias for ZIO[Has[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[Has[DataSource], SQLException, T]
. The extension method .onDataSource
in io.getquill.context.ZioJdbc.QuillZioExt
will perform this conversion (for even more brevity use onDS
which is an alias for this method). {{ import ZioJdbc._ val zioDs = Quill.DataSource.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]).ContextTranslateProtoprovideLayer(zioDS)) }}
Note however that the one exception to these cases are the prepare
methods where a ZIO[Has[Connection], SQLException, PreparedStatement]
is being returned. In those situations the acquire-action-release pattern does not make any sense because the PrepareStatement
is only held open while it's host-connection exists.
Attributes
- Supertypes
-
trait ZioTranslateContext[Dialect, Naming]trait ContextTranslateMacro[Dialect, Naming]trait ContextTranslateProto[Dialect, Naming]trait ContextVerbPrepare[Dialect, Naming]trait JdbcContextTypes[Dialect, Naming]trait Decoderstrait Encoderstrait SqlContext[Dialect, Naming]trait ZioContext[Dialect, Naming]trait ContextVerbStream[Dialect, Naming]trait ProtoStreamContext[Dialect, Naming]trait Context[Dialect, Naming]trait Closeabletrait AutoCloseabletrait EncodingDsltrait LowPriorityImplicitstrait ProtoContextSecundus[Dialect, Naming]trait RowContextclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class H2ZioJdbcContext[N]class MysqlZioJdbcContext[N]class OracleZioJdbcContext[N]class PostgresZioJdbcContext[N]class SqlServerZioJdbcContext[N]class SqliteZioJdbcContext[N]Show all
Attributes
- Supertypes
-
trait ZioTranslateContext[Dialect, Naming]trait ContextTranslateMacro[Dialect, Naming]trait ContextTranslateProto[Dialect, Naming]trait ContextVerbPrepare[Dialect, Naming]trait JdbcContextVerbExecute[Dialect, Naming]trait JdbcContextTypes[Dialect, Naming]trait Decoderstrait Encoderstrait SqlContext[Dialect, Naming]trait ZioContext[Dialect, Naming]trait ContextVerbStream[Dialect, Naming]trait ProtoStreamContext[Dialect, Naming]trait Context[Dialect, Naming]trait Closeabletrait AutoCloseabletrait EncodingDsltrait LowPriorityImplicitstrait ProtoContextSecundus[Dialect, Naming]trait RowContextclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class Underlying[N]class Underlying[N]class Underlying[N]class Underlying[N]class Underlying[N]class Underlying[N]Show all
Attributes
- Supertypes
-
trait ContextVerbPrepare[Dialect, Naming]trait ZioContext[Dialect, Naming]trait ContextVerbStream[Dialect, Naming]trait ProtoStreamContext[Dialect, Naming]trait Context[Dialect, Naming]trait Closeabletrait AutoCloseabletrait EncodingDsltrait LowPriorityImplicitstrait ProtoContextSecundus[Dialect, Naming]trait RowContextclass Objecttrait Matchableclass AnyShow all
- Known subtypes
-
class H2ZioJdbcContext[N]class MysqlZioJdbcContext[N]class OracleZioJdbcContext[N]class PostgresZioJdbcContext[N]class SqlServerZioJdbcContext[N]class SqliteZioJdbcContext[N]class Underlying[N]class Underlying[N]class Underlying[N]class Underlying[N]class Underlying[N]class Underlying[N]Show all