relational-query-HDBC-0.7.1.1: HDBC instance of relational-query and typed query interface for HDBC

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

Database.HDBC.Query.TH

Description

This module contains templates to generate Haskell record types and HDBC instances correspond to RDB table schema.

Synopsis

Documentation

makeRelationalRecord Source #

Arguments

:: Name

Type constructor name

-> Q [Dec]

Result declaration

Generate all persistable templates against defined record like type constructor.

makeRelationalRecord' Source #

Arguments

:: Config 
-> Name

Type constructor name

-> Q [Dec]

Result declaration

Generate all persistable templates against defined record like type constructor.

defineTableDefault' Source #

Arguments

:: Config

Configuration to generate query with

-> String

Schema name

-> String

Table name

-> [(String, TypeQ)]

List of column name and type

-> [Name]

Derivings

-> Q [Dec]

Result declaration

Generate all HDBC templates about table except for constraint keys.

defineTableDefault Source #

Arguments

:: Config

Configuration to generate query with

-> String

Schema name

-> String

Table name

-> [(String, TypeQ)]

List of column name and type

-> [Name]

Derivings

-> [Int]

Indexes to represent primary key

-> Maybe Int

Index of not-null key

-> Q [Dec]

Result declaration

Generate all HDBC templates about table.

defineTableFromDB' Source #

Arguments

:: IConnection conn 
=> IO conn

Connect action to system catalog database

-> Driver conn

Driver definition

-> String

Schema name

-> String

Table name

-> [(String, TypeQ)]

Additional column-name and column-type mapping to overwrite default

-> [Name]

Derivings

-> Q [Dec]

Result declaration

Generate all HDBC templates using system catalog informations with specified config.

defineTableFromDB Source #

Arguments

:: IConnection conn 
=> IO conn

Connect action to system catalog database

-> Driver conn

Driver definition

-> String

Schema name

-> String

Table name

-> [Name]

Derivings

-> Q [Dec]

Result declaration

Generate all HDBC templates using system catalog informations.

inlineVerifiedQuery Source #

Arguments

:: IConnection conn 
=> IO conn

Connect action to system catalog database

-> Name

Top-level variable name which has Relation type

-> Relation p r

Object which has Relation type

-> Config

Configuration to generate SQL

-> QuerySuffix

suffix SQL words

-> String

Variable name to define as inlined query

-> Q [Dec]

Result declarations

Verify composed Query and inline it in compile type.