|
Database.HaskellDB.PrimQuery | Portability | non portable | Stability | experimental | Maintainer | haskelldb-users@lists.sourceforge.net |
|
|
|
|
|
Description |
PrimQuery defines the datatype of relational expressions
(PrimQuery) and some useful functions on PrimQuery's
|
|
Synopsis |
|
type TableName = String | | type Attribute = String | | type Scheme = [Attribute] | | type Assoc = [(Attribute, PrimExpr)] | | | | | | | | | | data OrderExpr = OrderExpr OrderOp PrimExpr | | | | | | | | | | | | extend :: Assoc -> PrimQuery -> PrimQuery | | times :: PrimQuery -> PrimQuery -> PrimQuery | | attributes :: PrimQuery -> Scheme | | attrInExpr :: PrimExpr -> Scheme | | attrInOrder :: [OrderExpr] -> Scheme | | substAttr :: Assoc -> PrimExpr -> PrimExpr | | isAggregate :: PrimExpr -> Bool | | foldPrimQuery :: (t, TableName -> Scheme -> t, Assoc -> t -> t, PrimExpr -> t -> t, RelOp -> t -> t -> t, SpecialOp -> t -> t) -> PrimQuery -> t | | foldPrimExpr :: (Attribute -> t, Literal -> t, BinOp -> t -> t -> t, UnOp -> t -> t, AggrOp -> t -> t, [(t, t)] -> t -> t, [t] -> t) -> PrimExpr -> t |
|
|
|
Type Declarations
|
|
Types
|
|
type TableName = String |
|
type Attribute = String |
|
type Scheme = [Attribute] |
|
type Assoc = [(Attribute, PrimExpr)] |
|
Data types
|
|
data PrimQuery |
Constructors | | Instances | |
|
|
data RelOp |
Constructors | Times | | Union | | Intersect | | Divide | | Difference | |
| Instances | |
|
|
data SpecialOp |
Constructors | | Instances | |
|
|
data PrimExpr |
Constructors | | Instances | |
|
|
data OrderExpr |
Constructors | | Instances | |
|
|
data BinOp |
Constructors | OpEq | | OpLt | | OpLtEq | | OpGt | | OpGtEq | | OpNotEq | | OpAnd | | OpOr | | OpLike | | OpIn | | OpOther String | | OpCat | | OpPlus | | OpMinus | | OpMul | | OpDiv | | OpMod | | OpBitNot | | OpBitAnd | | OpBitOr | | OpBitXor | | OpAsg | |
| Instances | |
|
|
data UnOp |
Constructors | OpNot | | OpIsNull | | OpIsNotNull | | OpLength | | UnOpOther String | |
| Instances | |
|
|
data OrderOp |
Constructors | | Instances | |
|
|
data AggrOp |
Constructors | AggrCount | | AggrSum | | AggrAvg | | AggrMin | | AggrMax | | AggrStdDev | | AggrStdDevP | | AggrVar | | AggrVarP | | AggrOther String | |
| Instances | |
|
|
data Literal |
Constructors | | Instances | |
|
|
Function declarations
|
|
extend :: Assoc -> PrimQuery -> PrimQuery |
Creates a projection of some attributes while
keeping all other attributes in the relation visible too.
|
|
times :: PrimQuery -> PrimQuery -> PrimQuery |
Takes the cartesian product of two queries.
|
|
attributes :: PrimQuery -> Scheme |
Returns the schema (the attributes) of a query
|
|
attrInExpr :: PrimExpr -> Scheme |
Returns all attributes in an expression.
|
|
attrInOrder :: [OrderExpr] -> Scheme |
Returns all attributes in a list of ordering expressions.
|
|
substAttr :: Assoc -> PrimExpr -> PrimExpr |
Substitute attribute names in an expression.
|
|
isAggregate :: PrimExpr -> Bool |
|
foldPrimQuery :: (t, TableName -> Scheme -> t, Assoc -> t -> t, PrimExpr -> t -> t, RelOp -> t -> t -> t, SpecialOp -> t -> t) -> PrimQuery -> t |
Fold on PrimQuery
|
|
foldPrimExpr :: (Attribute -> t, Literal -> t, BinOp -> t -> t -> t, UnOp -> t -> t, AggrOp -> t -> t, [(t, t)] -> t -> t, [t] -> t) -> PrimExpr -> t |
Fold on PrimExpr
|
|
Produced by Haddock version 0.8 |