Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class (ToField a, FromField a) => SqlType a where
- getTypeOid :: Connection -> ByteString -> IO Oid
Documentation
class (ToField a, FromField a) => SqlType a where Source #
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
.
sqlBaseType :: a -> ByteString Source #
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
will be converted (where Maybe
aNothing
corresponds to the SQL value null).
sqlType :: a -> ByteString Source #
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
.
SqlType Bool Source # | |
SqlType Double Source # | |
SqlType Float Source # | |
SqlType Int16 Source # | |
SqlType Int32 Source # | |
SqlType Int64 Source # | |
SqlType ByteString Source # | |
SqlType ByteString Source # | |
SqlType String Source # | |
SqlType Text Source # | |
SqlType UTCTime Source # | |
SqlType Text Source # | |
SqlType Oid Source # | |
SqlType LocalTimestamp Source # | |
SqlType UTCTimestamp Source # | |
SqlType ZonedTimestamp Source # | |
SqlType Date Source # | |
SqlType ZonedTime Source # | |
SqlType LocalTime Source # | |
SqlType TimeOfDay Source # | |
SqlType Day Source # | |
SqlType DBKey Source # | |
SqlType a => SqlType (Maybe a) Source # | |
SqlType (Binary ByteString) Source # | |
SqlType (Binary ByteString) Source # | |
(Typeable * a, SqlType a) => SqlType (Vector a) Source # | |
Model a => SqlType (DBRefUnique a) Source # | |
Model a => SqlType (DBRef a) Source # | |
getTypeOid :: Connection -> ByteString -> IO Oid Source #