opaleye-0.6.7003.1: An SQL-generating DSL targeting PostgreSQL

Safe HaskellNone
LanguageHaskell2010

Opaleye

Description

An SQL-generating DSL targeting PostgreSQL. Allows Postgres queries to be written within Haskell in a typesafe and composable fashion.

You might like to look at

Synopsis

Documentation

data Nullability Source #

Constructors

NonNullable 
Nullable 
Instances
type A (H NullsT :: Arr * (TC a) k2) (TC ((,) t b) :: TC a) Source # 
Instance details

Defined in Opaleye.Internal.TypeFamilies

type A (H NullsT :: Arr * (TC a) k2) (TC ((,) t b) :: TC a) = A (H NullsT :: Arr * (C a) k2) (C t)
type A (H WT :: Arr * (TC a) k2) (TC ((,) t Req) :: TC a) Source # 
Instance details

Defined in Opaleye.Internal.TypeFamilies

type A (H WT :: Arr * (TC a) k2) (TC ((,) t Req) :: TC a) = A (H OT :: Arr * (C a) k2) (C t)
type A (H OT :: Arr * (TC a) k2) (TC ((,) t b) :: TC a) Source # 
Instance details

Defined in Opaleye.Internal.TypeFamilies

type A (H OT :: Arr * (TC a) k2) (TC ((,) t b) :: TC a) = A (H OT :: Arr * (C a) k2) (C t)
type A (H HT :: Arr * (TC a) k2) (TC ((,) t b) :: TC a) Source # 
Instance details

Defined in Opaleye.Internal.TypeFamilies

type A (H HT :: Arr * (TC a) k2) (TC ((,) t b) :: TC a) = A (H HT :: Arr * (C a) k2) (C t)
type A (H HT :: Arr * (C k2) k2) (C ((,,) h o NN) :: C k2) Source # 
Instance details

Defined in Opaleye.Internal.TypeFamilies

type A (H HT :: Arr * (C k2) k2) (C ((,,) h o NN) :: C k2) = h
type A (H WT :: Arr * (TC a) *) (TC ((,) t Opt) :: TC a) Source # 
Instance details

Defined in Opaleye.Internal.TypeFamilies

type A (H WT :: Arr * (TC a) *) (TC ((,) t Opt) :: TC a) = Maybe (A (H OT :: Arr * (C a) *) (C t))
type A (H NullsT :: Arr * (C *) *) (C ((,,) h o NN) :: C *) Source # 
Instance details

Defined in Opaleye.Internal.TypeFamilies

type A (H NullsT :: Arr * (C *) *) (C ((,,) h o NN) :: C *) = Column (Nullable o)
type A (H OT :: Arr * (C *) *) (C ((,,) h o N) :: C *) Source # 
Instance details

Defined in Opaleye.Internal.TypeFamilies

type A (H OT :: Arr * (C *) *) (C ((,,) h o N) :: C *) = Column (Nullable o)
type A (H OT :: Arr * (C *) *) (C ((,,) h o NN) :: C *) Source # 
Instance details

Defined in Opaleye.Internal.TypeFamilies

type A (H OT :: Arr * (C *) *) (C ((,,) h o NN) :: C *) = Column o
type A (H HT :: Arr * (C *) *) (C ((,,) h o N) :: C *) Source # 
Instance details

Defined in Opaleye.Internal.TypeFamilies

type A (H HT :: Arr * (C *) *) (C ((,,) h o N) :: C *) = Maybe h

type family Field_ (a :: Nullability) b Source #

Instances
type Field_ NonNullable a Source # 
Instance details

Defined in Opaleye.Field

type Field_ Nullable a Source # 
Instance details

Defined in Opaleye.Field

data Cursor haskells Source #

Cursor within a transaction.

runSelect Source #

Arguments

:: Default FromFields fields haskells 
=> Connection 
-> Select fields 
-> IO [haskells] 

runSelect's use of the Default typeclass means that the compiler will have trouble inferring types. It is strongly recommended that you provide full type signatures when using runSelect.

Example type specialization:

runSelect :: Select (Column SqlInt4, Column SqlText) -> IO [(Int, String)]

Assuming the makeAdaptorAndInstance splice has been run for the product type Foo:

runSelect :: Select (Foo (Column SqlInt4) (Column SqlText) (Column SqlBool)
          -> IO [Foo Int String Bool]

runSelectTF Source #

Arguments

:: Default FromFields (rec O) (rec H) 
=> Connection 
-> Select (rec O) 
-> IO [rec H] 

runSelectTF has better type inference than runSelect but only works with "higher-kinded data" types.

runSelectFold Source #

Arguments

:: Default FromFields fields haskells 
=> Connection 
-> Select fields 
-> b 
-> (b -> haskells -> IO b) 
-> IO b 

runSelectFold streams the results of a query incrementally and consumes the results with a left fold.

This fold is not strict. The stream consumer is responsible for forcing the evaluation of its result to avoid space leaks.

runSelectExplicit :: FromFields fields haskells -> Connection -> Select fields -> IO [haskells] Source #

runSelectFoldExplicit :: FromFields fields haskells -> Connection -> Select fields -> b -> (b -> haskells -> IO b) -> IO b Source #