haskelldb-2.1.0: A library of combinators for generating and executing SQL statements.

Portabilitynon portable
Stabilityexperimental
Maintainerhaskelldb-users@lists.sourceforge.net

Database.HaskellDB.PrimQuery

Contents

Description

PrimQuery defines the datatype of relational expressions (PrimQuery) and some useful functions on PrimQuery's

Synopsis

Type Declarations

Types

Data types

data RelOp Source

Instances

data SpecialOp Source

Constructors

Order [OrderExpr] 
Top Int 

Instances

data OrderOp Source

Constructors

OpAsc 
OpDesc 

Instances

data Literal Source

Constructors

NullLit 
DefaultLit

represents a default value

BoolLit Bool 
StringLit String 
IntegerLit Integer 
DoubleLit Double 
DateLit CalendarTime 
OtherLit String

used for hacking in custom SQL

Instances

Function declarations

extend :: Assoc -> PrimQuery -> PrimQuerySource

Creates a projection of some attributes while keeping all other attributes in the relation visible too.

times :: PrimQuery -> PrimQuery -> PrimQuerySource

Takes the cartesian product of two queries.

attributes :: PrimQuery -> SchemeSource

Returns the schema (the attributes) of a query

attrInExpr :: PrimExpr -> SchemeSource

Returns all attributes in an expression.

attrInOrder :: [OrderExpr] -> SchemeSource

Returns all attributes in a list of ordering expressions.

substAttr :: Assoc -> PrimExpr -> PrimExprSource

Substitute attribute names in an expression.

isConstant :: PrimExpr -> BoolSource

Determines if a primitive expression represents a constant or is an expression only involving constants.

foldPrimQuery :: (t, TableName -> Scheme -> t, Assoc -> t -> t, PrimExpr -> t -> t, RelOp -> t -> t -> t, Assoc -> t -> t, SpecialOp -> t -> t) -> PrimQuery -> tSource

Fold on PrimQuery

foldPrimExpr :: (Attribute -> t, Literal -> t, BinOp -> t -> t -> t, UnOp -> t -> t, AggrOp -> t -> t, [(t, t)] -> t -> t, [t] -> t, Maybe Name -> t -> t, Name -> [t] -> t, Name -> t -> t) -> PrimExpr -> tSource

Fold on PrimExpr