postgresql-orm-0.5.0: An ORM (Object Relational Mapping) and migrations DSL for PostgreSQL.

Database.PostgreSQL.Describe

Description

Utility function for describing a table in the database.

Synopsis

# Documentation

Constructors

 ColumnInfo FieldscolNum :: !Int16Internal column number used by PostgreSQL. Generally these will be consecutive starting from 1, but this may not be the case if you have altered a table to delete columns.colName :: ByteStringName of the columncolType :: !TypeInfoType of the columncolNotNull :: !BoolIf True, the database cannot contain null. (This constraint should always be accurate.)colPrimary :: !BoolTrue if this column (and only this column) constitutes the primary key of the table. Always False if the primary key comprises multiple columns (even if this is one of those columns).colUnique :: !BoolTrue if there is a uniqueness constraint on this column. Not True if this column is part of a uniqueness constraint involving multiple columns. (Such multi-column uniqueness constraints are not reported by this interface.)colReferences :: !(Maybe ByteString)If this there is a foreign key constraint on this column (and the constraint does not span multiple columns), report the table referenced by this column.

Instances

 Source # MethodsshowList :: [ColumnInfo] -> ShowS #

Returns a list of ColumnInfo structures for a particular table. Not all information about a table is returned. In particular, constraints that span columns are ignored.