relational-schemas-0.0.1.2: RDBMSs' schema templates for relational-query

Portabilityunknown
Stabilityexperimental
Maintainerex8k.hibino@gmail.com
Safe HaskellNone

Database.Relational.Schema.PostgreSQL

Description

This module implements queries to get table schema and table constraint informations from system catalog of PostgreSQL.

Synopsis

Documentation

type Column = (PgAttribute, PgType)Source

Type to represent Column information.

normalizeColumn :: String -> StringSource

Normalize column name string to query PostgreSQL system catalog.

notNull :: Column -> BoolSource

Not-null attribute information of column.

getTypeSource

Arguments

:: Map String TypeQ

Type mapping specified by user

-> Column

Column info in system catalog

-> Maybe (String, TypeQ)

Result normalized name and mapped Haskell type

Get column normalized name and column Haskell type.

columnQuerySQL :: Query (String, String) ColumnSource

Phantom typed Query to get Column from schema name and table name.

primaryKeyLengthQuerySQL :: Query (String, String) Int32Source

Phantom typed Query to get primary key length from schema name and table name.

primaryKeyQuerySQL :: Int32 -> Query (String, String) StringSource

Phantom typed Query to get primary key name from schema name and table name.