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

Safe HaskellNone

Database.PostgreSQL.ORM.SqlType

Synopsis

Documentation

class (ToField a, FromField a) => SqlType a whereSource

The class of Haskell types that can be converted to and from a particular SQL type. For most instances, you only need to define sqlBaseType.

Methods

sqlBaseType :: a -> ByteStringSource

The name of the SQL type corresponding to Haskell type a, when a value of a can be null. This is the SQL type to and from which a Maybe a will be converted (where Nothing corresponds to the SQL value null).

sqlType :: a -> ByteStringSource

The name of the SQL type corresponding to Haskell type a, when a is not wrapped in Maybe and hence cannot be null. If sqlType is unspecified, the default is to append "NOT NULL" to sqlBaseType.

getTypeOid :: Connection -> ByteString -> IO OidSource

Retreive the Oid corresponding to a type. You can subsequently use the Oid to call getTypeInfo for more information on the type.