trait Query[A, B] extends AnyRef
A query parameterized by some input type A
yielding values of type B
.
We define here the core operations that are needed. Additional operations
are provided on Query0 which is the residual query after applying an
A
. This is the type constructed by the sql
interpolator.
- Self Type
- Query[A, B]
- Source
- query.scala
- Grouped
- Alphabetic
- By Inheritance
- Query
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Diagnostics
- abstract def pos: Option[Pos]
An optional Pos indicating the source location where this Query was constructed.
An optional Pos indicating the source location where this Query was constructed. This is used only for diagnostic purposes.
- abstract def sql: String
The SQL string.
- def analysis: free.connection.ConnectionIO[Analysis]
Program to construct an analysis of this query's SQL statement and asserted parameter and column types.
- def inspect[R](a: A)(f: (String, free.preparedstatement.PreparedStatementIO[Unit]) => free.connection.ConnectionIO[R]): free.connection.ConnectionIO[R]
Program to construct an inspection of the query.
Program to construct an inspection of the query. Given arguments
a
, callsf
with the SQL representation of the query and a statement with all arguments set. Returns the result of theConnectionIO
program constructed. - def outputAnalysis: free.connection.ConnectionIO[Analysis]
Program to construct an analysis of this query's SQL statement and result set column types.
Results
- def accumulate[F[_]](a: A)(implicit arg0: Alternative[F]): free.connection.ConnectionIO[F[B]]
Apply the argument
a
to construct a program in ConnectionIO yielding anF[B]
accumulated viaMonadPlus
append.Apply the argument
a
to construct a program in ConnectionIO yielding anF[B]
accumulated viaMonadPlus
append. This method is more general but less efficient thanto
. - def nel(a: A): free.connection.ConnectionIO[NonEmptyList[B]]
Apply the argument
a
to construct a program in ConnectionIO yielding anNonEmptyList[B]
and raising an exception if the resultset does not have at least one row.Apply the argument
a
to construct a program in ConnectionIO yielding anNonEmptyList[B]
and raising an exception if the resultset does not have at least one row. See alsounique
. - def option(a: A): free.connection.ConnectionIO[Option[B]]
Apply the argument
a
to construct a program in ConnectionIO yielding an optionalB
and raising an exception if the resultset has more than one row.Apply the argument
a
to construct a program in ConnectionIO yielding an optionalB
and raising an exception if the resultset has more than one row. See alsounique
. - def stream(a: A): Stream[free.connection.ConnectionIO, B]
Apply the argument
a
to construct aStream
withDefaultChunkSize
, with effect type ConnectionIO yielding elements of typeB
. - def streamWithChunkSize(a: A, chunkSize: Int): Stream[free.connection.ConnectionIO, B]
Apply the argument
a
to construct aStream
with the given chunking factor, with effect type ConnectionIO yielding elements of typeB
. - def to[F[_]](a: A)(implicit f: Factory[B, F[B]]): free.connection.ConnectionIO[F[B]]
Apply the argument
a
to construct a program in ConnectionIO yielding anF[B]
.Apply the argument
a
to construct a program in ConnectionIO yielding anF[B]
. This is the fastest way to accumulate a collection. - def toMap[K, V](a: A)(implicit ev: =:=[B, (K, V)], f: Factory[(K, V), Map[K, V]]): free.connection.ConnectionIO[Map[K, V]]
Apply the argument
a
to construct a program in ConnectionIO yielding anMap[(K, V)]
accumulated via the providedCanBuildFrom
.Apply the argument
a
to construct a program in ConnectionIO yielding anMap[(K, V)]
accumulated via the providedCanBuildFrom
. This is the fastest way to accumulate a collection. this function can call only when B is (K, V). - def unique(a: A): free.connection.ConnectionIO[B]
Apply the argument
a
to construct a program in ConnectionIO yielding a uniqueB
and raising an exception if the resultset does not have exactly one row.Apply the argument
a
to construct a program in ConnectionIO yielding a uniqueB
and raising an exception if the resultset does not have exactly one row. See alsooption
.
Transformations
Ungrouped
- def toFragment(a: A): fragment.Fragment
Convert this Query to a Fragment.