beam-core-0.10.0.0: Type-safe, feature-complete SQL query and manipulation interface for Haskell
Safe HaskellSafe-Inferred
LanguageHaskell2010

Database.Beam.Backend.SQL.SQL92

Description

Finally tagless encoding of SQL92 syntax

Synopsis

Finally tagless style

class HasSqlValueSyntax expr ty where Source #

Methods

sqlValueSyntax :: ty -> expr Source #

Instances

Instances details
HasSqlValueSyntax Value Int16 Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value Int32 Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value Int64 Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value Word16 Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value Word32 Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value Word64 Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value SqlNull Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value ByteString Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value Text Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value Day Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value UTCTime Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value LocalTime Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value TimeOfDay Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value String Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value Integer Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value Bool Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax Value Double Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

(TypeError (PreferExplicitSize Int Int32) :: Constraint) => HasSqlValueSyntax Value Int Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

(TypeError (PreferExplicitSize Word Word32) :: Constraint) => HasSqlValueSyntax Value Word Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax SqlSyntaxBuilder Int32 Source # 
Instance details

Defined in Database.Beam.Backend.SQL.Builder

HasSqlValueSyntax SqlSyntaxBuilder SqlNull Source # 
Instance details

Defined in Database.Beam.Backend.SQL.Builder

HasSqlValueSyntax SqlSyntaxBuilder Text Source # 
Instance details

Defined in Database.Beam.Backend.SQL.Builder

HasSqlValueSyntax SqlSyntaxBuilder Bool Source # 
Instance details

Defined in Database.Beam.Backend.SQL.Builder

(TypeError (PreferExplicitSize Int Int32) :: Constraint) => HasSqlValueSyntax SqlSyntaxBuilder Int Source # 
Instance details

Defined in Database.Beam.Backend.SQL.Builder

HasSqlValueSyntax Value x => HasSqlValueSyntax Value (Maybe x) Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

HasSqlValueSyntax syntax x => HasSqlValueSyntax syntax (SqlSerial x) Source # 
Instance details

Defined in Database.Beam.Backend.SQL.SQL92

Methods

sqlValueSyntax :: SqlSerial x -> syntax Source #

HasSqlValueSyntax vs t => HasSqlValueSyntax vs (Tagged tag t) Source # 
Instance details

Defined in Database.Beam.Backend.SQL.SQL92

Methods

sqlValueSyntax :: Tagged tag t -> vs Source #

class Sql92DisplaySyntax syntax where Source #

Type classes for syntaxes which can be displayed

Methods

displaySyntax :: syntax -> String Source #

Render the syntax as a String, representing the SQL expression it stands for

class (IsSql92SelectSyntax (Sql92SelectSyntax cmd), IsSql92InsertSyntax (Sql92InsertSyntax cmd), IsSql92UpdateSyntax (Sql92UpdateSyntax cmd), IsSql92DeleteSyntax (Sql92DeleteSyntax cmd)) => IsSql92Syntax cmd where Source #

Associated Types

type Sql92SelectSyntax cmd :: Type Source #

type Sql92InsertSyntax cmd :: Type Source #

type Sql92UpdateSyntax cmd :: Type Source #

type Sql92DeleteSyntax cmd :: Type Source #

class (IsSql92ExpressionSyntax (Sql92SelectTableExpressionSyntax select), IsSql92AggregationExpressionSyntax (Sql92SelectTableExpressionSyntax select), IsSql92ProjectionSyntax (Sql92SelectTableProjectionSyntax select), IsSql92FromSyntax (Sql92SelectTableFromSyntax select), IsSql92GroupingSyntax (Sql92SelectTableGroupingSyntax select), IsSql92AggregationSetQuantifierSyntax (Sql92SelectTableSetQuantifierSyntax select), Sql92GroupingExpressionSyntax (Sql92SelectTableGroupingSyntax select) ~ Sql92SelectTableExpressionSyntax select, Sql92FromExpressionSyntax (Sql92SelectTableFromSyntax select) ~ Sql92SelectTableExpressionSyntax select, Sql92SelectSelectTableSyntax (Sql92SelectTableSelectSyntax select) ~ select, Eq (Sql92SelectTableExpressionSyntax select)) => IsSql92SelectTableSyntax select where Source #

Methods

selectTableStmt Source #

unionTables :: Bool -> select -> select -> select Source #

intersectTables :: Bool -> select -> select -> select Source #

exceptTable :: Bool -> select -> select -> select Source #

Instances

Instances details
IsSql92SelectTableSyntax SelectTable Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

IsSql92SelectTableSyntax SqlSyntaxBuilder Source # 
Instance details

Defined in Database.Beam.Backend.SQL.Builder

class (IsSql92ExpressionSyntax (Sql92UpdateExpressionSyntax update), IsSql92FieldNameSyntax (Sql92UpdateFieldNameSyntax update), IsSql92TableNameSyntax (Sql92UpdateTableNameSyntax update)) => IsSql92UpdateSyntax update where Source #

class IsSql92DataTypeSyntax dataType where Source #

Methods

domainType :: Text -> dataType Source #

charType :: Maybe Word -> Maybe Text -> dataType Source #

varCharType :: Maybe Word -> Maybe Text -> dataType Source #

nationalCharType :: Maybe Word -> dataType Source #

nationalVarCharType :: Maybe Word -> dataType Source #

bitType :: Maybe Word -> dataType Source #

varBitType :: Maybe Word -> dataType Source #

numericType :: Maybe (Word, Maybe Word) -> dataType Source #

decimalType :: Maybe (Word, Maybe Word) -> dataType Source #

intType :: dataType Source #

smallIntType :: dataType Source #

floatType :: Maybe Word -> dataType Source #

doubleType :: dataType Source #

realType :: dataType Source #

dateType :: dataType Source #

timeType Source #

Arguments

:: Maybe Word 
-> Bool

With time zone

-> dataType 

timestampType Source #

Arguments

:: Maybe Word 
-> Bool

With time zone

-> dataType 

Instances

Instances details
IsSql92DataTypeSyntax DataType Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

IsSql92DataTypeSyntax SqlSyntaxBuilder Source # 
Instance details

Defined in Database.Beam.Backend.SQL.Builder

class (HasSqlValueSyntax (Sql92ExpressionValueSyntax expr) Int32, HasSqlValueSyntax (Sql92ExpressionValueSyntax expr) Bool, IsSql92FieldNameSyntax (Sql92ExpressionFieldNameSyntax expr), IsSql92QuantifierSyntax (Sql92ExpressionQuantifierSyntax expr), IsSql92DataTypeSyntax (Sql92ExpressionCastTargetSyntax expr), IsSql92ExtractFieldSyntax (Sql92ExpressionExtractFieldSyntax expr), Typeable expr) => IsSql92ExpressionSyntax expr where Source #

Methods

valueE :: Sql92ExpressionValueSyntax expr -> expr Source #

rowE :: [expr] -> expr Source #

quantifierListE :: [expr] -> expr Source #

coalesceE :: [expr] -> expr Source #

caseE :: [(expr, expr)] -> expr -> expr Source #

fieldE :: Sql92ExpressionFieldNameSyntax expr -> expr Source #

betweenE :: expr -> expr -> expr -> expr Source #

andE :: expr -> expr -> expr Source #

orE :: expr -> expr -> expr Source #

addE :: expr -> expr -> expr Source #

subE :: expr -> expr -> expr Source #

mulE :: expr -> expr -> expr Source #

divE :: expr -> expr -> expr Source #

likeE :: expr -> expr -> expr Source #

modE :: expr -> expr -> expr Source #

overlapsE :: expr -> expr -> expr Source #

nullIfE :: expr -> expr -> expr Source #

positionE :: expr -> expr -> expr Source #

eqE :: Maybe (Sql92ExpressionQuantifierSyntax expr) -> expr -> expr -> expr Source #

neqE :: Maybe (Sql92ExpressionQuantifierSyntax expr) -> expr -> expr -> expr Source #

ltE :: Maybe (Sql92ExpressionQuantifierSyntax expr) -> expr -> expr -> expr Source #

gtE :: Maybe (Sql92ExpressionQuantifierSyntax expr) -> expr -> expr -> expr Source #

leE :: Maybe (Sql92ExpressionQuantifierSyntax expr) -> expr -> expr -> expr Source #

geE :: Maybe (Sql92ExpressionQuantifierSyntax expr) -> expr -> expr -> expr Source #

eqMaybeE :: expr -> expr -> expr -> expr Source #

Compare the first and second argument for nullable equality, if they are both not null, return the result of the third expression

Some backends, like beam-postgres totally ignore the third result, because all equality there is sensible.

neqMaybeE :: expr -> expr -> expr -> expr Source #

Compare the first and second argument for nullable equality, if they are both not null, return the result of the third expression

Some backends, like beam-postgres totally ignore the third result, because all equality there is sensible.

castE :: expr -> Sql92ExpressionCastTargetSyntax expr -> expr Source #

notE :: expr -> expr Source #

negateE :: expr -> expr Source #

isNullE :: expr -> expr Source #

isNotNullE :: expr -> expr Source #

isTrueE :: expr -> expr Source #

isNotTrueE :: expr -> expr Source #

isFalseE :: expr -> expr Source #

isNotFalseE :: expr -> expr Source #

isUnknownE :: expr -> expr Source #

isNotUnknownE :: expr -> expr Source #

charLengthE :: expr -> expr Source #

octetLengthE :: expr -> expr Source #

bitLengthE :: expr -> expr Source #

lowerE :: expr -> expr Source #

upperE :: expr -> expr Source #

trimE :: expr -> expr Source #

absE :: expr -> expr Source #

Included so that we can easily write a Num instance, but not defined in SQL92. Implementations that do not support this, should use CASE .. WHEN ..

extractE :: Sql92ExpressionExtractFieldSyntax expr -> expr -> expr Source #

existsE :: Sql92ExpressionSelectSyntax expr -> expr Source #

uniqueE :: Sql92ExpressionSelectSyntax expr -> expr Source #

subqueryE :: Sql92ExpressionSelectSyntax expr -> expr Source #

currentTimestampE :: expr Source #

defaultE :: expr Source #

inE :: expr -> [expr] -> expr Source #

inSelectE :: expr -> Sql92ExpressionSelectSyntax expr -> expr Source #

Instances

Instances details
IsSql92ExpressionSyntax Expression Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

Methods

valueE :: Sql92ExpressionValueSyntax Expression -> Expression Source #

rowE :: [Expression] -> Expression Source #

quantifierListE :: [Expression] -> Expression Source #

coalesceE :: [Expression] -> Expression Source #

caseE :: [(Expression, Expression)] -> Expression -> Expression Source #

fieldE :: Sql92ExpressionFieldNameSyntax Expression -> Expression Source #

betweenE :: Expression -> Expression -> Expression -> Expression Source #

andE :: Expression -> Expression -> Expression Source #

orE :: Expression -> Expression -> Expression Source #

addE :: Expression -> Expression -> Expression Source #

subE :: Expression -> Expression -> Expression Source #

mulE :: Expression -> Expression -> Expression Source #

divE :: Expression -> Expression -> Expression Source #

likeE :: Expression -> Expression -> Expression Source #

modE :: Expression -> Expression -> Expression Source #

overlapsE :: Expression -> Expression -> Expression Source #

nullIfE :: Expression -> Expression -> Expression Source #

positionE :: Expression -> Expression -> Expression Source #

eqE :: Maybe (Sql92ExpressionQuantifierSyntax Expression) -> Expression -> Expression -> Expression Source #

neqE :: Maybe (Sql92ExpressionQuantifierSyntax Expression) -> Expression -> Expression -> Expression Source #

ltE :: Maybe (Sql92ExpressionQuantifierSyntax Expression) -> Expression -> Expression -> Expression Source #

gtE :: Maybe (Sql92ExpressionQuantifierSyntax Expression) -> Expression -> Expression -> Expression Source #

leE :: Maybe (Sql92ExpressionQuantifierSyntax Expression) -> Expression -> Expression -> Expression Source #

geE :: Maybe (Sql92ExpressionQuantifierSyntax Expression) -> Expression -> Expression -> Expression Source #

eqMaybeE :: Expression -> Expression -> Expression -> Expression Source #

neqMaybeE :: Expression -> Expression -> Expression -> Expression Source #

castE :: Expression -> Sql92ExpressionCastTargetSyntax Expression -> Expression Source #

notE :: Expression -> Expression Source #

negateE :: Expression -> Expression Source #

isNullE :: Expression -> Expression Source #

isNotNullE :: Expression -> Expression Source #

isTrueE :: Expression -> Expression Source #

isNotTrueE :: Expression -> Expression Source #

isFalseE :: Expression -> Expression Source #

isNotFalseE :: Expression -> Expression Source #

isUnknownE :: Expression -> Expression Source #

isNotUnknownE :: Expression -> Expression Source #

charLengthE :: Expression -> Expression Source #

octetLengthE :: Expression -> Expression Source #

bitLengthE :: Expression -> Expression Source #

lowerE :: Expression -> Expression Source #

upperE :: Expression -> Expression Source #

trimE :: Expression -> Expression Source #

absE :: Expression -> Expression Source #

extractE :: Sql92ExpressionExtractFieldSyntax Expression -> Expression -> Expression Source #

existsE :: Sql92ExpressionSelectSyntax Expression -> Expression Source #

uniqueE :: Sql92ExpressionSelectSyntax Expression -> Expression Source #

subqueryE :: Sql92ExpressionSelectSyntax Expression -> Expression Source #

currentTimestampE :: Expression Source #

defaultE :: Expression Source #

inE :: Expression -> [Expression] -> Expression Source #

inSelectE :: Expression -> Sql92ExpressionSelectSyntax Expression -> Expression Source #

IsSql92ExpressionSyntax SqlSyntaxBuilder Source # 
Instance details

Defined in Database.Beam.Backend.SQL.Builder

Methods

valueE :: Sql92ExpressionValueSyntax SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

rowE :: [SqlSyntaxBuilder] -> SqlSyntaxBuilder Source #

quantifierListE :: [SqlSyntaxBuilder] -> SqlSyntaxBuilder Source #

coalesceE :: [SqlSyntaxBuilder] -> SqlSyntaxBuilder Source #

caseE :: [(SqlSyntaxBuilder, SqlSyntaxBuilder)] -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

fieldE :: Sql92ExpressionFieldNameSyntax SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

betweenE :: SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

andE :: SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

orE :: SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

addE :: SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

subE :: SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

mulE :: SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

divE :: SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

likeE :: SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

modE :: SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

overlapsE :: SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

nullIfE :: SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

positionE :: SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

eqE :: Maybe (Sql92ExpressionQuantifierSyntax SqlSyntaxBuilder) -> SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

neqE :: Maybe (Sql92ExpressionQuantifierSyntax SqlSyntaxBuilder) -> SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

ltE :: Maybe (Sql92ExpressionQuantifierSyntax SqlSyntaxBuilder) -> SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

gtE :: Maybe (Sql92ExpressionQuantifierSyntax SqlSyntaxBuilder) -> SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

leE :: Maybe (Sql92ExpressionQuantifierSyntax SqlSyntaxBuilder) -> SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

geE :: Maybe (Sql92ExpressionQuantifierSyntax SqlSyntaxBuilder) -> SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

eqMaybeE :: SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

neqMaybeE :: SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

castE :: SqlSyntaxBuilder -> Sql92ExpressionCastTargetSyntax SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

notE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

negateE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

isNullE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

isNotNullE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

isTrueE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

isNotTrueE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

isFalseE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

isNotFalseE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

isUnknownE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

isNotUnknownE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

charLengthE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

octetLengthE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

bitLengthE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

lowerE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

upperE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

trimE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

absE :: SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

extractE :: Sql92ExpressionExtractFieldSyntax SqlSyntaxBuilder -> SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

existsE :: Sql92ExpressionSelectSyntax SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

uniqueE :: Sql92ExpressionSelectSyntax SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

subqueryE :: Sql92ExpressionSelectSyntax SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

currentTimestampE :: SqlSyntaxBuilder Source #

defaultE :: SqlSyntaxBuilder Source #

inE :: SqlSyntaxBuilder -> [SqlSyntaxBuilder] -> SqlSyntaxBuilder Source #

inSelectE :: SqlSyntaxBuilder -> Sql92ExpressionSelectSyntax SqlSyntaxBuilder -> SqlSyntaxBuilder Source #

class IsSql92AggregationSetQuantifierSyntax (Sql92AggregationSetQuantifierSyntax expr) => IsSql92AggregationExpressionSyntax expr where Source #

Associated Types

type Sql92AggregationSetQuantifierSyntax expr :: Type Source #

Instances

Instances details
IsSql92AggregationExpressionSyntax Expression Source # 
Instance details

Defined in Database.Beam.Backend.SQL.AST

IsSql92AggregationExpressionSyntax SqlSyntaxBuilder Source # 
Instance details

Defined in Database.Beam.Backend.SQL.Builder

class IsSql92TableNameSyntax tblName where Source #

Methods

tableName Source #

Arguments

:: Maybe Text

Schema

-> Text

Table name

-> tblName 

class IsSql92TableNameSyntax (Sql92TableSourceTableNameSyntax tblSource) => IsSql92TableSourceSyntax tblSource where Source #

class (IsSql92TableSourceSyntax (Sql92FromTableSourceSyntax from), IsSql92ExpressionSyntax (Sql92FromExpressionSyntax from)) => IsSql92FromSyntax from where Source #

Methods

fromTable :: Sql92FromTableSourceSyntax from -> Maybe (Text, Maybe [Text]) -> from Source #

innerJoin :: from -> from -> Maybe (Sql92FromExpressionSyntax from) -> from Source #

leftJoin :: from -> from -> Maybe (Sql92FromExpressionSyntax from) -> from Source #

rightJoin :: from -> from -> Maybe (Sql92FromExpressionSyntax from) -> from Source #

class IsSql92FromSyntax from => IsSql92FromOuterJoinSyntax from where Source #

Methods

outerJoin :: from -> from -> Maybe (Sql92FromExpressionSyntax from) -> from Source #