HORIZON HASKELLDocslts/ghc-10.0.x8c2f8e82026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19

Moduleopaleye-0.10.8.0Haskell2010

Opaleye.Internal.RunQuery

  • 3 types
  • 1 class
  • 27 values
  • Packageopaleye-0.10.8.0
  • Exports31
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceRunQuery.hs
newtypenewtype FromField sqlType haskellType
#

A FromField sqlType haskellType encodes how to turn a value of Postgres type sqlType into a value of Haskell type haskellType. For example a value of type FromField SqlText String encodes how to turn a SqlText result from the database into a Haskell String.

"FromField sqlType haskellType" corresponds to postgresql-simple's "FieldParser haskellType".

Constructors

Instances19Functor, Default, …
datadata FromFields fields haskells
#

A FromFields specifies how to convert Postgres values (fields) into Haskell values (haskells). Most likely you will never need to create one of these or handle one directly. It will be provided for you by the Default FromFields instance.

"FromFields fields haskells" corresponds to postgresql-simple's "RowParser haskells". "Default FromFields fields haskells" corresponds to postgresql-simple's "FromRow haskells".

Constructors

Instances11Profunctor, ProductProfunctor, SumProfunctor, Functor, Applicative, Default, …
classclass DefaultFromField sqlType haskellType where
#

A DefaultFromField sqlType haskellType represents the default way to turn a sqlType result from the database into a Haskell value of type haskellType.

"DefaultFromField sqlType haskellType" corresponds to postgresql-simple's "FromField haskellType".

Creating an instance of DefaultFromField for your own types is necessary for retrieving those types from the database.

You should use one of the three methods below for writing a DefaultFromField instance.

  1. If you already have a postgresql-simple FromField instance for your haskellType, use fromPGSFromField. (This is how most of the built-in instances are defined.)

  2. If you don't have a postgresql-simple FromField instance, but you do have an Opaleye FromField value for the type it wraps use unsafeFromField if possible. See the documentation for unsafeFromField for an example.

  3. If you have a more complicated case, but not a FromField instance, write a FieldParser for your type and use fromPGSFieldParser. You can also add a FromField instance using this.

Methods

Instances41DefaultFromField, …