relational-query-0.0.1.3: Typeful, Modular, Relational, algebraic query engine

Copyright2013 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Database.Relational.Query.Expr

Contents

Description

This module defines phantom typed SQL expression object. Contains normal interfaces.

Synopsis

Typed SQL Expression

data Expr p a Source

Phantom typed SQL expression object. Project from projection type p.

Instances

ProjectableMaybe (Expr p)

Control phantom Maybe type in SQL expression type Expr.

ProjectableShowSql (Expr p)

Unsafely get SQL term from Expr.

SqlProjectable (Expr p)

Unsafely make Expr from SQL terms.

Show (Expr p a)

Show expression.

valueExpr :: ShowConstantTermsSQL ft => ft -> Expr p ft Source

Typed constant SQL expression from Haskell value.

Type conversion

just :: Expr p ft -> Expr p (Maybe ft) Source

Convert phantom type into Maybe.

fromJust :: Expr p (Maybe ft) -> Expr p ft Source

Allowed only for having or where Expr. So NULL expression result will be possible. Behavior around boolean is strongly dependent on RDBMS impelemetations.

exprAnd :: Expr p Bool -> Expr p Bool -> Expr p Bool Source

AND operator for Expr.