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 #

Constructors

NonNullable 
Nullable 
Instances
type A (H HT :: Arr Type (C k2) k2) (C ((,,) h o NN) :: C k2) # 
Instance details

Defined in Opaleye.Internal.TypeFamilies

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

Defined in Opaleye.Internal.TypeFamilies

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

Defined in Opaleye.Internal.TypeFamilies

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

Defined in Opaleye.Internal.TypeFamilies

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

Defined in Opaleye.Internal.TypeFamilies

type A (H HT :: Arr Type (TC a) k2) (TC ((,) t b) :: TC a) = A (H HT :: Arr Type (C a) k2) (C t)
type A (H WT :: Arr Type (TC a) Type) (TC ((,) t Opt) :: TC a) # 
Instance details

Defined in Opaleye.Internal.TypeFamilies

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

Defined in Opaleye.Internal.TypeFamilies

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

Defined in Opaleye.Internal.TypeFamilies

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

Defined in Opaleye.Internal.TypeFamilies

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

Defined in Opaleye.Internal.TypeFamilies

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

type family Field_ (a :: Nullability) b #

Instances
type Field_ NonNullable a # 
Instance details

Defined in Opaleye.Field

type Field_ Nullable a # 
Instance details

Defined in Opaleye.Field

data Cursor haskells #

Cursor within a transaction.

runSelect #

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 #

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 #

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] #

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