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

CopyrightDaan Leijen (c) 1999, daan@cs.uu.nl HWT Group (c) 2003, haskelldb-users@lists.sourceforge.net
LicenseBSD-style
Maintainerhaskelldb-users@lists.sourceforge.net
Stabilityexperimental
Portabilitynon portable
Safe HaskellNone
LanguageHaskell98

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 
Offset 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 -> PrimQuery Source

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

times :: PrimQuery -> PrimQuery -> PrimQuery Source

Takes the cartesian product of two queries.

attributes :: PrimQuery -> Scheme Source

Returns the schema (the attributes) of a query

attrInExpr :: PrimExpr -> Scheme Source

Returns all attributes in an expression.

attrInOrder :: [OrderExpr] -> Scheme Source

Returns all attributes in a list of ordering expressions.

substAttr :: Assoc -> PrimExpr -> PrimExpr Source

Substitute attribute names in an expression.

isConstant :: PrimExpr -> Bool Source

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 -> t Source

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 -> t Source

Fold on PrimExpr