skunk
package skunk
- Source
- package.scala
- Grouped
- Alphabetic
- By Inheritance
- skunk
- TwiddleCompat
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Package Members
- package codec
- package data
- package exception
- package net
Skunk network stack, starting with
BitVectorSocket
at the bottom and ending withProtocol
at the top (Session
delegates all its work toProtocol
).Skunk network stack, starting with
BitVectorSocket
at the bottom and ending withProtocol
at the top (Session
delegates all its work toProtocol
). Everything is non-blocking. - package syntax
- package util
Type Members
- type *:[A, B <: Tuple] = ::[A, B]
- Definition Classes
- TwiddleCompat
- sealed trait AppliedFragment extends AnyRef
A fragment applied to its argument, yielding an existentially-typed fragment + argument pair that can be useful when constructing dynamic queries in application code.
A fragment applied to its argument, yielding an existentially-typed fragment + argument pair that can be useful when constructing dynamic queries in application code. Applied fragments must be deconstructed in order to prepare and execute.
- trait Channel[F[_], A, B] extends Pipe[F, A, Unit]
A channel that can be used for inter-process communication, implemented in terms of
LISTEN
andNOTIFY
.A channel that can be used for inter-process communication, implemented in terms of
LISTEN
andNOTIFY
. All instances start life as aChannel[F, String, Notification]
but can be mapped out to different input and output types. See the linked documentation for more information on the transactional semantics of these operations. - trait Codec[A] extends Encoder[A] with Decoder[A]
Symmetric encoder and decoder of Postgres text-format data to and from Scala types.
- final case class Command[A](sql: String, origin: Origin, encoder: Encoder[A]) extends Statement[A] with Product with Serializable
SQL and parameter encoder for a statement that returns no rows.
SQL and parameter encoder for a statement that returns no rows. We assume that
sql
has the same number of placeholders of the form$1
,$2
, etc., as the number of slots encoded byencoder
, and that the parameter types specified byencoder
are consistent with the schema. Thecheck
methods on Session provide a means to verify this assumption.You can construct a
Command
directly, although it is more typical to use thesql
interpolator.sql"INSERT INTO foo VALUES ($int2, $varchar)".command // Command[(Short, String)]
- sql
A SQL statement returning no rows.
- encoder
An encoder for all parameters
$1
,$2
, etc., insql
.
- See also
StringContextOps for information on the
sql
interpolator.Session for information on executing a
Command
.
- trait Cursor[F[_], A] extends AnyRef
An open cursor from which rows can be fetched, valid during the lifetime its defining
Session
.An open cursor from which rows can be fetched, valid during the lifetime its defining
Session
. You can use this mechanism to implement chunked reads and paged results, although it is ofen more pleasant to use aCursor
-backedStream
, as produced by PreparedQuery#stream. - trait Decoder[A] extends AnyRef
Decoder of Postgres text-format data into Scala types.
- type EmptyTuple = HNil
- Definition Classes
- TwiddleCompat
- trait Encoder[A] extends AnyRef
Encoder of Postgres text-format data from Scala types.
- final case class Fragment[A](parts: List[Either[String, State[Int, String]]], encoder: Encoder[A], origin: Origin) extends (A) => AppliedFragment with Product with Serializable
A composable, embeddable hunk of SQL and typed parameters (common precursor to
Command
andQuery
).A composable, embeddable hunk of SQL and typed parameters (common precursor to
Command
andQuery
). Although it is possible to construct aFragment
directly it is more typical to use thesql
interpolator. - trait PreparedCommand[F[_], A] extends AnyRef
A prepared command, valid for the life of its defining
Session
. - trait PreparedQuery[F[_], A, B] extends AnyRef
A prepared query, valid for the life of its originating
Session
. - final case class Query[A, B](sql: String, origin: Origin, encoder: Encoder[A], decoder: Decoder[B], isDynamic: Boolean = false) extends Statement[A] with Product with Serializable
SQL, parameter encoder, and row decoder for a statement that returns rows.
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 byencoder
, thatsql
selects the same number of columns are the number of slots decoded bydecoder
, and that the parameter and column types specified byencoder
anddecoder
are consistent with the schema. Thecheck
methods on Session provide a means to verify this assumption.You can construct a
Query
directly, although it is more typical to use thesql
interpolator.sql"SELECT name, age FROM person WHERE age > $int2".query(varchar *: int2) // Query[Short, (String, Short)]
- sql
A SQL statement returning no rows.
- origin
The
Origin
where the sql was defined, if any.- encoder
An encoder for all parameters
$1
,$2
, etc., insql
.- decoder
A decoder for selected columns.
- See also
StringContextOps for information on the
sql
interpolator.Session for information on executing a
Query
.
- sealed trait RedactionStrategy extends AnyRef
Specifies how encoded values are redacted before being shown in exceptions and traces.
- abstract class SSL extends AnyRef
- trait Session[F[_]] extends AnyRef
Represents a live connection to a Postgres database.
Represents a live connection to a Postgres database. Operations provided here are safe to use concurrently. Note that this is a lifetime-managed resource and as such is invalid outside the scope of its owning
Resource
, as are any streams constructed here. If youstart
an operation be sure tojoin
itsFiber
before releasing the resource.See the companion object for information on obtaining a pooled or single-use instance.
- type SessionPool[F[_]] = Resource[F, Resource[F, Session[F]]]
- sealed abstract class SqlState extends EnumEntry
Enumerated type of Postgres error codes.
Enumerated type of Postgres error codes. See the companion object for more information.
- trait Statement[A] extends AnyRef
- type Strategy = skunk.util.Typer.Strategy
- trait Transaction[F[_]] extends AnyRef
Control methods for use within a
transaction
block.Control methods for use within a
transaction
block. An instance is provided when you callSession.transaction(...).use
.- See also
Session#transaction for information on default commit/rollback behavior
- type Tuple = HList
- Definition Classes
- TwiddleCompat
- sealed trait Void extends AnyRef
A singly-inhabited type representing arguments to a parameterless statement.
- type ~[+A, +B] = (A, B)
Infix alias for
(A, B)
that provides convenient syntax for left-associated HLists.
Value Members
- val *:: ::.type
- Definition Classes
- TwiddleCompat
- Annotations
- @inline()
- val EmptyTuple: EmptyTuple
- Definition Classes
- TwiddleCompat
- Annotations
- @inline()
- val Strategy: skunk.util.Typer.Strategy.type
- val Tuple: HList.type
- Definition Classes
- TwiddleCompat
- Annotations
- @inline()
- implicit def hlistToTuple[L <: Tuple, T](l: L)(implicit tupler: shapeless.ops.hlist.Tupler.Aux[L, T]): T
- Definition Classes
- TwiddleCompat
- implicit def toTupleOps[T <: Tuple](t: T): TupleOps[T]
- Definition Classes
- TwiddleCompat
- implicit def tuple10ToHList[A, B, C, D, E, F, G, H, I, J](t: (A, B, C, D, E, F, G, H, I, J)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, *:[H, *:[I, *:[J, EmptyTuple]]]]]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple11ToHList[A, B, C, D, E, F, G, H, I, J, K](t: (A, B, C, D, E, F, G, H, I, J, K)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, *:[H, *:[I, *:[J, *:[K, EmptyTuple]]]]]]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple12ToHList[A, B, C, D, E, F, G, H, I, J, K, L](t: (A, B, C, D, E, F, G, H, I, J, K, L)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, *:[H, *:[I, *:[J, *:[K, *:[L, EmptyTuple]]]]]]]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple13ToHList[A, B, C, D, E, F, G, H, I, J, K, L, M](t: (A, B, C, D, E, F, G, H, I, J, K, L, M)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, *:[H, *:[I, *:[J, *:[K, *:[L, *:[M, EmptyTuple]]]]]]]]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple14ToHList[A, B, C, D, E, F, G, H, I, J, K, L, M, N](t: (A, B, C, D, E, F, G, H, I, J, K, L, M, N)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, *:[H, *:[I, *:[J, *:[K, *:[L, *:[M, *:[N, EmptyTuple]]]]]]]]]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple15ToHList[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O](t: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, *:[H, *:[I, *:[J, *:[K, *:[L, *:[M, *:[N, *:[O, EmptyTuple]]]]]]]]]]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple16ToHList[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P](t: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, *:[H, *:[I, *:[J, *:[K, *:[L, *:[M, *:[N, *:[O, *:[P, EmptyTuple]]]]]]]]]]]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple17ToHList[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q](t: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, *:[H, *:[I, *:[J, *:[K, *:[L, *:[M, *:[N, *:[O, *:[P, *:[Q, EmptyTuple]]]]]]]]]]]]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple18ToHList[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R](t: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, *:[H, *:[I, *:[J, *:[K, *:[L, *:[M, *:[N, *:[O, *:[P, *:[Q, *:[R, EmptyTuple]]]]]]]]]]]]]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple19ToHList[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S](t: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, *:[H, *:[I, *:[J, *:[K, *:[L, *:[M, *:[N, *:[O, *:[P, *:[Q, *:[R, *:[S, EmptyTuple]]]]]]]]]]]]]]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple20ToHList[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T](t: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, *:[H, *:[I, *:[J, *:[K, *:[L, *:[M, *:[N, *:[O, *:[P, *:[Q, *:[R, *:[S, *:[T, EmptyTuple]]]]]]]]]]]]]]]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple21ToHList[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U](t: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, *:[H, *:[I, *:[J, *:[K, *:[L, *:[M, *:[N, *:[O, *:[P, *:[Q, *:[R, *:[S, *:[T, *:[U, EmptyTuple]]]]]]]]]]]]]]]]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple22ToHList[A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V](t: (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, *:[H, *:[I, *:[J, *:[K, *:[L, *:[M, *:[N, *:[O, *:[P, *:[Q, *:[R, *:[S, *:[T, *:[U, *:[V, EmptyTuple]]]]]]]]]]]]]]]]]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple2ToHList[A, B](t: (A, B)): *:[A, *:[B, EmptyTuple]]
- Definition Classes
- TwiddleCompat
- implicit def tuple3ToHList[A, B, C](t: (A, B, C)): *:[A, *:[B, *:[C, EmptyTuple]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple4ToHList[A, B, C, D](t: (A, B, C, D)): *:[A, *:[B, *:[C, *:[D, EmptyTuple]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple5ToHList[A, B, C, D, E](t: (A, B, C, D, E)): *:[A, *:[B, *:[C, *:[D, *:[E, EmptyTuple]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple6ToHList[A, B, C, D, E, F](t: (A, B, C, D, E, F)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, EmptyTuple]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple7ToHList[A, B, C, D, E, F, G](t: (A, B, C, D, E, F, G)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, EmptyTuple]]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple8ToHList[A, B, C, D, E, F, G, H](t: (A, B, C, D, E, F, G, H)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, *:[H, EmptyTuple]]]]]]]]
- Definition Classes
- TwiddleCompat
- implicit def tuple9ToHList[A, B, C, D, E, F, G, H, I](t: (A, B, C, D, E, F, G, H, I)): *:[A, *:[B, *:[C, *:[D, *:[E, *:[F, *:[G, *:[H, *:[I, EmptyTuple]]]]]]]]]
- Definition Classes
- TwiddleCompat
- object AppliedFragment
- object Channel
- object Codec extends TwiddleSyntax[Codec]
- object Command extends Serializable
- object Cursor
- object Decoder extends TwiddleSyntax[Decoder]
- object Encoder extends TwiddleSyntax[Encoder]
- object Fragment extends TwiddleSyntax[Fragment] with Serializable
- object PreparedCommand
- object PreparedQuery
- object Query extends Serializable
- object RedactionStrategy
- object SSL extends SSLCompanionPlatform
- object Session
- object SqlState extends Enum[SqlState]
Enumerated type of Postgres error codes.
Enumerated type of Postgres error codes. These can be used as extractors for error handling, for example:
doSomething.recoverWith { case SqlState.ForeignKeyViolation(ex) => ... }
- See also
- object Statement
- object Transaction
- case object Void extends Void with Product with Serializable
- object feature
- object featureFlags
- object implicits extends ToAllOps
- object ~
Companion providing unapply for
~
such that(x ~ y ~ z) match { case a ~ b ~ c => ... }
.