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

GHC 9.14.1 · lts/ghc-9.14.x · 45dd537 · 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 |]
           ]