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

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Modulepg-entity-0.0.6.0Haskell2010

Database.PostgreSQL.Entity.Internal.QQ

A quasi-quoter for Fields, supporting optional types.

There is little reason to import this module directly; instead, import Database.PostgreSQL.Entity, which re-exports the field quasiquoter.

  • 1 value
valuefield :: QuasiQuoter
#

A quasi-quoter for safely constructing Fields.

Example:

instance Entity BlogPost where
  tableName  = "blogposts"
  primaryKey = [field| blog_post_id |]
  fields = [ [field| blog_post_id |]
           , [field| author_id |]
           , [field| uuid_list :: uuid[] |] -- ← This is where we specify an optional PostgreSQL type annotation
           , [field| title |]
           , [field| content |]
           , [field| created_at |]
           ]