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

Concise view

Constructors

def fromProtocol[F[_]](proto: Protocol[F], namer: Namer[F], strategy: Strategy)(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): Resource[F, Resource[F, Session[F]]]

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.

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.

Attributes

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

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): Resource[F, Trace[F] => Resource[F, Session[F]]]

Resource yielding a function from Trace 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.

Resource yielding a function from Trace 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.

Attributes

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

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
Graph
Supertypes
trait Session[F]
class Object
trait Matchable
class Any
object Recyclers

Attributes

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

Attributes

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

Attributes

Source:
Session.scala
Graph
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): 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): Resource[F, Session[F]]

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.

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): Trace[F] => Resource[F, Session[F]]

Resource yielding logically unpooled sessions given a Trace. 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.

Resource yielding logically unpooled sessions given a Trace. 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

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