relational-query-0.12.0.0: Typeful, Modular, Relational, algebraic query engine

Copyright2013-2017 Kei Hibino
LicenseBSD3
Maintainerex8k.hibino@gmail.com
Stabilityexperimental
Portabilityunknown
Safe HaskellNone
LanguageHaskell2010

Database.Relational.Config

Contents

Description

This module provides untyped components for query.

Synopsis

Configuration type for query

data Config Source #

Configuration type.

Instances

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.

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.

data NameConfig Source #

NameConfig type to customize names of expanded templates.

defaultNameConfig :: NameConfig Source #

Default implementation of NameConfig type.

recordConfig :: NameConfig -> NameConfig Source #

Configurations related to the names of generated record types and their field labels.

relationVarName :: NameConfig -> String -> String -> VarName Source #

Function to build the name of Relation representing the table. The first argument is the scheme name, and second argument is the table name.

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

data IdentifierQuotation Source #

Configuration for quotation of identifiers of SQL.

Constructors

NoQuotation 
Quotation Char