Safe Haskell | None |
---|
Abstract Syntax Tree of yesod-dsl definition.
- data Module = Module {
- modName :: Maybe String
- modImports :: [FilePath]
- modEntities :: [Entity]
- modClasses :: [Class]
- modEnums :: [EnumType]
- modRoutes :: [Route]
- modDefines :: [Define]
- moduleName :: Module -> String
- emptyModule :: Module
- type ClassName = String
- type ParamName = String
- type EntityName = String
- type EnumName = String
- data FieldType
- type FieldName = String
- type PathName = String
- type UniqueName = String
- type QueryName = String
- data Location = Loc FilePath Int Int
- mkLoc :: Token -> Location
- data Define = Define {}
- data DefineContent = DefineSubQuery SelectQuery
- data Unique = Unique {}
- data HandlerType
- = GetHandler
- | PutHandler
- | PostHandler
- | DeleteHandler
- type VariableName = String
- data JoinType
- isOuterJoin :: JoinType -> Bool
- data BinOp
- data ValBinOp
- data BoolExpr
- data ValExpr
- data HandlerParam
- = Public
- | DefaultFilterSort
- | Select SelectQuery
- | IfFilter IfFilterParams
- | DeleteFrom EntityName VariableName (Maybe BoolExpr)
- | GetById EntityName InputFieldRef VariableName
- | Update EntityName InputFieldRef (Maybe [InputField])
- | Insert EntityName (Maybe [InputField]) (Maybe VariableName)
- | Return [OutputField]
- | Require SelectQuery
- | For VariableName InputFieldRef [HandlerParam]
- | Call FunctionName [InputFieldRef]
- type UseParamFlag = Bool
- type IfFilterParams = (ParamName, [Join], BoolExpr, UseParamFlag)
- data SelectQuery = SelectQuery {
- sqFields :: [SelectField]
- sqFrom :: (EntityName, VariableName)
- sqJoins :: [Join]
- sqWhere :: Maybe BoolExpr
- sqOrderBy :: [(FieldRef, SortDir)]
- sqLimitOffset :: (Int, Int)
- type MaybeFlag = Bool
- sqAliases :: SelectQuery -> [(EntityName, VariableName, MaybeFlag)]
- data SelectField
- data Join = Join {}
- type InputField = (ParamName, InputFieldRef)
- data InputFieldRef
- type OutputField = (ParamName, OutputFieldRef)
- data OutputFieldRef = OutputFieldLocalParam VariableName
- data SortDir
- data Handler = Handler {}
- data Entity = Entity {
- entityLoc :: Location
- entityName :: String
- entityInstances :: [ClassName]
- entityFields :: [Field]
- entityUniques :: [Unique]
- entityDeriving :: [ClassName]
- entityChecks :: [FunctionName]
- data Route = Route {}
- routePathParams :: Route -> [PathPiece]
- handlerName :: Route -> Handler -> String
- routeName :: [PathPiece] -> String
- data PathPiece
- data FieldRef
- entityFieldByName :: Entity -> FieldName -> Field
- data EnumType = EnumType {}
- data Class = Class {
- classLoc :: Location
- className :: String
- classFields :: [Field]
- classUniques :: [Unique]
- type DefaultValue = String
- type IsListFlag = Bool
- data FieldContent
- data Field = Field {}
- type FunctionName = String
- data FieldOption
- data FieldValue
- = StringValue String
- | IntValue Int
- | FloatValue Double
- | BoolValue Bool
- | NothingValue
- fieldValueToSql :: FieldValue -> String
- fieldValueToEsqueleto :: FieldValue -> String
- fieldValueToHs :: FieldValue -> String
- fieldOptions :: Field -> [FieldOption]
- fieldDefault :: Field -> Maybe FieldValue
- fieldChecks :: Field -> [FunctionName]
- lookupEntity :: Module -> EntityName -> Maybe Entity
- lookupField :: Module -> EntityName -> FieldName -> Maybe Field
- lowerFirst :: String -> String
- upperFirst :: String -> String
Documentation
definitions in single file form a Module
Module | |
|
moduleName :: Module -> StringSource
type EntityName = StringSource
type UniqueName = StringSource
macro definition, currently used only to define parametrized sub-select-queries
Define | |
|
data DefineContent Source
Unique | |
|
data HandlerType Source
type VariableName = StringSource
isOuterJoin :: JoinType -> BoolSource
data HandlerParam Source
type UseParamFlag = BoolSource
type IfFilterParams = (ParamName, [Join], BoolExpr, UseParamFlag)Source
data SelectQuery Source
SelectQuery | |
|
sqAliases :: SelectQuery -> [(EntityName, VariableName, MaybeFlag)]Source
data SelectField Source
Join | |
|
type InputField = (ParamName, InputFieldRef)Source
data InputFieldRef Source
type OutputField = (ParamName, OutputFieldRef)Source
data OutputFieldRef Source
Entity | |
|
routePathParams :: Route -> [PathPiece]Source
handlerName :: Route -> Handler -> StringSource
entityFieldByName :: Entity -> FieldName -> FieldSource
Class | |
|
type DefaultValue = StringSource
type IsListFlag = BoolSource
data FieldContent Source
type FunctionName = StringSource
data FieldOption Source
data FieldValue Source
fieldOptions :: Field -> [FieldOption]Source
fieldChecks :: Field -> [FunctionName]Source
lookupEntity :: Module -> EntityName -> Maybe EntitySource
lookupField :: Module -> EntityName -> FieldName -> Maybe FieldSource
lowerFirst :: String -> StringSource
upperFirst :: String -> StringSource