algebra-sql-0.1.0.1: Relational Algebra and SQL Code Generation

Safe HaskellNone
LanguageHaskell98

Database.Algebra.Table.Lang

Description

A representation of table algebra operators over multiset relations.

Synopsis

Documentation

data SortDir Source

Sorting rows in a direction

Constructors

Asc 
Desc 

Instances

Eq SortDir 
Ord SortDir 
Read SortDir 
Show SortDir

The show instance results in values that are accepted in the xml plan.

Generic SortDir 
ToJSON SortSpec 
ToJSON SortDir 
FromJSON SortSpec 
FromJSON SortDir 
type Rep SortDir 

data ATy where Source

table algebra types At this level we do not have any structural types anymore those are represented by columns.

Constructors

AInt :: ATy 
AStr :: ATy 
ABool :: ATy 
ADec :: ATy 
ADouble :: ATy 
ANat :: ATy 

Instances

Eq ATy 
Ord ATy 
Show ATy

Show the table algebra types in a way that is compatible with the xml plan.

Generic ATy 
ToJSON ATy 
FromJSON ATy 
type Rep ATy 

data AVal where Source

Wrapper around values that can occur in an table algebra plan

Constructors

VInt :: Integer -> AVal 
VStr :: String -> AVal 
VBool :: Bool -> AVal 
VDouble :: Double -> AVal 
VDec :: Float -> AVal 
VNat :: Integer -> AVal 

Instances

Eq AVal 
Ord AVal 
Show AVal

Show the values in the way compatible with the xml plan.

Generic AVal 
ToJSON AVal 
FromJSON AVal 
type Rep AVal 

type Attr = String Source

Attribute name or column name

type ResAttr = Attr Source

Name of an attribute in which the result of an expression, aggregate or window function is stored.

type PartAttr = Attr Source

Names of partition attributes used in window specifications

type LeftAttr = Attr Source

Left attribute name, used to represent the left argument when applying binary operators

type RightAttr = Attr Source

Right attribute name, used to represent the right argument when applying binary operators

type TableName = String Source

Name of a database table

type TypedAttr = (Attr, ATy) Source

Typed columns

newtype Key Source

Key of a database table, a key consists of multiple column names

Constructors

Key [Attr] 

type SortSpec = (Expr, SortDir) Source

Sorting information

data BinFun Source

Binary functions and operators in expressions

data UnFun Source

Unary functions/operators in expressions

type PartExpr = Expr Source

Expressions which are used to specify partitioning in window functions.

type Proj = (ResAttr, Expr) Source

New column name and the expression that generates the new column

type Tuple = [AVal] Source

A tuple is a list of values

type SchemaInfos = [(Attr, ATy)] Source

Schema information, represents a table structure, the first element of the tuple is the column name the second its type.

data JoinRel Source

Comparison operators which can be used for ThetaJoins.

Constructors

EqJ 
GtJ 
GeJ 
LtJ 
LeJ 
NeJ 

data FrameStart Source

Window frame start specification

Constructors

FSUnboundPrec

UNBOUNDED PRECEDING

FSValPrec Int

value PRECEDING

FSCurrRow

CURRENT ROW

data FrameEnd Source

Window frame end specification

Constructors

FECurrRow

CURRENT ROW

FEValFol Int

value FOLLOWING

FEUnboundFol

UNBOUNDED FOLLOWING

data SerializeOrder Source

Declare need for position columns in the query result. The distinction between AbsPos and RelPos is only relevant for the optimizer: AbsPos signals that the actual pos values are required. RelPos signals that only the order induced by the pos column is relevant.

Constructors

AbsPos Attr 
RelPos [Attr] 
NoPos 

replace :: Eq a => a -> a -> a -> a Source

replaceChild :: forall t b u n c. Eq c => c -> c -> Algebra t b u n c -> Algebra t b u n c Source