Protocol

skunk.net.Protocol
See theProtocol companion object
trait Protocol[F[_]]

Interface for a Postgres database, expressed through high-level operations that rely on exchange of multiple messages. Operations here can be executed concurrently and are non-cancelable. The structures returned here expose internals (safely) that are important for error reporting but are not generally useful for end users.

Attributes

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

Members list

Value members

Abstract methods

def cleanup: F[Unit]

Cleanup the session.

Cleanup the session. This will close any cached prepared statements.

Attributes

Source
Protocol.scala

Cache for the Describe protocol.

Cache for the Describe protocol.

Attributes

Source
Protocol.scala
def execute(command: Command[Void]): F[Completion]

Execute a non-parameterized command (a statement that produces no rows), yielding a Completion.

Execute a non-parameterized command (a statement that produces no rows), yielding a Completion. This is equivalent to prepare + bind + execute but it uses the "simple" query protocol which requires fewer message exchanges.

Attributes

Source
Protocol.scala
def execute[A](query: Query[Void, A], ty: Typer): F[List[A]]

Execute a non-parameterized query (a statement that produces rows), yielding all rows.

Execute a non-parameterized query (a statement that produces rows), yielding all rows. This is equivalent to prepare + bind + execute but it uses the "simple" query protocol which requires fewer message exchanges. If you wish to page or stream results you need to use the general protocol instead.

Attributes

Source
Protocol.scala
def notifications(maxQueued: Int): Resource[F, Stream[F, Notification[String]]]

Unfiltered stream of all asynchronous channel notifications sent to this session.

Unfiltered stream of all asynchronous channel notifications sent to this session. In general this stream is consumed asynchronously and the associated fiber is canceled before the session ends.

Attributes

See also
Source
Protocol.scala
def parameters: Signal[F, Map[String, String]]

Signal representing the current state of all Postgres configuration variables announced to this session.

Signal representing the current state of all Postgres configuration variables announced to this session. These are sent after authentication and are updated asynchronously if the runtime environment changes. The current keys are as follows (with example values), but these may change with future releases so you should be prepared to handle unexpected ones.

Map(
 "application_name"            -> "",
 "client_encoding"             -> "UTF8",
 "DateStyle"                   -> "ISO, MDY",
 "integer_datetimes"           -> "on",       // cannot change after startup
 "IntervalStyle"               -> "postgres",
 "is_superuser"                -> "on",
 "server_encoding"             -> "UTF8",     // cannot change after startup
 "server_version"              -> "9.5.3",    // cannot change after startup
 "session_authorization"       -> "postgres",
 "standard_conforming_strings" -> "on",
 "TimeZone"                    -> "US/Pacific",
)

Attributes

Source
Protocol.scala
def parseCache: Cache[F]

Cache for the Parse protocol.

Cache for the Parse protocol.

Attributes

Source
Protocol.scala
def prepare[A](command: Command[A], ty: Typer): F[PreparedCommand[F, A]]

Prepare a command (a statement that produces no rows), yielding a Protocol.PreparedCommand which will be cached per session and closed on session close.

Prepare a command (a statement that produces no rows), yielding a Protocol.PreparedCommand which will be cached per session and closed on session close.

Attributes

Source
Protocol.scala
def prepare[A, B](query: Query[A, B], ty: Typer): F[PreparedQuery[F, A, B]]

Prepare a query (a statement that produces rows), yielding a Protocol.PreparedCommand which which will be cached per session and closed on session close.

Prepare a query (a statement that produces rows), yielding a Protocol.PreparedCommand which which will be cached per session and closed on session close.

Attributes

Source
Protocol.scala
def startup(user: String, database: String, password: Option[String], parameters: Map[String, String]): F[Unit]

Initiate the session.

Initiate the session. This must be the first thing you do. This is very basic at the moment.

Attributes

Source
Protocol.scala

Signal representing the current transaction status as reported by ReadyForQuery.

Signal representing the current transaction status as reported by ReadyForQuery. It's not clear that this is a useful thing to expose.

Attributes

Source
Protocol.scala