small tweaks
This commit is contained in:
parent
c102528d5f
commit
5b786bd11d
|
@ -93,13 +93,43 @@
|
||||||
> ,ilFrom :: IntervalTypeField
|
> ,ilFrom :: IntervalTypeField
|
||||||
> ,ilTo :: Maybe IntervalTypeField
|
> ,ilTo :: Maybe IntervalTypeField
|
||||||
> }
|
> }
|
||||||
|
|
||||||
|
> -- | prefix 'typed literal', e.g. int '42'
|
||||||
|
> | TypedLit TypeName String
|
||||||
|
|
||||||
> -- | identifier with parts separated by dots
|
> -- | identifier with parts separated by dots
|
||||||
> | Iden [Name]
|
> | Iden [Name]
|
||||||
> -- | star, as in select *, t.*, count(*)
|
> -- | star, as in select *, t.*, count(*)
|
||||||
> | Star
|
> | Star
|
||||||
|
|
||||||
|
> | Parameter -- ^ Represents a ? 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
|
||||||
|
|
||||||
|
|
||||||
|
> -- | 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)
|
||||||
|
> | BinOp ValueExpr [Name] ValueExpr
|
||||||
|
> -- | Prefix unary operators. This is used for symbol
|
||||||
|
> -- operators, keyword operators and multiple keyword operators.
|
||||||
|
> | PrefixOp [Name] ValueExpr
|
||||||
|
> -- | Postfix unary operators. This is used for symbol
|
||||||
|
> -- operators, keyword operators and multiple keyword operators.
|
||||||
|
> | PostfixOp [Name] ValueExpr
|
||||||
|
> -- | Used for ternary, mixfix and other non orthodox
|
||||||
|
> -- operators. Currently used for row constructors, and for
|
||||||
|
> -- between.
|
||||||
|
> | SpecialOp [Name] [ValueExpr]
|
||||||
|
|
||||||
> -- | function application (anything that looks like c style
|
> -- | function application (anything that looks like c style
|
||||||
> -- function application syntactically)
|
> -- function application syntactically)
|
||||||
> | App [Name] [ValueExpr]
|
> | App [Name] [ValueExpr]
|
||||||
|
|
||||||
|
|
||||||
> -- | aggregate application, which adds distinct or all, and
|
> -- | aggregate application, which adds distinct or all, and
|
||||||
> -- order by, to regular function application
|
> -- order by, to regular function application
|
||||||
> | AggregateApp
|
> | AggregateApp
|
||||||
|
@ -125,53 +155,39 @@
|
||||||
> ,wnOrderBy :: [SortSpec] -- ^ order by
|
> ,wnOrderBy :: [SortSpec] -- ^ order by
|
||||||
> ,wnFrame :: Maybe Frame -- ^ frame clause
|
> ,wnFrame :: Maybe Frame -- ^ frame clause
|
||||||
> }
|
> }
|
||||||
> -- | 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)
|
|
||||||
> | BinOp ValueExpr [Name] ValueExpr
|
|
||||||
> -- | Prefix unary operators. This is used for symbol
|
|
||||||
> -- operators, keyword operators and multiple keyword operators.
|
|
||||||
> | PrefixOp [Name] ValueExpr
|
|
||||||
> -- | Postfix unary operators. This is used for symbol
|
|
||||||
> -- operators, keyword operators and multiple keyword operators.
|
|
||||||
> | PostfixOp [Name] ValueExpr
|
|
||||||
> -- | Used for ternary, mixfix and other non orthodox
|
|
||||||
> -- operators. Currently used for row constructors, and for
|
|
||||||
> -- between.
|
|
||||||
> | SpecialOp [Name] [ValueExpr]
|
|
||||||
> -- | Used for the operators which look like functions
|
> -- | Used for the operators which look like functions
|
||||||
> -- except the arguments are separated by keywords instead
|
> -- except the arguments are separated by keywords instead
|
||||||
> -- of commas. The maybe is for the first unnamed argument
|
> -- of commas. The maybe is for the first unnamed argument
|
||||||
> -- if it is present, and the list is for the keyword argument
|
> -- if it is present, and the list is for the keyword argument
|
||||||
> -- pairs.
|
> -- pairs.
|
||||||
> | SpecialOpK [Name] (Maybe ValueExpr) [(String,ValueExpr)]
|
> | SpecialOpK [Name] (Maybe ValueExpr) [(String,ValueExpr)]
|
||||||
|
|
||||||
|
> -- | cast(a as typename)
|
||||||
|
> | Cast ValueExpr TypeName
|
||||||
|
|
||||||
> -- | case expression. both flavours supported
|
> -- | case expression. both flavours supported
|
||||||
> | Case
|
> | Case
|
||||||
> {caseTest :: Maybe ValueExpr -- ^ test value
|
> {caseTest :: Maybe ValueExpr -- ^ test value
|
||||||
> ,caseWhens :: [([ValueExpr],ValueExpr)] -- ^ when branches
|
> ,caseWhens :: [([ValueExpr],ValueExpr)] -- ^ when branches
|
||||||
> ,caseElse :: Maybe ValueExpr -- ^ else value
|
> ,caseElse :: Maybe ValueExpr -- ^ else value
|
||||||
> }
|
> }
|
||||||
|
|
||||||
> | Parens ValueExpr
|
> | Parens ValueExpr
|
||||||
> -- | cast(a as typename)
|
|
||||||
> | Cast ValueExpr TypeName
|
|
||||||
> -- | prefix 'typed literal', e.g. int '42'
|
|
||||||
> | TypedLit TypeName String
|
|
||||||
> -- | exists, all, any, some subqueries
|
|
||||||
> | SubQueryExpr SubQueryExprType QueryExpr
|
|
||||||
> -- | in list literal and in subquery, if the bool is false it
|
> -- | in list literal and in subquery, if the bool is false it
|
||||||
> -- means not in was used ('a not in (1,2)')
|
> -- means not in was used ('a not in (1,2)')
|
||||||
> | In Bool ValueExpr InPredValue
|
> | In Bool ValueExpr InPredValue
|
||||||
> | Parameter -- ^ Represents a ? in a parameterized query
|
|
||||||
> | HostParameter String (Maybe String) -- ^ represents a host
|
> -- | exists, all, any, some subqueries
|
||||||
> -- parameter, e.g. :a. The
|
> | SubQueryExpr SubQueryExprType QueryExpr
|
||||||
> -- Maybe String is for the
|
|
||||||
> -- indicator, e.g. :var
|
|
||||||
> -- indicator :nl
|
|
||||||
> | QuantifiedComparison
|
> | QuantifiedComparison
|
||||||
> ValueExpr
|
> ValueExpr
|
||||||
> [Name] -- operator
|
> [Name] -- operator
|
||||||
> CompPredQuantifier
|
> CompPredQuantifier
|
||||||
> QueryExpr
|
> QueryExpr
|
||||||
|
|
||||||
> | Match ValueExpr Bool -- true if unique
|
> | Match ValueExpr Bool -- true if unique
|
||||||
> QueryExpr
|
> QueryExpr
|
||||||
> | Array ValueExpr [ValueExpr] -- ^ represents an array
|
> | Array ValueExpr [ValueExpr] -- ^ represents an array
|
||||||
|
@ -180,7 +196,12 @@
|
||||||
> -- valueExpr is the array, the
|
> -- valueExpr is the array, the
|
||||||
> -- second is the subscripts/ctor args
|
> -- 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)
|
> | ArrayCtor QueryExpr -- ^ this is used for the query expression version of array constructors, e.g. array(select * from t)
|
||||||
|
|
||||||
> | CSStringLit String String
|
> | CSStringLit String String
|
||||||
|
|
||||||
|
todo: special syntax for like, similar with escape - escape cannot go
|
||||||
|
in other places
|
||||||
|
|
||||||
> | Escape ValueExpr Char
|
> | Escape ValueExpr Char
|
||||||
> | UEscape ValueExpr Char
|
> | UEscape ValueExpr Char
|
||||||
> | Collate ValueExpr [Name]
|
> | Collate ValueExpr [Name]
|
||||||
|
|
|
@ -55,7 +55,7 @@ Test-Suite Tests
|
||||||
parsec >=3.1 && <3.2,
|
parsec >=3.1 && <3.2,
|
||||||
mtl >=2.1 && <2.3,
|
mtl >=2.1 && <2.3,
|
||||||
pretty >= 1.1 && < 1.2,
|
pretty >= 1.1 && < 1.2,
|
||||||
tasty >= 0.10 && < 0.11,
|
tasty >= 0.10 && < 0.12,
|
||||||
tasty-hunit >= 0.9 && < 0.10
|
tasty-hunit >= 0.9 && < 0.10
|
||||||
|
|
||||||
Other-Modules: Language.SQL.SimpleSQL.Pretty,
|
Other-Modules: Language.SQL.SimpleSQL.Pretty,
|
||||||
|
@ -112,7 +112,7 @@ executable Fixity
|
||||||
mtl >=2.1 && <2.3,
|
mtl >=2.1 && <2.3,
|
||||||
pretty >= 1.1 && < 1.2,
|
pretty >= 1.1 && < 1.2,
|
||||||
pretty-show >= 1.6 && < 1.7,
|
pretty-show >= 1.6 && < 1.7,
|
||||||
tasty >= 0.10 && < 0.11,
|
tasty >= 0.10 && < 0.12,
|
||||||
tasty-hunit >= 0.9 && < 0.10
|
tasty-hunit >= 0.9 && < 0.10
|
||||||
|
|
||||||
other-extensions: TupleSections,DeriveDataTypeable
|
other-extensions: TupleSections,DeriveDataTypeable
|
||||||
|
|
|
@ -1100,8 +1100,8 @@ create a list of type name variations:
|
||||||
> -- 1 with and without tz
|
> -- 1 with and without tz
|
||||||
> ,("time with time zone"
|
> ,("time with time zone"
|
||||||
> ,TimeTypeName [Name "time"] Nothing True)
|
> ,TimeTypeName [Name "time"] Nothing True)
|
||||||
> ,("datetime(3) without time zone"
|
> ,("timestamp(3) without time zone"
|
||||||
> ,TimeTypeName [Name "datetime"] (Just 3) False)
|
> ,TimeTypeName [Name "timestamp"] (Just 3) False)
|
||||||
> -- chars: (single/multiname) x prec x charset x collate
|
> -- chars: (single/multiname) x prec x charset x collate
|
||||||
> -- 1111
|
> -- 1111
|
||||||
> ,("char varying(5) character set something collate something_insensitive"
|
> ,("char varying(5) character set something collate something_insensitive"
|
||||||
|
|
Loading…
Reference in a new issue