PreparedQuery

skunk.PreparedQuery
See thePreparedQuery companion object
trait PreparedQuery[F[_], A, B]

A prepared query, valid for the life of its originating Session.

Attributes

Companion
object
Source
PreparedQuery.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def cursor(args: A)(implicit or: Origin): Resource[F, Cursor[F, B]]

Resource that binds the supplied arguments to this PreparedQuery, yielding a Cursor from which rows can be fetched.

Resource that binds the supplied arguments to this PreparedQuery, yielding a Cursor from which rows can be fetched. Note that higher-level operations like stream, option, and unique are usually what you want.

Attributes

Source
PreparedQuery.scala
def option(args: A)(implicit or: Origin): F[Option[B]]

Fetch and return at most one row, raising an exception if more rows are available.

Fetch and return at most one row, raising an exception if more rows are available.

Attributes

Source
PreparedQuery.scala
def stream(args: A, chunkSize: Int)(implicit or: Origin): Stream[F, B]

Construct a Cursor-backed stream that calls fetch repeatedly and emits chunks until none remain.

Construct a Cursor-backed stream that calls fetch repeatedly and emits chunks until none remain. Note that each chunk is read atomically while holding the session mutex, which means interleaved streams will achieve better fairness with smaller chunks but greater overall throughput with larger chunks. So it's important to consider the use case when specifying chunkSize.

Attributes

Source
PreparedQuery.scala
def unique(args: A)(implicit or: Origin): F[B]

Fetch and return exactly one row, raising an exception if there are more or fewer.

Fetch and return exactly one row, raising an exception if there are more or fewer.

Attributes

Source
PreparedQuery.scala

Concrete methods

def pipe(chunkSize: Int)(implicit or: Origin): (F, A) => B

A Pipe that executes this PreparedQuery for each input value, concatenating the resulting streams.

A Pipe that executes this PreparedQuery for each input value, concatenating the resulting streams. See stream for details on the chunkSize parameter.

Attributes

Source
PreparedQuery.scala