Session

skunk.Session
See theSession companion trait
object Session

Attributes

Companion
trait
Source
Session.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Session.type

Members list

Grouped members

Constructors

def fromProtocol[F[_]](proto: Protocol[F], namer: Namer[F], strategy: Strategy, redactionStrategy: RedactionStrategy)(implicit ev: MonadCancel[F, Throwable]): F[Session[F]]

Construct a Session by wrapping an existing Protocol, which we assume has already been started up.

Construct a Session by wrapping an existing Protocol, which we assume has already been started up.

Attributes

Source
Session.scala
def pooled[F[_] : Console](host: String, port: Int, user: String, database: String, password: Option[String], max: Int, debug: Boolean, strategy: Strategy, ssl: SSL, parameters: Map[String, String], socketOptions: List[SocketOption], commandCache: Int, queryCache: Int, parseCache: Int, readTimeout: Duration, redactionStrategy: RedactionStrategy): Resource[F, Resource[F, Session[F]]]

Resource yielding a SessionPool managing up to max concurrent Sessions.

Resource yielding a SessionPool managing up to max concurrent Sessions. Typically you will use this resource once on application startup and pass the resulting Resource[F, Session[F]] to the rest of your program.

The pool maintains a cache of queries and commands that have been checked against the schema, eliminating the need to check them more than once. If your program is changing the schema on the fly than you probably don't want this behavior; you can disable it by setting the commandCache and queryCache parameters to zero.

Note that calling .flatten on the nested Resource returned by this method may seem reasonable, but it will result in a resource that allocates a new pool for each session, which is probably not what you want.

Value parameters

commandCache

Size of the cache for command checking

database

Postgres database

host

Postgres server host

max

Maximum concurrent sessions

port

Postgres port, default 5432

queryCache

Size of the cache for query checking

user

Postgres user

Attributes

Source
Session.scala
def pooledF[F[_] : Console](host: String, port: Int, user: String, database: String, password: Option[String], max: Int, debug: Boolean, strategy: Strategy, ssl: SSL, parameters: Map[String, String], socketOptions: List[SocketOption], commandCache: Int, queryCache: Int, parseCache: Int, readTimeout: Duration, redactionStrategy: RedactionStrategy): Resource[F, Tracer[F] => Resource[F, Session[F]]]

Resource yielding a function from Tracer to SessionPool managing up to max concurrent Sessions.

Resource yielding a function from Tracer to SessionPool managing up to max concurrent Sessions. Typically you will use this resource once on application startup and pass the resulting Resource[F, Session[F]] to the rest of your program.

The pool maintains a cache of queries and commands that have been checked against the schema, eliminating the need to check them more than once. If your program is changing the schema on the fly than you probably don't want this behavior; you can disable it by setting the commandCache and queryCache parameters to zero.

Value parameters

commandCache

Size of the cache for command checking

database

Postgres database

host

Postgres server host

max

Maximum concurrent sessions

port

Postgres port, default 5432

queryCache

Size of the cache for query checking

user

Postgres user

Attributes

Source
Session.scala

Type members

Classlikes

abstract class Impl[F[_]] extends Session[F]

Abstract implementation that use the MonadCancelThrow constraint to implement prepared-if-needed API

Abstract implementation that use the MonadCancelThrow constraint to implement prepared-if-needed API

Attributes

Source
Session.scala
Supertypes
trait Session[F]
class Object
trait Matchable
class Any
object Recyclers

Attributes

Source
Session.scala
Supertypes
class Object
trait Matchable
class Any
Self type
Recyclers.type
implicit class SessionSyntax[F[_]](outer: Session[F])

Attributes

Source
Session.scala
Supertypes
class Object
trait Matchable
class Any
implicit class SignalOps[F[_], A](outer: Signal[F, A])

Attributes

Source
Session.scala
Supertypes
class Object
trait Matchable
class Any

Value members

Concrete methods

def fromSocketGroup[F[_] : Console](socketGroup: SocketGroup[F], host: String, port: Int, user: String, database: String, password: Option[String], debug: Boolean, strategy: Strategy, socketOptions: List[SocketOption], sslOptions: Option[Options[F]], parameters: Map[String, String], describeCache: Cache[F], parseCache: Cache[F], readTimeout: Duration, redactionStrategy: RedactionStrategy)(implicit evidence$16: Tracer[F], evidence$17: Console[F], ev: Temporal[F]): Resource[F, Session[F]]

Attributes

Source
Session.scala
def fromSockets[F[_] : Console](sockets: Resource[F, Socket[F]], user: String, database: String, password: Option[String], debug: Boolean, strategy: Strategy, sslOptions: Option[Options[F]], parameters: Map[String, String], describeCache: Cache[F], parseCache: Cache[F], readTimeout: Duration, redactionStrategy: RedactionStrategy): Resource[F, Session[F]]

Attributes

Source
Session.scala
def single[F[_] : Console](host: String, port: Int, user: String, database: String, password: Option[String], debug: Boolean, strategy: Strategy, ssl: SSL, parameters: Map[String, String], commandCache: Int, queryCache: Int, parseCache: Int, readTimeout: Duration, redactionStrategy: RedactionStrategy): Resource[F, Session[F]]

Resource yielding logically unpooled sessions.

Resource yielding logically unpooled sessions. This can be convenient for demonstrations and programs that only need a single session. In reality each session is managed by its own single-session pool. This method is shorthand for Session.pooled(..., max = 1, ...).flatten.

Attributes

See also

pooled

Source
Session.scala
def singleF[F[_] : Console](host: String, port: Int, user: String, database: String, password: Option[String], debug: Boolean, strategy: Strategy, ssl: SSL, parameters: Map[String, String], commandCache: Int, queryCache: Int, parseCache: Int, readTimeout: Duration, redactionStrategy: RedactionStrategy): Tracer[F] => Resource[F, Session[F]]

Resource yielding logically unpooled sessions given a Tracer.

Resource yielding logically unpooled sessions given a Tracer. This can be convenient for demonstrations and programs that only need a single session. In reality each session is managed by its own single-session pool.

Attributes

See also

pooledF

Source
Session.scala

Concrete fields

val DefaultConnectionParameters: Map[String, String]

Attributes

Source
Session.scala

Attributes

Source
Session.scala

Implicits

Implicits

final implicit def SessionSyntax[F[_]](outer: Session[F]): SessionSyntax[F]

Attributes

Source
Session.scala
final implicit def SignalOps[F[_], A](outer: Signal[F, A]): SignalOps[F, A]

Attributes

Source
Session.scala