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 Int, 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 Sql92InsertSyntax cmd :: *
- type Sql92UpdateSyntax cmd :: *
- type Sql92DeleteSyntax cmd :: *
- 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 Sql92SelectOrderingSyntax select :: *
- 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 Sql92SelectTableExpressionSyntax select :: *
- type Sql92SelectTableProjectionSyntax select :: *
- type Sql92SelectTableFromSyntax select :: *
- type Sql92SelectTableGroupingSyntax select :: *
- type Sql92SelectTableSetQuantifierSyntax select :: *
- 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 Sql92InsertTableNameSyntax insert :: *
- insertStmt :: Sql92InsertTableNameSyntax insert -> [Text] -> Sql92InsertValuesSyntax insert -> insert
- class IsSql92ExpressionSyntax (Sql92InsertValuesExpressionSyntax insertValues) => IsSql92InsertValuesSyntax insertValues where
- type Sql92InsertValuesExpressionSyntax insertValues :: *
- type Sql92InsertValuesSelectSyntax insertValues :: *
- 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 Sql92UpdateFieldNameSyntax update :: *
- type Sql92UpdateExpressionSyntax update :: *
- 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 Sql92DeleteExpressionSyntax delete :: *
- 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) Int, 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 Sql92ExpressionValueSyntax expr :: *
- type Sql92ExpressionSelectSyntax expr :: *
- type Sql92ExpressionFieldNameSyntax expr :: *
- type Sql92ExpressionCastTargetSyntax expr :: *
- type Sql92ExpressionExtractFieldSyntax expr :: *
- 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 :: *
- 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 :: *
- projExprs :: [(Sql92ProjectionExpressionSyntax proj, Maybe Text)] -> proj
- class IsSql92OrderingSyntax ord where
- type Sql92OrderingExpressionSyntax ord :: *
- ascOrdering, descOrdering :: Sql92OrderingExpressionSyntax ord -> ord
- class IsSql92TableNameSyntax tblName where
- class IsSql92TableNameSyntax (Sql92TableSourceTableNameSyntax tblSource) => IsSql92TableSourceSyntax tblSource where
- type Sql92TableSourceSelectSyntax tblSource :: *
- type Sql92TableSourceExpressionSyntax tblSource :: *
- type Sql92TableSourceTableNameSyntax tblSource :: *
- tableNamed :: Sql92TableSourceTableNameSyntax tblSource -> tblSource
- tableFromSubSelect :: Sql92TableSourceSelectSyntax tblSource -> tblSource
- tableFromValues :: [[Sql92TableSourceExpressionSyntax tblSource]] -> tblSource
- class IsSql92GroupingSyntax grouping where
- type Sql92GroupingExpressionSyntax grouping :: *
- groupByExpressions :: [Sql92GroupingExpressionSyntax grouping] -> grouping
- class (IsSql92TableSourceSyntax (Sql92FromTableSourceSyntax from), IsSql92ExpressionSyntax (Sql92FromExpressionSyntax from)) => IsSql92FromSyntax from where
- type Sql92FromTableSourceSyntax from :: *
- type Sql92FromExpressionSyntax from :: *
- 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 Int, 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 :: * Source #
type Sql92InsertSyntax cmd :: * Source #
type Sql92UpdateSyntax cmd :: * Source #
type Sql92DeleteSyntax cmd :: * 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 :: * Source #
type Sql92SelectOrderingSyntax select :: * Source #
:: Sql92SelectSelectTableSyntax select | |
-> [Sql92SelectOrderingSyntax select] | |
-> Maybe Integer | LIMIT |
-> Maybe Integer | OFFSET |
-> select |
Instances
IsSql92SelectSyntax Select Source # | |
Defined in Database.Beam.Backend.SQL.AST type Sql92SelectSelectTableSyntax Select :: Type Source # type Sql92SelectOrderingSyntax Select :: Type Source # selectStmt :: Sql92SelectSelectTableSyntax Select -> [Sql92SelectOrderingSyntax Select] -> Maybe Integer -> Maybe Integer -> Select Source # | |
IsSql92SelectSyntax SqlSyntaxBuilder Source # | |
Defined in Database.Beam.Backend.SQL.Builder |
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 :: * Source #
type Sql92SelectTableExpressionSyntax select :: * Source #
type Sql92SelectTableProjectionSyntax select :: * Source #
type Sql92SelectTableFromSyntax select :: * Source #
type Sql92SelectTableGroupingSyntax select :: * Source #
type Sql92SelectTableSetQuantifierSyntax select :: * 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 :: * Source #
type Sql92InsertTableNameSyntax insert :: * Source #
:: Sql92InsertTableNameSyntax insert | |
-> [Text] | Fields |
-> Sql92InsertValuesSyntax insert | |
-> insert |
Instances
IsSql92InsertSyntax Insert Source # | |
Defined in Database.Beam.Backend.SQL.AST type Sql92InsertValuesSyntax Insert :: Type Source # type Sql92InsertTableNameSyntax Insert :: Type Source # 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 :: * Source #
type Sql92InsertValuesSelectSyntax insertValues :: * Source #
insertSqlExpressions :: [[Sql92InsertValuesExpressionSyntax insertValues]] -> insertValues Source #
insertFromSql :: Sql92InsertValuesSelectSyntax insertValues -> insertValues Source #
Instances
IsSql92InsertValuesSyntax InsertValues Source # | |
Defined in Database.Beam.Backend.SQL.AST | |
IsSql92InsertValuesSyntax SqlSyntaxBuilder Source # | |
class (IsSql92ExpressionSyntax (Sql92UpdateExpressionSyntax update), IsSql92FieldNameSyntax (Sql92UpdateFieldNameSyntax update), IsSql92TableNameSyntax (Sql92UpdateTableNameSyntax update)) => IsSql92UpdateSyntax update where Source #
type Sql92UpdateTableNameSyntax update :: * Source #
type Sql92UpdateFieldNameSyntax update :: * Source #
type Sql92UpdateExpressionSyntax update :: * Source #
:: Sql92UpdateTableNameSyntax update | |
-> [(Sql92UpdateFieldNameSyntax update, Sql92UpdateExpressionSyntax update)] | |
-> Maybe (Sql92UpdateExpressionSyntax update) | WHERE |
-> update |
Instances
class (IsSql92TableNameSyntax (Sql92DeleteTableNameSyntax delete), IsSql92ExpressionSyntax (Sql92DeleteExpressionSyntax delete)) => IsSql92DeleteSyntax delete where Source #
type Sql92DeleteTableNameSyntax delete :: * Source #
type Sql92DeleteExpressionSyntax delete :: * 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
IsSql92DeleteSyntax Delete Source # | |
Defined in Database.Beam.Backend.SQL.AST type Sql92DeleteTableNameSyntax Delete :: Type Source # type Sql92DeleteExpressionSyntax Delete :: Type Source # | |
IsSql92DeleteSyntax SqlSyntaxBuilder Source # | |
Defined in Database.Beam.Backend.SQL.Builder |
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) Int, 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 :: * Source #
type Sql92ExpressionValueSyntax expr :: * Source #
type Sql92ExpressionSelectSyntax expr :: * Source #
type Sql92ExpressionFieldNameSyntax expr :: * Source #
type Sql92ExpressionCastTargetSyntax expr :: * Source #
type Sql92ExpressionExtractFieldSyntax expr :: * 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 :: * 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 :: * Source #
Instances
IsSql92ProjectionSyntax Projection Source # | |
Defined in Database.Beam.Backend.SQL.AST | |
IsSql92ProjectionSyntax SqlSyntaxBuilder Source # | |
class IsSql92OrderingSyntax ord where Source #
type Sql92OrderingExpressionSyntax ord :: * Source #
ascOrdering :: Sql92OrderingExpressionSyntax ord -> ord Source #
descOrdering :: Sql92OrderingExpressionSyntax ord -> ord Source #
class IsSql92TableNameSyntax tblName where Source #
Instances
IsSql92TableNameSyntax TableName Source # | |
IsSql92TableNameSyntax SqlSyntaxBuilder Source # | |
Defined in Database.Beam.Backend.SQL.Builder |
class IsSql92TableNameSyntax (Sql92TableSourceTableNameSyntax tblSource) => IsSql92TableSourceSyntax tblSource where Source #
type Sql92TableSourceSelectSyntax tblSource :: * Source #
type Sql92TableSourceExpressionSyntax tblSource :: * Source #
type Sql92TableSourceTableNameSyntax tblSource :: * Source #
tableNamed :: Sql92TableSourceTableNameSyntax tblSource -> tblSource Source #
tableFromSubSelect :: Sql92TableSourceSelectSyntax tblSource -> tblSource Source #
tableFromValues :: [[Sql92TableSourceExpressionSyntax tblSource]] -> tblSource Source #
Instances
IsSql92TableSourceSyntax TableSource Source # | |
Defined in Database.Beam.Backend.SQL.AST | |
IsSql92TableSourceSyntax SqlSyntaxBuilder Source # | |
class IsSql92GroupingSyntax grouping where Source #
type Sql92GroupingExpressionSyntax grouping :: * Source #
groupByExpressions :: [Sql92GroupingExpressionSyntax grouping] -> grouping Source #
Instances
IsSql92GroupingSyntax Grouping Source # | |
Defined in Database.Beam.Backend.SQL.AST type Sql92GroupingExpressionSyntax Grouping :: Type Source # | |
IsSql92GroupingSyntax SqlSyntaxBuilder Source # | |
class (IsSql92TableSourceSyntax (Sql92FromTableSourceSyntax from), IsSql92ExpressionSyntax (Sql92FromExpressionSyntax from)) => IsSql92FromSyntax from where Source #
type Sql92FromTableSourceSyntax from :: * Source #
type Sql92FromExpressionSyntax from :: * 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 #