Query

skunk.Query
See theQuery companion object
final case class Query[A, B](sql: String, origin: Origin, encoder: Encoder[A], decoder: Decoder[B], isDynamic: Boolean) extends Statement[A]

SQL, parameter encoder, and row decoder for a statement that returns rows. We assume that sql has the same number of placeholders of the form $1, $2, etc., as the number of slots encoded by encoder, that sql selects the same number of columns are the number of slots decoded by decoder, and that the parameter and column types specified by encoder and decoder are consistent with the schema. The check methods on Session provide a means to verify this assumption.

You can construct a Query directly, although it is more typical to use the sql interpolator.

sql"SELECT name, age FROM person WHERE age > $int2".query(varchar ~ int2) // Query[Short, String ~ Short]

Attributes

decoder

A decoder for selected columns.

encoder

An encoder for all parameters $1, $2, etc., in sql.

origin

The Origin where the sql was defined, if any.

sql

A SQL statement returning no rows.

See also:

StringContextOps for information on the sql interpolator.

Session for information on executing a Query.

Companion:
object
Source:
Query.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Statement[A]
class Object
trait Matchable
class Any

Members list

Concise view

Transformations

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

Query is a contravariant functor in A.

Query is a contravariant functor in A.

Attributes

Source:
Query.scala
def dimap[C, D](f: C => A)(g: B => D): Query[C, D]

Query is a profunctor.

Query is a profunctor.

Attributes

Source:
Query.scala
def map[D](g: B => D): Query[A, D]

Query is a covariant functor in B.

Query is a covariant functor in B.

Attributes

Source:
Query.scala

Value members

Concrete methods

Attributes

Source:
Query.scala
def gcontramap[C](implicit ev: Aux[C, A]): Query[C, B]

Attributes

Source:
Query.scala
def gmap[D](implicit ev: Aux[D, B]): Query[A, D]

Attributes

Source:
Query.scala

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product