Query

doobie.util.query.Query
See theQuery companion object
trait Query[A, B]

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.

Attributes

Companion
object
Source
query.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Query[A, B]

Members list

Grouped members

Results

def accumulate[F[_]](a: A)(using evidence$1: Alternative[F]): ConnectionIO[F[B]]

Apply the argument a to construct a program in ConnectionIO yielding an F[B] accumulated via MonadPlus append. This method is more general but less efficient than to.

Apply the argument a to construct a program in ConnectionIO yielding an F[B] accumulated via MonadPlus append. This method is more general but less efficient than to.

Attributes

Source
query.scala
def nel(a: A): ConnectionIO[NonEmptyList[B]]

Apply the argument a to construct a program in ConnectionIO yielding an NonEmptyList[B] and raising an exception if the resultset does not have at least one row. See also unique.

Apply the argument a to construct a program in ConnectionIO yielding an NonEmptyList[B] and raising an exception if the resultset does not have at least one row. See also unique.

Attributes

Source
query.scala
def option(a: A): ConnectionIO[Option[B]]

Apply the argument a to construct a program in ConnectionIO yielding an optional B and raising an exception if the resultset has more than one row. See also unique.

Apply the argument a to construct a program in ConnectionIO yielding an optional B and raising an exception if the resultset has more than one row. See also unique.

Attributes

Source
query.scala
def stream(a: A): Stream[ConnectionIO, B]

Apply the argument a to construct a Stream with DefaultChunkSize, with effect type ConnectionIO yielding elements of type B.

Apply the argument a to construct a Stream with DefaultChunkSize, with effect type ConnectionIO yielding elements of type B.

Attributes

Source
query.scala
def streamWithChunkSize(a: A, chunkSize: Int): Stream[ConnectionIO, B]

Apply the argument a to construct a Stream with the given chunking factor, with effect type ConnectionIO yielding elements of type B.

Apply the argument a to construct a Stream with the given chunking factor, with effect type ConnectionIO yielding elements of type B.

Attributes

Source
query.scala
def to[F[_]](a: A)(implicit f: Factory[B, F[B]]): ConnectionIO[F[B]]

Apply the argument a to construct a program in ConnectionIO yielding an F[B]. This is the fastest way to accumulate a collection.

Apply the argument a to construct a program in ConnectionIO yielding an F[B]. This is the fastest way to accumulate a collection.

Attributes

Source
query.scala
def toMap[K, V](a: A)(implicit ev: B =:= (K, V), f: Factory[(K, V), Map[K, V]]): ConnectionIO[Map[K, V]]

Apply the argument a to construct a program in ConnectionIO yielding an Map[(K, V)] accumulated via the provided CanBuildFrom. This is the fastest way to accumulate a collection. this function can call only when B is (K, V).

Apply the argument a to construct a program in ConnectionIO yielding an Map[(K, V)] accumulated via the provided CanBuildFrom. This is the fastest way to accumulate a collection. this function can call only when B is (K, V).

Attributes

Source
query.scala
def unique(a: A): ConnectionIO[B]

Apply the argument a to construct a program in ConnectionIO yielding a unique B and raising an exception if the resultset does not have exactly one row. See also option.

Apply the argument a to construct a program in ConnectionIO yielding a unique B and raising an exception if the resultset does not have exactly one row. See also option.

Attributes

Source
query.scala

Diagnostics

def analysis: ConnectionIO[Analysis]

Program to construct an analysis of this query's SQL statement and asserted parameter and column types.

Program to construct an analysis of this query's SQL statement and asserted parameter and column types.

Attributes

Source
query.scala
def inspect[R](a: A)(f: (String, PreparedStatementIO[Unit]) => ConnectionIO[R]): ConnectionIO[R]

Program to construct an inspection of the query. Given arguments a, calls f with the SQL representation of the query and a statement with all arguments set. Returns the result of the ConnectionIO program constructed.

Program to construct an inspection of the query. Given arguments a, calls f with the SQL representation of the query and a statement with all arguments set. Returns the result of the ConnectionIO program constructed.

Attributes

Source
query.scala
def outputAnalysis: ConnectionIO[Analysis]

Program to construct an analysis of this query's SQL statement and result set column types.

Program to construct an analysis of this query's SQL statement and result set column types.

Attributes

Source
query.scala
def pos: Option[Pos]

An optional Pos indicating the source location where this Query was constructed. This is used only for diagnostic purposes.

An optional Pos indicating the source location where this Query was constructed. This is used only for diagnostic purposes.

Attributes

Source
query.scala
def sql: String

The SQL string.

The SQL string.

Attributes

Source
query.scala

Transformations

def contramap[C](f: C => A): Query[C, B]

Attributes

Source
query.scala
def map[C](f: B => C): Query[A, C]

Attributes

Source
query.scala
def toQuery0(a: A): Query0[B]

Apply an argument, yielding a residual Query0.

Apply an argument, yielding a residual Query0.

Attributes

Source
query.scala

Value members

Concrete methods

def toFragment(a: A): Fragment

Convert this Query to a Fragment.

Convert this Query to a Fragment.

Attributes

Source
query.scala