Safe Haskell | None |
---|---|
Language | Haskell2010 |
Finally tagless encoding of SQL92 syntax
Synopsis
-
class
HasSqlValueSyntax
expr ty
where
- sqlValueSyntax :: ty -> expr
- autoSqlValueSyntax :: ( HasSqlValueSyntax expr String , Show a) => a -> expr
- type Sql92SelectExpressionSyntax select = Sql92SelectTableExpressionSyntax ( Sql92SelectSelectTableSyntax select)
- type Sql92SelectProjectionSyntax select = Sql92SelectTableProjectionSyntax ( Sql92SelectSelectTableSyntax select)
- type Sql92SelectGroupingSyntax select = Sql92SelectTableGroupingSyntax ( Sql92SelectSelectTableSyntax select)
- type Sql92SelectFromSyntax select = Sql92SelectTableFromSyntax ( Sql92SelectSelectTableSyntax select)
- type Sql92InsertExpressionSyntax select = Sql92InsertValuesExpressionSyntax ( Sql92InsertValuesSyntax select)
- type Sql92TableNameSyntax select = Sql92TableSourceTableNameSyntax ( Sql92FromTableSourceSyntax ( Sql92SelectFromSyntax select))
- type Sql92ValueSyntax cmdSyntax = Sql92ExpressionValueSyntax ( Sql92ExpressionSyntax cmdSyntax)
- type Sql92ExpressionSyntax cmdSyntax = Sql92SelectExpressionSyntax ( Sql92SelectSyntax cmdSyntax)
- type Sql92ExtractFieldSyntax cmdSyntax = Sql92ExpressionExtractFieldSyntax ( Sql92ExpressionSyntax cmdSyntax)
- type Sql92HasValueSyntax cmdSyntax = HasSqlValueSyntax ( Sql92ValueSyntax cmdSyntax)
- type Sql92SelectSanityCheck select = ( Sql92FromExpressionSyntax ( Sql92SelectTableFromSyntax ( Sql92SelectSelectTableSyntax select)) ~ Sql92SelectTableExpressionSyntax ( Sql92SelectSelectTableSyntax select), Sql92TableSourceSelectSyntax ( Sql92FromTableSourceSyntax ( Sql92SelectTableFromSyntax ( Sql92SelectSelectTableSyntax select))) ~ select, Sql92ProjectionExpressionSyntax ( Sql92SelectTableProjectionSyntax ( Sql92SelectSelectTableSyntax select)) ~ Sql92SelectTableExpressionSyntax ( Sql92SelectSelectTableSyntax select), Sql92OrderingExpressionSyntax ( Sql92SelectOrderingSyntax select) ~ Sql92SelectTableExpressionSyntax ( Sql92SelectSelectTableSyntax select), Sql92TableSourceExpressionSyntax ( Sql92FromTableSourceSyntax ( Sql92SelectTableFromSyntax ( Sql92SelectSelectTableSyntax select))) ~ Sql92SelectTableExpressionSyntax ( Sql92SelectSelectTableSyntax select))
- type Sql92SanityCheck cmd = ( Sql92SelectSanityCheck ( Sql92SelectSyntax cmd), Sql92ExpressionValueSyntax ( Sql92InsertValuesExpressionSyntax ( Sql92InsertValuesSyntax ( Sql92InsertSyntax cmd))) ~ Sql92ValueSyntax cmd, Sql92ExpressionValueSyntax ( Sql92UpdateExpressionSyntax ( Sql92UpdateSyntax cmd)) ~ Sql92ValueSyntax cmd, Sql92ExpressionValueSyntax ( Sql92DeleteExpressionSyntax ( Sql92DeleteSyntax cmd)) ~ Sql92ValueSyntax cmd, Sql92SelectTableExpressionSyntax ( Sql92SelectSelectTableSyntax ( Sql92SelectSyntax cmd)) ~ Sql92InsertValuesExpressionSyntax ( Sql92InsertValuesSyntax ( Sql92InsertSyntax cmd)), Sql92SelectTableExpressionSyntax ( Sql92SelectSelectTableSyntax ( Sql92SelectSyntax cmd)) ~ Sql92UpdateExpressionSyntax ( Sql92UpdateSyntax cmd), Sql92DeleteExpressionSyntax ( Sql92DeleteSyntax cmd) ~ Sql92UpdateExpressionSyntax ( Sql92UpdateSyntax cmd), Sql92ExpressionSelectSyntax ( Sql92InsertExpressionSyntax ( Sql92InsertSyntax cmd)) ~ Sql92SelectSyntax cmd, Sql92InsertValuesSelectSyntax ( Sql92InsertValuesSyntax ( Sql92InsertSyntax cmd)) ~ Sql92SelectSyntax cmd, Sql92UpdateFieldNameSyntax ( Sql92UpdateSyntax cmd) ~ Sql92ExpressionFieldNameSyntax ( Sql92InsertValuesExpressionSyntax ( Sql92InsertValuesSyntax ( Sql92InsertSyntax cmd))))
- type Sql92ReasonableMarshaller be = ( FromBackendRow be SqlNull , FromBackendRow be Text , FromBackendRow be Bool , FromBackendRow be Char , FromBackendRow be Int16 , FromBackendRow be Int32 , FromBackendRow be Int64 , FromBackendRow be LocalTime )
-
class
Sql92DisplaySyntax
syntax
where
- displaySyntax :: syntax -> String
-
class
(
IsSql92SelectSyntax
(
Sql92SelectSyntax
cmd),
IsSql92InsertSyntax
(
Sql92InsertSyntax
cmd),
IsSql92UpdateSyntax
(
Sql92UpdateSyntax
cmd),
IsSql92DeleteSyntax
(
Sql92DeleteSyntax
cmd)) =>
IsSql92Syntax
cmd
where
- type Sql92SelectSyntax cmd :: Type
- type Sql92InsertSyntax cmd :: Type
- type Sql92UpdateSyntax cmd :: Type
- type Sql92DeleteSyntax cmd :: Type
- selectCmd :: Sql92SelectSyntax cmd -> cmd
- insertCmd :: Sql92InsertSyntax cmd -> cmd
- updateCmd :: Sql92UpdateSyntax cmd -> cmd
- deleteCmd :: Sql92DeleteSyntax cmd -> cmd
-
class
(
IsSql92SelectTableSyntax
(
Sql92SelectSelectTableSyntax
select),
IsSql92OrderingSyntax
(
Sql92SelectOrderingSyntax
select)) =>
IsSql92SelectSyntax
select
where
- type Sql92SelectSelectTableSyntax select :: Type
- type Sql92SelectOrderingSyntax select :: Type
- selectStmt :: Sql92SelectSelectTableSyntax select -> [ Sql92SelectOrderingSyntax select] -> Maybe Integer -> Maybe Integer -> select
-
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
- type Sql92SelectTableSelectSyntax select :: Type
- type Sql92SelectTableExpressionSyntax select :: Type
- type Sql92SelectTableProjectionSyntax select :: Type
- type Sql92SelectTableFromSyntax select :: Type
- type Sql92SelectTableGroupingSyntax select :: Type
- type Sql92SelectTableSetQuantifierSyntax select :: Type
- selectTableStmt :: Maybe ( Sql92SelectTableSetQuantifierSyntax select) -> Sql92SelectTableProjectionSyntax select -> Maybe ( Sql92SelectTableFromSyntax select) -> Maybe ( Sql92SelectTableExpressionSyntax select) -> Maybe ( Sql92SelectTableGroupingSyntax select) -> Maybe ( Sql92SelectTableExpressionSyntax select) -> select
- unionTables , intersectTables , exceptTable :: Bool -> select -> select -> select
-
class
(
IsSql92InsertValuesSyntax
(
Sql92InsertValuesSyntax
insert),
IsSql92TableNameSyntax
(
Sql92InsertTableNameSyntax
insert)) =>
IsSql92InsertSyntax
insert
where
- type Sql92InsertValuesSyntax insert :: Type
- type Sql92InsertTableNameSyntax insert :: Type
- insertStmt :: Sql92InsertTableNameSyntax insert -> [ Text ] -> Sql92InsertValuesSyntax insert -> insert
-
class
IsSql92ExpressionSyntax
(
Sql92InsertValuesExpressionSyntax
insertValues) =>
IsSql92InsertValuesSyntax
insertValues
where
- type Sql92InsertValuesExpressionSyntax insertValues :: Type
- type Sql92InsertValuesSelectSyntax insertValues :: Type
- insertSqlExpressions :: [[ Sql92InsertValuesExpressionSyntax insertValues]] -> insertValues
- insertFromSql :: Sql92InsertValuesSelectSyntax insertValues -> insertValues
-
class
(
IsSql92ExpressionSyntax
(
Sql92UpdateExpressionSyntax
update),
IsSql92FieldNameSyntax
(
Sql92UpdateFieldNameSyntax
update),
IsSql92TableNameSyntax
(
Sql92UpdateTableNameSyntax
update)) =>
IsSql92UpdateSyntax
update
where
- type Sql92UpdateTableNameSyntax update :: Type
- type Sql92UpdateFieldNameSyntax update :: Type
- type Sql92UpdateExpressionSyntax update :: Type
- updateStmt :: Sql92UpdateTableNameSyntax update -> [( Sql92UpdateFieldNameSyntax update, Sql92UpdateExpressionSyntax update)] -> Maybe ( Sql92UpdateExpressionSyntax update) -> update
-
class
(
IsSql92TableNameSyntax
(
Sql92DeleteTableNameSyntax
delete),
IsSql92ExpressionSyntax
(
Sql92DeleteExpressionSyntax
delete)) =>
IsSql92DeleteSyntax
delete
where
- type Sql92DeleteTableNameSyntax delete :: Type
- type Sql92DeleteExpressionSyntax delete :: Type
- deleteStmt :: Sql92DeleteTableNameSyntax delete -> Maybe Text -> Maybe ( Sql92DeleteExpressionSyntax delete) -> delete
- deleteSupportsAlias :: Proxy delete -> Bool
-
class
IsSql92FieldNameSyntax
fn
where
- qualifiedField :: Text -> Text -> fn
- unqualifiedField :: Text -> fn
-
class
IsSql92QuantifierSyntax
quantifier
where
- quantifyOverAll , quantifyOverAny :: quantifier
-
class
IsSql92ExtractFieldSyntax
extractField
where
- secondsField :: extractField
- minutesField :: extractField
- hourField :: extractField
- dayField :: extractField
- monthField :: extractField
- yearField :: extractField
-
class
IsSql92DataTypeSyntax
dataType
where
- domainType :: Text -> dataType
- charType :: Maybe Word -> Maybe Text -> dataType
- varCharType :: Maybe Word -> Maybe Text -> dataType
- nationalCharType :: Maybe Word -> dataType
- nationalVarCharType :: Maybe Word -> dataType
- bitType :: Maybe Word -> dataType
- varBitType :: Maybe Word -> dataType
- numericType :: Maybe ( Word , Maybe Word ) -> dataType
- decimalType :: Maybe ( Word , Maybe Word ) -> dataType
- intType :: dataType
- smallIntType :: dataType
- floatType :: Maybe Word -> dataType
- doubleType :: dataType
- realType :: dataType
- dateType :: dataType
- timeType :: Maybe Word -> Bool -> dataType
- timestampType :: Maybe Word -> Bool -> dataType
-
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
- type Sql92ExpressionQuantifierSyntax expr :: Type
- type Sql92ExpressionValueSyntax expr :: Type
- type Sql92ExpressionSelectSyntax expr :: Type
- type Sql92ExpressionFieldNameSyntax expr :: Type
- type Sql92ExpressionCastTargetSyntax expr :: Type
- type Sql92ExpressionExtractFieldSyntax expr :: Type
- valueE :: Sql92ExpressionValueSyntax expr -> expr
- rowE , quantifierListE , coalesceE :: [expr] -> expr
- caseE :: [(expr, expr)] -> expr -> expr
- fieldE :: Sql92ExpressionFieldNameSyntax expr -> expr
- betweenE :: expr -> expr -> expr -> expr
- andE , orE , addE , subE , mulE , divE , likeE , modE , overlapsE , nullIfE , positionE :: expr -> expr -> expr
- eqE , neqE , ltE , gtE , leE , geE :: Maybe ( Sql92ExpressionQuantifierSyntax expr) -> expr -> expr -> expr
- eqMaybeE , neqMaybeE :: expr -> expr -> expr -> expr
- castE :: expr -> Sql92ExpressionCastTargetSyntax expr -> expr
- notE , negateE , isNullE , isNotNullE , isTrueE , isNotTrueE , isFalseE , isNotFalseE , isUnknownE , isNotUnknownE , charLengthE , octetLengthE , bitLengthE , lowerE , upperE , trimE :: expr -> expr
- absE :: expr -> expr
- extractE :: Sql92ExpressionExtractFieldSyntax expr -> expr -> expr
- existsE , uniqueE , subqueryE :: Sql92ExpressionSelectSyntax expr -> expr
- currentTimestampE :: expr
- defaultE :: expr
- inE :: expr -> [expr] -> expr
-
class
IsSql92AggregationSetQuantifierSyntax
(
Sql92AggregationSetQuantifierSyntax
expr) =>
IsSql92AggregationExpressionSyntax
expr
where
- type Sql92AggregationSetQuantifierSyntax expr :: Type
- countAllE :: expr
- countE , avgE , maxE , minE , sumE :: Maybe ( Sql92AggregationSetQuantifierSyntax expr) -> expr -> expr
- class IsSql92AggregationSetQuantifierSyntax q where
-
class
IsSql92ExpressionSyntax
(
Sql92ProjectionExpressionSyntax
proj) =>
IsSql92ProjectionSyntax
proj
where
- type Sql92ProjectionExpressionSyntax proj :: Type
- projExprs :: [( Sql92ProjectionExpressionSyntax proj, Maybe Text )] -> proj
-
class
IsSql92OrderingSyntax
ord
where
- type Sql92OrderingExpressionSyntax ord :: Type
- ascOrdering , descOrdering :: Sql92OrderingExpressionSyntax ord -> ord
- class IsSql92TableNameSyntax tblName where
-
class
IsSql92TableNameSyntax
(
Sql92TableSourceTableNameSyntax
tblSource) =>
IsSql92TableSourceSyntax
tblSource
where
- type Sql92TableSourceSelectSyntax tblSource :: Type
- type Sql92TableSourceExpressionSyntax tblSource :: Type
- type Sql92TableSourceTableNameSyntax tblSource :: Type
- tableNamed :: Sql92TableSourceTableNameSyntax tblSource -> tblSource
- tableFromSubSelect :: Sql92TableSourceSelectSyntax tblSource -> tblSource
- tableFromValues :: [[ Sql92TableSourceExpressionSyntax tblSource]] -> tblSource
-
class
IsSql92GroupingSyntax
grouping
where
- type Sql92GroupingExpressionSyntax grouping :: Type
- groupByExpressions :: [ Sql92GroupingExpressionSyntax grouping] -> grouping
-
class
(
IsSql92TableSourceSyntax
(
Sql92FromTableSourceSyntax
from),
IsSql92ExpressionSyntax
(
Sql92FromExpressionSyntax
from)) =>
IsSql92FromSyntax
from
where
- type Sql92FromTableSourceSyntax from :: Type
- type Sql92FromExpressionSyntax from :: Type
- fromTable :: Sql92FromTableSourceSyntax from -> Maybe ( Text , Maybe [ Text ]) -> from
- innerJoin , leftJoin , rightJoin :: from -> from -> Maybe ( Sql92FromExpressionSyntax from) -> from
-
class
IsSql92FromSyntax
from =>
IsSql92FromOuterJoinSyntax
from
where
- outerJoin :: from -> from -> Maybe ( Sql92FromExpressionSyntax from) -> from
Finally tagless style
class HasSqlValueSyntax expr ty where Source #
sqlValueSyntax :: ty -> expr Source #
Instances
autoSqlValueSyntax :: ( HasSqlValueSyntax expr String , Show a) => a -> expr Source #
type Sql92SelectExpressionSyntax select = Sql92SelectTableExpressionSyntax ( Sql92SelectSelectTableSyntax select) Source #
type Sql92SelectProjectionSyntax select = Sql92SelectTableProjectionSyntax ( Sql92SelectSelectTableSyntax select) Source #
type Sql92SelectGroupingSyntax select = Sql92SelectTableGroupingSyntax ( Sql92SelectSelectTableSyntax select) Source #
type Sql92SelectFromSyntax select = Sql92SelectTableFromSyntax ( Sql92SelectSelectTableSyntax select) Source #
type Sql92InsertExpressionSyntax select = Sql92InsertValuesExpressionSyntax ( Sql92InsertValuesSyntax select) Source #
type Sql92TableNameSyntax select = Sql92TableSourceTableNameSyntax ( Sql92FromTableSourceSyntax ( Sql92SelectFromSyntax select)) Source #
type Sql92ValueSyntax cmdSyntax = Sql92ExpressionValueSyntax ( Sql92ExpressionSyntax cmdSyntax) Source #
type Sql92ExpressionSyntax cmdSyntax = Sql92SelectExpressionSyntax ( Sql92SelectSyntax cmdSyntax) Source #
type Sql92ExtractFieldSyntax cmdSyntax = Sql92ExpressionExtractFieldSyntax ( Sql92ExpressionSyntax cmdSyntax) Source #
type Sql92HasValueSyntax cmdSyntax = HasSqlValueSyntax ( Sql92ValueSyntax cmdSyntax) Source #
type Sql92SelectSanityCheck select = ( Sql92FromExpressionSyntax ( Sql92SelectTableFromSyntax ( Sql92SelectSelectTableSyntax select)) ~ Sql92SelectTableExpressionSyntax ( Sql92SelectSelectTableSyntax select), Sql92TableSourceSelectSyntax ( Sql92FromTableSourceSyntax ( Sql92SelectTableFromSyntax ( Sql92SelectSelectTableSyntax select))) ~ select, Sql92ProjectionExpressionSyntax ( Sql92SelectTableProjectionSyntax ( Sql92SelectSelectTableSyntax select)) ~ Sql92SelectTableExpressionSyntax ( Sql92SelectSelectTableSyntax select), Sql92OrderingExpressionSyntax ( Sql92SelectOrderingSyntax select) ~ Sql92SelectTableExpressionSyntax ( Sql92SelectSelectTableSyntax select), Sql92TableSourceExpressionSyntax ( Sql92FromTableSourceSyntax ( Sql92SelectTableFromSyntax ( Sql92SelectSelectTableSyntax select))) ~ Sql92SelectTableExpressionSyntax ( Sql92SelectSelectTableSyntax select)) Source #
type Sql92SanityCheck cmd = ( Sql92SelectSanityCheck ( Sql92SelectSyntax cmd), Sql92ExpressionValueSyntax ( Sql92InsertValuesExpressionSyntax ( Sql92InsertValuesSyntax ( Sql92InsertSyntax cmd))) ~ Sql92ValueSyntax cmd, Sql92ExpressionValueSyntax ( Sql92UpdateExpressionSyntax ( Sql92UpdateSyntax cmd)) ~ Sql92ValueSyntax cmd, Sql92ExpressionValueSyntax ( Sql92DeleteExpressionSyntax ( Sql92DeleteSyntax cmd)) ~ Sql92ValueSyntax cmd, Sql92SelectTableExpressionSyntax ( Sql92SelectSelectTableSyntax ( Sql92SelectSyntax cmd)) ~ Sql92InsertValuesExpressionSyntax ( Sql92InsertValuesSyntax ( Sql92InsertSyntax cmd)), Sql92SelectTableExpressionSyntax ( Sql92SelectSelectTableSyntax ( Sql92SelectSyntax cmd)) ~ Sql92UpdateExpressionSyntax ( Sql92UpdateSyntax cmd), Sql92DeleteExpressionSyntax ( Sql92DeleteSyntax cmd) ~ Sql92UpdateExpressionSyntax ( Sql92UpdateSyntax cmd), Sql92ExpressionSelectSyntax ( Sql92InsertExpressionSyntax ( Sql92InsertSyntax cmd)) ~ Sql92SelectSyntax cmd, Sql92InsertValuesSelectSyntax ( Sql92InsertValuesSyntax ( Sql92InsertSyntax cmd)) ~ Sql92SelectSyntax cmd, Sql92UpdateFieldNameSyntax ( Sql92UpdateSyntax cmd) ~ Sql92ExpressionFieldNameSyntax ( Sql92InsertValuesExpressionSyntax ( Sql92InsertValuesSyntax ( Sql92InsertSyntax cmd)))) Source #
type Sql92ReasonableMarshaller be = ( FromBackendRow be SqlNull , FromBackendRow be Text , FromBackendRow be Bool , FromBackendRow be Char , FromBackendRow be Int16 , FromBackendRow be Int32 , FromBackendRow be Int64 , FromBackendRow be LocalTime ) Source #
class Sql92DisplaySyntax syntax where Source #
Type classes for syntaxes which can be displayed
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 #
type Sql92SelectSyntax cmd :: Type Source #
type Sql92InsertSyntax cmd :: Type Source #
type Sql92UpdateSyntax cmd :: Type Source #
type Sql92DeleteSyntax cmd :: Type Source #
selectCmd :: Sql92SelectSyntax cmd -> cmd Source #
insertCmd :: Sql92InsertSyntax cmd -> cmd Source #
updateCmd :: Sql92UpdateSyntax cmd -> cmd Source #
deleteCmd :: Sql92DeleteSyntax cmd -> cmd Source #
Instances
class ( IsSql92SelectTableSyntax ( Sql92SelectSelectTableSyntax select), IsSql92OrderingSyntax ( Sql92SelectOrderingSyntax select)) => IsSql92SelectSyntax select where Source #
type Sql92SelectSelectTableSyntax select :: Type Source #
type Sql92SelectOrderingSyntax select :: Type Source #
:: Sql92SelectSelectTableSyntax select | |
-> [ Sql92SelectOrderingSyntax select] | |
-> Maybe Integer |
LIMIT |
-> Maybe Integer |
OFFSET |
-> select |
Instances
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 #
type Sql92SelectTableSelectSyntax select :: Type Source #
type Sql92SelectTableExpressionSyntax select :: Type Source #
type Sql92SelectTableProjectionSyntax select :: Type Source #
type Sql92SelectTableFromSyntax select :: Type Source #
type Sql92SelectTableGroupingSyntax select :: Type Source #
type Sql92SelectTableSetQuantifierSyntax select :: Type Source #
:: Maybe ( Sql92SelectTableSetQuantifierSyntax select) | |
-> Sql92SelectTableProjectionSyntax select | |
-> Maybe ( Sql92SelectTableFromSyntax select) | |
-> Maybe ( Sql92SelectTableExpressionSyntax select) |
Where clause |
-> Maybe ( Sql92SelectTableGroupingSyntax select) | |
-> Maybe ( Sql92SelectTableExpressionSyntax select) |
having clause |
-> select |
unionTables :: Bool -> select -> select -> select Source #
intersectTables :: Bool -> select -> select -> select Source #
exceptTable :: Bool -> select -> select -> select Source #
Instances
class ( IsSql92InsertValuesSyntax ( Sql92InsertValuesSyntax insert), IsSql92TableNameSyntax ( Sql92InsertTableNameSyntax insert)) => IsSql92InsertSyntax insert where Source #
type Sql92InsertValuesSyntax insert :: Type Source #
type Sql92InsertTableNameSyntax insert :: Type Source #
:: Sql92InsertTableNameSyntax insert | |
-> [ Text ] |
Fields |
-> Sql92InsertValuesSyntax insert | |
-> insert |
Instances
IsSql92InsertSyntax Insert Source # | |
Defined in Database.Beam.Backend.SQL.AST insertStmt :: Sql92InsertTableNameSyntax Insert -> [ Text ] -> Sql92InsertValuesSyntax Insert -> Insert Source # |
|
IsSql92InsertSyntax SqlSyntaxBuilder Source # | |
Defined in Database.Beam.Backend.SQL.Builder |
class IsSql92ExpressionSyntax ( Sql92InsertValuesExpressionSyntax insertValues) => IsSql92InsertValuesSyntax insertValues where Source #
type Sql92InsertValuesExpressionSyntax insertValues :: Type Source #
type Sql92InsertValuesSelectSyntax insertValues :: Type Source #
insertSqlExpressions :: [[ Sql92InsertValuesExpressionSyntax insertValues]] -> insertValues Source #
insertFromSql :: Sql92InsertValuesSelectSyntax insertValues -> insertValues Source #
Instances
IsSql92InsertValuesSyntax InsertValues Source # | |
IsSql92InsertValuesSyntax SqlSyntaxBuilder Source # | |
class ( IsSql92ExpressionSyntax ( Sql92UpdateExpressionSyntax update), IsSql92FieldNameSyntax ( Sql92UpdateFieldNameSyntax update), IsSql92TableNameSyntax ( Sql92UpdateTableNameSyntax update)) => IsSql92UpdateSyntax update where Source #
type Sql92UpdateTableNameSyntax update :: Type Source #
type Sql92UpdateFieldNameSyntax update :: Type Source #
type Sql92UpdateExpressionSyntax update :: Type Source #
:: Sql92UpdateTableNameSyntax update | |
-> [( Sql92UpdateFieldNameSyntax update, Sql92UpdateExpressionSyntax update)] | |
-> Maybe ( Sql92UpdateExpressionSyntax update) |
WHERE |
-> update |
Instances
IsSql92UpdateSyntax Update Source # | |
Defined in Database.Beam.Backend.SQL.AST |
|
IsSql92UpdateSyntax SqlSyntaxBuilder Source # | |
class ( IsSql92TableNameSyntax ( Sql92DeleteTableNameSyntax delete), IsSql92ExpressionSyntax ( Sql92DeleteExpressionSyntax delete)) => IsSql92DeleteSyntax delete where Source #
type Sql92DeleteTableNameSyntax delete :: Type Source #
type Sql92DeleteExpressionSyntax delete :: Type Source #
deleteStmt :: Sql92DeleteTableNameSyntax delete -> Maybe Text -> Maybe ( Sql92DeleteExpressionSyntax delete) -> delete Source #
deleteSupportsAlias :: Proxy delete -> Bool Source #
Whether or not the
DELETE
command supports aliases
Instances
class IsSql92FieldNameSyntax fn where Source #
qualifiedField :: Text -> Text -> fn Source #
unqualifiedField :: Text -> fn Source #
Instances
class IsSql92QuantifierSyntax quantifier where Source #
quantifyOverAll :: quantifier Source #
quantifyOverAny :: quantifier Source #
class IsSql92ExtractFieldSyntax extractField where Source #
secondsField :: extractField Source #
minutesField :: extractField Source #
hourField :: extractField Source #
dayField :: extractField Source #
monthField :: extractField Source #
class IsSql92DataTypeSyntax dataType where Source #
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 #
smallIntType :: dataType Source #
floatType :: Maybe Word -> dataType Source #
doubleType :: dataType Source #
Instances
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 #
valueE , rowE , coalesceE , caseE , fieldE , andE , orE , addE , subE , mulE , divE , likeE , modE , overlapsE , nullIfE , positionE , eqE , neqE , ltE , gtE , leE , geE , castE , notE , negateE , isNullE , isNotNullE , isTrueE , isNotTrueE , isFalseE , isNotFalseE , isUnknownE , isNotUnknownE , charLengthE , octetLengthE , bitLengthE , lowerE , upperE , trimE , absE , extractE , existsE , uniqueE , subqueryE , currentTimestampE , defaultE , inE
type Sql92ExpressionQuantifierSyntax expr :: Type Source #
type Sql92ExpressionValueSyntax expr :: Type Source #
type Sql92ExpressionSelectSyntax expr :: Type Source #
type Sql92ExpressionFieldNameSyntax expr :: Type Source #
type Sql92ExpressionCastTargetSyntax expr :: Type Source #
type Sql92ExpressionExtractFieldSyntax expr :: Type Source #
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 #
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 #
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 #
Instances
class IsSql92AggregationSetQuantifierSyntax ( Sql92AggregationSetQuantifierSyntax expr) => IsSql92AggregationExpressionSyntax expr where Source #
type Sql92AggregationSetQuantifierSyntax expr :: Type Source #
countE :: Maybe ( Sql92AggregationSetQuantifierSyntax expr) -> expr -> expr Source #
avgE :: Maybe ( Sql92AggregationSetQuantifierSyntax expr) -> expr -> expr Source #
maxE :: Maybe ( Sql92AggregationSetQuantifierSyntax expr) -> expr -> expr Source #
minE :: Maybe ( Sql92AggregationSetQuantifierSyntax expr) -> expr -> expr Source #
sumE :: Maybe ( Sql92AggregationSetQuantifierSyntax expr) -> expr -> expr Source #
Instances
class IsSql92AggregationSetQuantifierSyntax q where Source #
setQuantifierDistinct :: q Source #
setQuantifierAll :: q Source #
class IsSql92ExpressionSyntax ( Sql92ProjectionExpressionSyntax proj) => IsSql92ProjectionSyntax proj where Source #
type Sql92ProjectionExpressionSyntax proj :: Type Source #
Instances
class IsSql92OrderingSyntax ord where Source #
type Sql92OrderingExpressionSyntax ord :: Type Source #
ascOrdering :: Sql92OrderingExpressionSyntax ord -> ord Source #
descOrdering :: Sql92OrderingExpressionSyntax ord -> ord Source #
class IsSql92TableNameSyntax tblName where Source #
Instances
class IsSql92TableNameSyntax ( Sql92TableSourceTableNameSyntax tblSource) => IsSql92TableSourceSyntax tblSource where Source #
type Sql92TableSourceSelectSyntax tblSource :: Type Source #
type Sql92TableSourceExpressionSyntax tblSource :: Type Source #
type Sql92TableSourceTableNameSyntax tblSource :: Type Source #
tableNamed :: Sql92TableSourceTableNameSyntax tblSource -> tblSource Source #
tableFromSubSelect :: Sql92TableSourceSelectSyntax tblSource -> tblSource Source #
tableFromValues :: [[ Sql92TableSourceExpressionSyntax tblSource]] -> tblSource Source #
Instances
IsSql92TableSourceSyntax TableSource Source # | |
IsSql92TableSourceSyntax SqlSyntaxBuilder Source # | |
class IsSql92GroupingSyntax grouping where Source #
type Sql92GroupingExpressionSyntax grouping :: Type Source #
groupByExpressions :: [ Sql92GroupingExpressionSyntax grouping] -> grouping Source #
Instances
class ( IsSql92TableSourceSyntax ( Sql92FromTableSourceSyntax from), IsSql92ExpressionSyntax ( Sql92FromExpressionSyntax from)) => IsSql92FromSyntax from where Source #
type Sql92FromTableSourceSyntax from :: Type Source #
type Sql92FromExpressionSyntax from :: Type Source #
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 #
Instances
class IsSql92FromSyntax from => IsSql92FromOuterJoinSyntax from where Source #
outerJoin :: from -> from -> Maybe ( Sql92FromExpressionSyntax from) -> from Source #