|
|
|
|
|
|
| Synopsis |
|
|
|
|
| SQL query ADT
|
|
| data Tables |
| List of tables: simple list or Join
| | Constructors | | Instances | |
|
|
| data Query |
| ADT for SQL Query
| | Constructors | | Query | | | qFields :: [SQLField] | Fields to select
| | qTables :: Tables | | | qWhere :: SQLCondition | Conditions (WHERE part)
| | qOrder :: [SQLOrder] | ORDER BY part
| | qGroup :: [String] | GROUP BY part
| | qLimits :: Maybe (Int, Int) | OFFSET ... LIMIT part
|
| | InsertQuery | | | iTable :: String | Table
| | iFields :: [String] | Fields list
| | iValues :: [String] | Values
|
| | UpdateQuery | | | uTable :: String | Table
| | uFields :: [String] | Fields
| | uValues :: [String] | Values
| | uWhere :: SQLCondition | Condition (WHERE part)
|
| | DelQuery | | |
|
|
|
| data SQLField |
| Constructors | | QField String | Just a named field
| | QFn String String | Some function of field, e.g. count(id)
|
| Instances | |
|
|
| type SQLTable = String |
|
| data SQLCondition |
| ADT for SQL conditions
| | Constructors | | Instances | |
|
|
| class Parameter a where |
| | Methods | | asString :: a -> String | | | asValue :: a -> Maybe SqlValue |
| | Instances | |
|
|
| type Selector = forall a. Parameter a => a |
|
| data SQLOrder |
| Constructors | | Asceding String | | | Desceding String | |
| Instances | |
|
|
| class SQLFragment s where |
| | Methods | | sqlFragment :: s -> String |
| | Instances | |
|
|
| sqlFPair :: SQLFragment f => String -> f -> f -> String |
|
| sqlLift :: (Parameter a, Parameter a1) => String -> a -> a1 -> String |
|
| Data model ADT
|
|
| data ColumnType |
| Type of DB table column
| | Constructors | | Instances | |
|
|
| data Model |
| DB model (table) itself
| | Constructors | | Model | | | mName :: String | Model name
| | mTable :: String | DB table name
| | mFields :: [ModelField] | List of model fields (DB table columns)
| | mCached :: [ModelField] | Additional fields, which are no in DB
| | related :: [(String, [Model])] | Assoc.list of related (children) models
| | defaultOrdering :: [SQLOrder] | How to sort list of this models by default
| | perPage :: Maybe Int | Default paging
| | showMe :: Model -> String | |
|
| Instances | |
|
|
| data ModelField |
| Field for Model
| | Constructors | | Instances | |
|
|
| mfName :: ModelField -> String |
|
| mfType :: ModelField -> ColumnType |
|
| Produced by Haddock version 2.4.2 |