modify basic typenames to support dotted names in the syntax
add syntax for most of the other kinds of typenames add pretty printing for these todo: the parsing and the tests
This commit is contained in:
parent
438e3383e4
commit
fbdcacc604
4 changed files with 120 additions and 22 deletions
Language/SQL/SimpleSQL
|
@ -6,6 +6,9 @@
|
|||
> ValueExpr(..)
|
||||
> ,Name(..)
|
||||
> ,TypeName(..)
|
||||
> ,IntervalTypeField(..)
|
||||
> ,LobMultiplier(..)
|
||||
> ,LobUnits(..)
|
||||
> ,SetQuantifier(..)
|
||||
> ,SortSpec(..)
|
||||
> ,Direction(..)
|
||||
|
@ -151,10 +154,31 @@
|
|||
> | QName String
|
||||
> deriving (Eq,Show,Read,Data,Typeable)
|
||||
|
||||
TODO: add ref and scope, any others?
|
||||
|
||||
> -- | Represents a type name, used in casts.
|
||||
> data TypeName = TypeName String
|
||||
> | PrecTypeName String Integer
|
||||
> | PrecScaleTypeName String Integer Integer
|
||||
> data TypeName
|
||||
> = TypeName [Name]
|
||||
> | PrecTypeName [Name] Integer
|
||||
> | PrecScaleTypeName [Name] Integer Integer
|
||||
> | LobTypeName [Name] Int (Maybe LobMultiplier) (Maybe LobUnits)
|
||||
> -- precision, characterset, collate
|
||||
> | CharTypeName [Name] (Maybe Integer) [Name] (Maybe Name)
|
||||
> | TimeTypeName [Name] (Maybe Integer) Bool -- true == with time zone
|
||||
> | RowTypeName [(Name,TypeName)]
|
||||
> | IntervalTypeName IntervalTypeField (Maybe IntervalTypeField)
|
||||
> | ArrayType TypeName (Maybe Integer)
|
||||
> | MultisetType TypeName
|
||||
> deriving (Eq,Show,Read,Data,Typeable)
|
||||
|
||||
> data IntervalTypeField = Itf String (Maybe (Int, Maybe Int))
|
||||
> deriving (Eq,Show,Read,Data,Typeable)
|
||||
|
||||
> data LobMultiplier = LobK | LobM | LobG
|
||||
> deriving (Eq,Show,Read,Data,Typeable)
|
||||
> data LobUnits = LobCharacters
|
||||
> | LobCodeUnits
|
||||
> | LobOctets
|
||||
> deriving (Eq,Show,Read,Data,Typeable)
|
||||
|
||||
> -- | Used for 'expr in (value expression list)', and 'expr in
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue