Copyright | 2013-2017 Kei Hibino |
---|---|
License | BSD3 |
Maintainer | [email protected] |
Stability | experimental |
Portability | unknown |
Safe Haskell | None |
Language | Haskell2010 |
Database.Relational.Config
Contents
Description
This module provides untyped components for query.
- data Config
- defaultConfig :: Config
- productUnitSupport :: Config -> ProductUnitSupport
- chunksInsertSize :: Config -> Int
- schemaNameMode :: Config -> SchemaNameMode
- normalizedTableName :: Config -> Bool
- enableWarning :: Config -> Bool
- verboseAsCompilerWarning :: Config -> Bool
- disableOverloadedProjection :: Config -> Bool
- disableSpecializedProjection :: Config -> Bool
- identifierQuotation :: Config -> IdentifierQuotation
- nameConfig :: Config -> NameConfig
- data NameConfig = NameConfig {
- recordConfig :: NameConfig
- relationVarName :: String -> String -> VarName
- defaultNameConfig :: NameConfig
- data ProductUnitSupport
- data SchemaNameMode
- data IdentifierQuotation
Configuration type for query
defaultConfig :: Config Source #
Default configuration of Config
.
To change some behaviour of relational-query,
use record update syntax:
defaultConfig { productUnitSupport =PUSupported
, chunksInsertSize = 256 , schemaNameMode =SchemaQualified
, normalizedTableName = True , verboseAsCompilerWarning = False , disableOverloadedProjection = False , disableSpecializedProjection = False , identifierQuotation =NoQuotation
, nameConfig = defaultNameConfig { recordConfig =defaultNameConfig
, relationVarName = \schema table ->varCamelcaseName
$ table ++ "_" ++ scheme -- ^ append the table name after the schema name. e.g. "schemaTable" } }
productUnitSupport :: Config -> ProductUnitSupport Source #
No FROM clause (corresponding the unit of JOIN) is allowed or not.
chunksInsertSize :: Config -> Int Source #
Threshold count of placeholders in the insert statement with multi-values.
schemaNameMode :: Config -> SchemaNameMode Source #
SchemaNameMode
configuration
normalizedTableName :: Config -> Bool Source #
If True, schema names become uppercase, and table names become lowercase.
enableWarning :: Config -> Bool Source #
If True, print warning messages in macros of relational-record.
verboseAsCompilerWarning :: Config -> Bool Source #
If True, more detailed logs are printed when generating record types from schema.
disableOverloadedProjection :: Config -> Bool Source #
If True, instance of HasProjection
for each column is NOT generated.
disableSpecializedProjection :: Config -> Bool Source #
If True, Pi
for each column is NOT generated.
identifierQuotation :: Config -> IdentifierQuotation Source #
IdentifierQuotation
configuration
nameConfig :: Config -> NameConfig Source #
NameConfig
configuration
data NameConfig Source #
NameConfig
type to customize names of expanded templates.
Constructors
NameConfig | |
Fields
|
Instances
defaultNameConfig :: NameConfig Source #
Default implementation of NameConfig
type.
data ProductUnitSupport Source #
Unit of product is supported or not.
Constructors
PUSupported | |
PUNotSupported |
Instances
data SchemaNameMode Source #
Schema name qualify mode in SQL string.
Constructors
SchemaQualified | Schema qualified table name in SQL string |
SchemaNotQualified | Not qualified table name in SQL string |
Instances
data IdentifierQuotation Source #
Configuration for quotation of identifiers of SQL.
Constructors
NoQuotation | |
Quotation Char |
Instances