Copyright | (c) 2011 MailRank Inc. |
---|---|
License | BSD3 |
Maintainer | José Lorenzo Rodríguez |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
Language | Haskell2010 |
The Result
typeclass, for converting a single value in a row
returned by a SQL query into a more useful Haskell representation.
A Haskell numeric type is considered to be compatible with all
MySQL numeric types that are less accurate than it. For instance,
the Haskell Double
type is compatible with the MySQL Long
type
because it can represent a Long
exactly. On the other hand, since
a Double
might lose precision if representing a LongLong
, the
two are not considered compatible.
- data ResultError
- = Incompatible { }
- | ConversionFailed { }
- class Result a where
Documentation
data ResultError Source #
Exception thrown if conversion from a SQL value to a Haskell value fails.
A type that may be converted from a SQL type.
convert :: ColumnDef -> MySQLValue -> a Source #