Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
The AST for SQL.
Synopsis
- data ScalarExpr
- = NumLit String
- | StringLit String String String
- | IntervalLit { }
- | TypedLit TypeName String
- | Iden [Name]
- | Star
- | Parameter
- | PositionalArg Int
- | HostParameter String (Maybe String)
- | BinOp ScalarExpr [Name] ScalarExpr
- | PrefixOp [Name] ScalarExpr
- | PostfixOp [Name] ScalarExpr
- | SpecialOp [Name] [ScalarExpr]
- | App [Name] [ScalarExpr]
- | AggregateApp {
- aggName :: [Name]
- aggDistinct :: SetQuantifier
- aggArgs :: [ScalarExpr]
- aggOrderBy :: [SortSpec]
- aggFilter :: Maybe ScalarExpr
- | AggregateAppGroup { }
- | WindowApp {
- wnName :: [Name]
- wnArgs :: [ScalarExpr]
- wnPartition :: [ScalarExpr]
- wnOrderBy :: [SortSpec]
- wnFrame :: Maybe Frame
- | SpecialOpK [Name] (Maybe ScalarExpr) [(String, ScalarExpr)]
- | Cast ScalarExpr TypeName
- | Case {
- caseTest :: Maybe ScalarExpr
- caseWhens :: [([ScalarExpr], ScalarExpr)]
- caseElse :: Maybe ScalarExpr
- | Parens ScalarExpr
- | In Bool ScalarExpr InPredValue
- | SubQueryExpr SubQueryExprType QueryExpr
- | QuantifiedComparison ScalarExpr [Name] CompPredQuantifier QueryExpr
- | Match ScalarExpr Bool QueryExpr
- | Array ScalarExpr [ScalarExpr]
- | ArrayCtor QueryExpr
- | Collate ScalarExpr [Name]
- | MultisetBinOp ScalarExpr SetOperatorName SetQuantifier ScalarExpr
- | MultisetCtor [ScalarExpr]
- | MultisetQueryCtor QueryExpr
- | NextValueFor [Name]
- | VEComment [Comment] ScalarExpr
- | OdbcLiteral OdbcLiteralType String
- | OdbcFunc ScalarExpr
- data Name = Name (Maybe (String, String)) String
- data TypeName
- = TypeName [Name]
- | PrecTypeName [Name] Integer
- | PrecScaleTypeName [Name] Integer Integer
- | PrecLengthTypeName [Name] Integer (Maybe PrecMultiplier) (Maybe PrecUnits)
- | CharTypeName [Name] (Maybe Integer) [Name] [Name]
- | TimeTypeName [Name] (Maybe Integer) Bool
- | RowTypeName [(Name, TypeName)]
- | IntervalTypeName IntervalTypeField (Maybe IntervalTypeField)
- | ArrayTypeName TypeName (Maybe Integer)
- | MultisetTypeName TypeName
- data IntervalTypeField = Itf String (Maybe (Integer, Maybe Integer))
- data Sign
- data PrecMultiplier
- data PrecUnits
- data SetQuantifier
- data SortSpec = SortSpec ScalarExpr Direction NullsOrder
- data Direction
- = DirDefault
- | Asc
- | Desc
- data NullsOrder
- data InPredValue
- data SubQueryExprType
- data CompPredQuantifier
- data Frame
- data FrameRows
- data FramePos
- data OdbcLiteralType
- = OLDate
- | OLTime
- | OLTimestamp
- data QueryExpr
- = Select {
- qeSetQuantifier :: SetQuantifier
- qeSelectList :: [(ScalarExpr, Maybe Name)]
- qeFrom :: [TableRef]
- qeWhere :: Maybe ScalarExpr
- qeGroupBy :: [GroupingExpr]
- qeHaving :: Maybe ScalarExpr
- qeOrderBy :: [SortSpec]
- qeOffset :: Maybe ScalarExpr
- qeFetchFirst :: Maybe ScalarExpr
- | QueryExprSetOp { }
- | With {
- qeWithRecursive :: Bool
- qeViews :: [(Alias, QueryExpr)]
- qeQueryExpression :: QueryExpr
- | Values [[ScalarExpr]]
- | Table [Name]
- | QEComment [Comment] QueryExpr
- = Select {
- makeSelect :: QueryExpr
- data SetOperatorName
- data Corresponding
- data Alias = Alias Name (Maybe [Name])
- data GroupingExpr
- data TableRef
- data JoinType
- data JoinCondition
- = JoinOn ScalarExpr
- | JoinUsing [Name]
- data Statement
- = CreateSchema [Name]
- | DropSchema [Name] DropBehaviour
- | CreateTable [Name] [TableElement]
- | AlterTable [Name] AlterTableAction
- | DropTable [Name] DropBehaviour
- | CreateView Bool [Name] (Maybe [Name]) QueryExpr (Maybe CheckOption)
- | DropView [Name] DropBehaviour
- | CreateDomain [Name] TypeName (Maybe ScalarExpr) [(Maybe [Name], ScalarExpr)]
- | AlterDomain [Name] AlterDomainAction
- | DropDomain [Name] DropBehaviour
- | CreateAssertion [Name] ScalarExpr
- | DropAssertion [Name] DropBehaviour
- | CreateSequence [Name] [SequenceGeneratorOption]
- | AlterSequence [Name] [SequenceGeneratorOption]
- | DropSequence [Name] DropBehaviour
- | SelectStatement QueryExpr
- | Delete [Name] (Maybe Name) (Maybe ScalarExpr)
- | Truncate [Name] IdentityRestart
- | Insert [Name] (Maybe [Name]) InsertSource
- | Update [Name] (Maybe Name) [SetClause] (Maybe ScalarExpr)
- | GrantPrivilege [PrivilegeAction] PrivilegeObject [Name] GrantOption
- | GrantRole [Name] [Name] AdminOption
- | CreateRole Name
- | DropRole Name
- | RevokePrivilege GrantOptionFor [PrivilegeAction] PrivilegeObject [Name] DropBehaviour
- | RevokeRole AdminOptionFor [Name] [Name] DropBehaviour
- | StartTransaction
- | Savepoint Name
- | ReleaseSavepoint Name
- | Commit
- | Rollback (Maybe Name)
- | StatementComment [Comment]
- data DropBehaviour
- data IdentityRestart
- data InsertSource
- data SetClause
- = Set [Name] ScalarExpr
- | SetMultiple [[Name]] [ScalarExpr]
- data TableElement
- data ColumnDef = ColumnDef Name TypeName (Maybe DefaultClause) [ColConstraintDef]
- data DefaultClause
- data IdentityWhen
- data SequenceGeneratorOption
- data ColConstraintDef = ColConstraintDef (Maybe [Name]) ColConstraint
- data ColConstraint
- data TableConstraint
- data ReferenceMatch
- data ReferentialAction
- data AlterTableAction
- = AddColumnDef ColumnDef
- | AlterColumnSetDefault Name ScalarExpr
- | AlterColumnDropDefault Name
- | AlterColumnSetNotNull Name
- | AlterColumnDropNotNull Name
- | AlterColumnSetDataType Name TypeName
- | DropColumn Name DropBehaviour
- | AddTableConstraintDef (Maybe [Name]) TableConstraint
- | DropTableConstraintDef [Name] DropBehaviour
- data CheckOption
- data AlterDomainAction
- data AdminOption
- data GrantOption
- data PrivilegeObject
- = PrivTable [Name]
- | PrivDomain [Name]
- | PrivType [Name]
- | PrivSequence [Name]
- | PrivFunction [Name]
- data PrivilegeAction
- = PrivAll
- | PrivSelect [Name]
- | PrivDelete
- | PrivInsert [Name]
- | PrivUpdate [Name]
- | PrivReferences [Name]
- | PrivUsage
- | PrivTrigger
- | PrivExecute
- data AdminOptionFor
- data GrantOptionFor
- data Dialect
- ansi2011 :: Dialect
- mysql :: Dialect
- postgres :: Dialect
- oracle :: Dialect
- sqlserver :: Dialect
- data Comment = BlockComment String
Scalar expressions
data ScalarExpr Source #
Represents a value expression. This is used for the expressions in select lists. It is also used for expressions in where, group by, having, order by and so on.
NumLit String | a numeric literal optional decimal point, e+- integral exponent, e.g
|
StringLit String String String | string literal, with the start and end quote
e.g. |
IntervalLit | text of interval literal, units of interval precision, e.g. interval 3 days (3) |
| |
TypedLit TypeName String | prefix 'typed literal', e.g. int '42' |
Iden [Name] | identifier with parts separated by dots |
Star | star, as in select *, t.*, count(*) |
Parameter | Represents a ? in a parameterized query |
PositionalArg Int | Represents an e.g. $1 in a parameterized query |
HostParameter String (Maybe String) | represents a host parameter, e.g. :a. The Maybe String is for the indicator, e.g. :var indicator :nl |
BinOp ScalarExpr [Name] ScalarExpr | Infix binary operators. This is used for symbol operators (a + b), keyword operators (a and b) and multiple keyword operators (a is similar to b) |
PrefixOp [Name] ScalarExpr | Prefix unary operators. This is used for symbol operators, keyword operators and multiple keyword operators. |
PostfixOp [Name] ScalarExpr | Postfix unary operators. This is used for symbol operators, keyword operators and multiple keyword operators. |
SpecialOp [Name] [ScalarExpr] | Used for ternary, mixfix and other non orthodox operators. Currently used for row constructors, and for between. |
App [Name] [ScalarExpr] | function application (anything that looks like c style function application syntactically) |
AggregateApp | aggregate application, which adds distinct or all, and order by, to regular function application |
| |
AggregateAppGroup | aggregates with within group |
WindowApp | window application, which adds over (partition by a order by b) to regular function application. Explicit frames are not currently supported |
| |
SpecialOpK [Name] (Maybe ScalarExpr) [(String, ScalarExpr)] | Used for the operators which look like functions except the arguments are separated by keywords instead of commas. The maybe is for the first unnamed argument if it is present, and the list is for the keyword argument pairs. |
Cast ScalarExpr TypeName | cast(a as typename) |
Case | case expression. both flavours supported |
| |
Parens ScalarExpr | |
In Bool ScalarExpr InPredValue | in list literal and in subquery, if the bool is false it means not in was used ('a not in (1,2)') |
SubQueryExpr SubQueryExprType QueryExpr | exists, all, any, some subqueries |
QuantifiedComparison ScalarExpr [Name] CompPredQuantifier QueryExpr | |
Match ScalarExpr Bool QueryExpr | |
Array ScalarExpr [ScalarExpr] | represents an array access expression, or an array ctor e.g. a[3]. The first scalarExpr is the array, the second is the subscripts/ctor args |
ArrayCtor QueryExpr | this is used for the query expression version of array constructors, e.g. array(select * from t) |
Collate ScalarExpr [Name] | |
MultisetBinOp ScalarExpr SetOperatorName SetQuantifier ScalarExpr | |
MultisetCtor [ScalarExpr] | |
MultisetQueryCtor QueryExpr | |
NextValueFor [Name] | |
VEComment [Comment] ScalarExpr | |
OdbcLiteral OdbcLiteralType String | an odbc literal e.g. {d '2000-01-01'} |
OdbcFunc ScalarExpr | an odbc function call e.g. {fn CHARACTER_LENGTH( |
Instances
Represents an identifier name, which can be quoted or unquoted. examples:
- test -> Name Nothing "test"
- "test" -> Name (Just """,""") "test"
something
-> Name (Just ("`","`") "something"- [ms] -> Name (Just ("[","]") "ms"
Instances
Eq Name Source # | |
Data Name Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Name -> c Name # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Name # dataTypeOf :: Name -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Name) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Name) # gmapT :: (forall b. Data b => b -> b) -> Name -> Name # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Name -> r # gmapQ :: (forall d. Data d => d -> u) -> Name -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Name -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Name -> m Name # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Name -> m Name # | |
Read Name Source # | |
Show Name Source # | |
Represents a type name, used in casts.
Instances
Eq TypeName Source # | |
Data TypeName Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TypeName -> c TypeName # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TypeName # toConstr :: TypeName -> Constr # dataTypeOf :: TypeName -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TypeName) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TypeName) # gmapT :: (forall b. Data b => b -> b) -> TypeName -> TypeName # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TypeName -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TypeName -> r # gmapQ :: (forall d. Data d => d -> u) -> TypeName -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TypeName -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TypeName -> m TypeName # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TypeName -> m TypeName # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TypeName -> m TypeName # | |
Read TypeName Source # | |
Show TypeName Source # | |
data IntervalTypeField Source #
Instances
Instances
Eq Sign Source # | |
Data Sign Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Sign -> c Sign # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Sign # dataTypeOf :: Sign -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Sign) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Sign) # gmapT :: (forall b. Data b => b -> b) -> Sign -> Sign # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Sign -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Sign -> r # gmapQ :: (forall d. Data d => d -> u) -> Sign -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Sign -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Sign -> m Sign # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Sign -> m Sign # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Sign -> m Sign # | |
Read Sign Source # | |
Show Sign Source # | |
data PrecMultiplier Source #
Instances
Instances
Eq PrecUnits Source # | |
Data PrecUnits Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> PrecUnits -> c PrecUnits # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c PrecUnits # toConstr :: PrecUnits -> Constr # dataTypeOf :: PrecUnits -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c PrecUnits) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c PrecUnits) # gmapT :: (forall b. Data b => b -> b) -> PrecUnits -> PrecUnits # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> PrecUnits -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> PrecUnits -> r # gmapQ :: (forall d. Data d => d -> u) -> PrecUnits -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> PrecUnits -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> PrecUnits -> m PrecUnits # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> PrecUnits -> m PrecUnits # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> PrecUnits -> m PrecUnits # | |
Read PrecUnits Source # | |
Show PrecUnits Source # | |
data SetQuantifier Source #
Represents the Distinct or All keywords, which can be used before a select list, in an aggregate/window function application, or in a query expression set operator.
Instances
Represents one field in an order by list.
Instances
Eq SortSpec Source # | |
Data SortSpec Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SortSpec -> c SortSpec # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SortSpec # toConstr :: SortSpec -> Constr # dataTypeOf :: SortSpec -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SortSpec) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SortSpec) # gmapT :: (forall b. Data b => b -> b) -> SortSpec -> SortSpec # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SortSpec -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SortSpec -> r # gmapQ :: (forall d. Data d => d -> u) -> SortSpec -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SortSpec -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SortSpec -> m SortSpec # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SortSpec -> m SortSpec # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SortSpec -> m SortSpec # | |
Read SortSpec Source # | |
Show SortSpec Source # | |
The direction for a column in order by.
Instances
Eq Direction Source # | |
Data Direction Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Direction -> c Direction # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Direction # toConstr :: Direction -> Constr # dataTypeOf :: Direction -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Direction) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Direction) # gmapT :: (forall b. Data b => b -> b) -> Direction -> Direction # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Direction -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Direction -> r # gmapQ :: (forall d. Data d => d -> u) -> Direction -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Direction -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Direction -> m Direction # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Direction -> m Direction # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Direction -> m Direction # | |
Read Direction Source # | |
Show Direction Source # | |
data NullsOrder Source #
Represents 'nulls first' or 'nulls last' in an order by clause.
Instances
data InPredValue Source #
Used for 'expr in (scalar expression list)', and 'expr in (subquery)' syntax.
Instances
data SubQueryExprType Source #
A subquery in a scalar expression.
Instances
data CompPredQuantifier Source #
Instances
Represents the frame clause of a window this can be [range | rows] frame_start or [range | rows] between frame_start and frame_end
Instances
Eq Frame Source # | |
Data Frame Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Frame -> c Frame # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Frame # dataTypeOf :: Frame -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Frame) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Frame) # gmapT :: (forall b. Data b => b -> b) -> Frame -> Frame # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Frame -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Frame -> r # gmapQ :: (forall d. Data d => d -> u) -> Frame -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Frame -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Frame -> m Frame # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Frame -> m Frame # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Frame -> m Frame # | |
Read Frame Source # | |
Show Frame Source # | |
Represents whether a window frame clause is over rows or ranges.
Instances
Eq FrameRows Source # | |
Data FrameRows Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FrameRows -> c FrameRows # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FrameRows # toConstr :: FrameRows -> Constr # dataTypeOf :: FrameRows -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FrameRows) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FrameRows) # gmapT :: (forall b. Data b => b -> b) -> FrameRows -> FrameRows # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FrameRows -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FrameRows -> r # gmapQ :: (forall d. Data d => d -> u) -> FrameRows -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FrameRows -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FrameRows -> m FrameRows # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FrameRows -> m FrameRows # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FrameRows -> m FrameRows # | |
Read FrameRows Source # | |
Show FrameRows Source # | |
represents the start or end of a frame
Instances
Eq FramePos Source # | |
Data FramePos Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FramePos -> c FramePos # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FramePos # toConstr :: FramePos -> Constr # dataTypeOf :: FramePos -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FramePos) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FramePos) # gmapT :: (forall b. Data b => b -> b) -> FramePos -> FramePos # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FramePos -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FramePos -> r # gmapQ :: (forall d. Data d => d -> u) -> FramePos -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FramePos -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FramePos -> m FramePos # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FramePos -> m FramePos # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FramePos -> m FramePos # | |
Read FramePos Source # | |
Show FramePos Source # | |
data OdbcLiteralType Source #
the type of an odbc literal (e.g. {d '2000-01-01'}), correpsonding to the letter after the opening {
Instances
Query expressions
Represents a query expression, which can be:
- a regular select;
- a set operator (union, except, intersect);
- a common table expression (with);
- a table value constructor (values (1,2),(3,4)); or
- an explicit table (table t).
Select | |
| |
QueryExprSetOp | |
With | |
| |
Values [[ScalarExpr]] | |
Table [Name] | |
QEComment [Comment] QueryExpr |
Instances
Eq QueryExpr Source # | |
Data QueryExpr Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> QueryExpr -> c QueryExpr # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c QueryExpr # toConstr :: QueryExpr -> Constr # dataTypeOf :: QueryExpr -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c QueryExpr) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c QueryExpr) # gmapT :: (forall b. Data b => b -> b) -> QueryExpr -> QueryExpr # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> QueryExpr -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> QueryExpr -> r # gmapQ :: (forall d. Data d => d -> u) -> QueryExpr -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> QueryExpr -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> QueryExpr -> m QueryExpr # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> QueryExpr -> m QueryExpr # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> QueryExpr -> m QueryExpr # | |
Read QueryExpr Source # | |
Show QueryExpr Source # | |
makeSelect :: QueryExpr Source #
Helper/'default' value for query exprs to make creating query expr values a little easier. It is defined like this:
makeSelect :: QueryExpr makeSelect = Select {qeSetQuantifier = SQDefault ,qeSelectList = [] ,qeFrom = [] ,qeWhere = Nothing ,qeGroupBy = [] ,qeHaving = Nothing ,qeOrderBy = [] ,qeOffset = Nothing ,qeFetchFirst = Nothing}
data SetOperatorName Source #
Query expression set operators.
Instances
data Corresponding Source #
Corresponding, an option for the set operators.
Instances
Represents an alias for a table valued expression, used in with queries and in from alias, e.g. select a from t u, select a from t u(b), with a(c) as select 1, select * from a.
Instances
Eq Alias Source # | |
Data Alias Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Alias -> c Alias # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Alias # dataTypeOf :: Alias -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Alias) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Alias) # gmapT :: (forall b. Data b => b -> b) -> Alias -> Alias # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Alias -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Alias -> r # gmapQ :: (forall d. Data d => d -> u) -> Alias -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Alias -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Alias -> m Alias # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Alias -> m Alias # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Alias -> m Alias # | |
Read Alias Source # | |
Show Alias Source # | |
data GroupingExpr Source #
Represents an item in a group by clause.
GroupingParens [GroupingExpr] | |
Cube [GroupingExpr] | |
Rollup [GroupingExpr] | |
GroupingSets [GroupingExpr] | |
SimpleGroup ScalarExpr |
Instances
From
Represents a entry in the csv of tables in the from clause.
TRSimple [Name] | from t / from s.t |
TRJoin TableRef Bool JoinType TableRef (Maybe JoinCondition) | from a join b, the bool is true if natural was used |
TRParens TableRef | from (a) |
TRAlias TableRef Alias | from a as b(c,d) |
TRQueryExpr QueryExpr | from (query expr) |
TRFunction [Name] [ScalarExpr] | from function(args) |
TRLateral TableRef | from lateral t |
TROdbc TableRef | ODBC {oj t1 left outer join t2 on expr} syntax |
Instances
Eq TableRef Source # | |
Data TableRef Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> TableRef -> c TableRef # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c TableRef # toConstr :: TableRef -> Constr # dataTypeOf :: TableRef -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c TableRef) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c TableRef) # gmapT :: (forall b. Data b => b -> b) -> TableRef -> TableRef # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> TableRef -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> TableRef -> r # gmapQ :: (forall d. Data d => d -> u) -> TableRef -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> TableRef -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> TableRef -> m TableRef # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> TableRef -> m TableRef # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> TableRef -> m TableRef # | |
Read TableRef Source # | |
Show TableRef Source # | |
The type of a join.
Instances
Eq JoinType Source # | |
Data JoinType Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> JoinType -> c JoinType # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c JoinType # toConstr :: JoinType -> Constr # dataTypeOf :: JoinType -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c JoinType) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c JoinType) # gmapT :: (forall b. Data b => b -> b) -> JoinType -> JoinType # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> JoinType -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> JoinType -> r # gmapQ :: (forall d. Data d => d -> u) -> JoinType -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> JoinType -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> JoinType -> m JoinType # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> JoinType -> m JoinType # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> JoinType -> m JoinType # | |
Read JoinType Source # | |
Show JoinType Source # | |
data JoinCondition Source #
The join condition.
JoinOn ScalarExpr | on expr |
JoinUsing [Name] | using (column list) |
Instances
Statements
Instances
Eq Statement Source # | |
Data Statement Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Statement -> c Statement # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Statement # toConstr :: Statement -> Constr # dataTypeOf :: Statement -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Statement) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Statement) # gmapT :: (forall b. Data b => b -> b) -> Statement -> Statement # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Statement -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Statement -> r # gmapQ :: (forall d. Data d => d -> u) -> Statement -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Statement -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Statement -> m Statement # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Statement -> m Statement # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Statement -> m Statement # | |
Read Statement Source # | |
Show Statement Source # | |
data DropBehaviour Source #
Instances
data IdentityRestart Source #
Instances
data InsertSource Source #
Instances
Set [Name] ScalarExpr | |
SetMultiple [[Name]] [ScalarExpr] |
Instances
Eq SetClause Source # | |
Data SetClause Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> SetClause -> c SetClause # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c SetClause # toConstr :: SetClause -> Constr # dataTypeOf :: SetClause -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c SetClause) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c SetClause) # gmapT :: (forall b. Data b => b -> b) -> SetClause -> SetClause # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> SetClause -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> SetClause -> r # gmapQ :: (forall d. Data d => d -> u) -> SetClause -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> SetClause -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> SetClause -> m SetClause # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> SetClause -> m SetClause # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> SetClause -> m SetClause # | |
Read SetClause Source # | |
Show SetClause Source # | |
data TableElement Source #
Instances
Instances
Eq ColumnDef Source # | |
Data ColumnDef Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ColumnDef -> c ColumnDef # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ColumnDef # toConstr :: ColumnDef -> Constr # dataTypeOf :: ColumnDef -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ColumnDef) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ColumnDef) # gmapT :: (forall b. Data b => b -> b) -> ColumnDef -> ColumnDef # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ColumnDef -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ColumnDef -> r # gmapQ :: (forall d. Data d => d -> u) -> ColumnDef -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ColumnDef -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ColumnDef -> m ColumnDef # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ColumnDef -> m ColumnDef # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ColumnDef -> m ColumnDef # | |
Read ColumnDef Source # | |
Show ColumnDef Source # | |
data DefaultClause Source #
DefaultClause ScalarExpr | |
IdentityColumnSpec IdentityWhen [SequenceGeneratorOption] | |
GenerationClause ScalarExpr |
Instances
data IdentityWhen Source #
Instances
data SequenceGeneratorOption Source #
SGODataType TypeName | |
SGOStartWith Integer | |
SGORestart (Maybe Integer) | |
SGOIncrementBy Integer | |
SGOMaxValue Integer | |
SGONoMaxValue | |
SGOMinValue Integer | |
SGONoMinValue | |
SGOCycle | |
SGONoCycle |
Instances
data ColConstraintDef Source #
Instances
data ColConstraint Source #
ColNotNullConstraint | |
ColUniqueConstraint | |
ColPrimaryKeyConstraint | |
ColReferencesConstraint [Name] (Maybe Name) ReferenceMatch ReferentialAction ReferentialAction | |
ColCheckConstraint ScalarExpr |
Instances
data TableConstraint Source #
TableUniqueConstraint [Name] | |
TablePrimaryKeyConstraint [Name] | |
TableReferencesConstraint [Name] [Name] (Maybe [Name]) ReferenceMatch ReferentialAction ReferentialAction | |
TableCheckConstraint ScalarExpr |
Instances
data ReferenceMatch Source #
Instances
data ReferentialAction Source #
Instances
data AlterTableAction Source #
Instances
data CheckOption Source #
Instances
data AlterDomainAction Source #
ADSetDefault ScalarExpr | |
ADDropDefault | |
ADAddConstraint (Maybe [Name]) ScalarExpr | |
ADDropConstraint [Name] |
Instances
data AdminOption Source #
Instances
data GrantOption Source #
Instances
data PrivilegeObject Source #
PrivTable [Name] | |
PrivDomain [Name] | |
PrivType [Name] | |
PrivSequence [Name] | |
PrivFunction [Name] |
Instances
data PrivilegeAction Source #
PrivAll | |
PrivSelect [Name] | |
PrivDelete | |
PrivInsert [Name] | |
PrivUpdate [Name] | |
PrivReferences [Name] | |
PrivUsage | |
PrivTrigger | |
PrivExecute |
Instances
data AdminOptionFor Source #
Instances
data GrantOptionFor Source #
Instances
Dialects
Used to set the dialect used for parsing and pretty printing, very unfinished at the moment.
Instances
Eq Dialect Source # | |
Data Dialect Source # | |
Defined in Language.SQL.SimpleSQL.Dialect gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Dialect -> c Dialect # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Dialect # toConstr :: Dialect -> Constr # dataTypeOf :: Dialect -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Dialect) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Dialect) # gmapT :: (forall b. Data b => b -> b) -> Dialect -> Dialect # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Dialect -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Dialect -> r # gmapQ :: (forall d. Data d => d -> u) -> Dialect -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Dialect -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Dialect -> m Dialect # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Dialect -> m Dialect # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Dialect -> m Dialect # | |
Read Dialect Source # | |
Show Dialect Source # | |
Comment
Comment. Useful when generating SQL code programmatically. The parser doesn't produce these.
Instances
Eq Comment Source # | |
Data Comment Source # | |
Defined in Language.SQL.SimpleSQL.Syntax gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Comment -> c Comment # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Comment # toConstr :: Comment -> Constr # dataTypeOf :: Comment -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Comment) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Comment) # gmapT :: (forall b. Data b => b -> b) -> Comment -> Comment # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Comment -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Comment -> r # gmapQ :: (forall d. Data d => d -> u) -> Comment -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Comment -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Comment -> m Comment # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Comment -> m Comment # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Comment -> m Comment # | |
Read Comment Source # | |
Show Comment Source # | |