Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- runQuery :: Default FromFields fields haskells => Connection -> Select fields -> IO [haskells]
- runQueryFold :: Default FromFields fields haskells => Connection -> Select fields -> b -> (b -> haskells -> IO b) -> IO b
- queryRunnerColumn :: (Column a' -> Column a) -> (b -> b') -> FromField a b -> FromField a' b'
- runQueryExplicit :: FromFields fields haskells -> Connection -> Select fields -> IO [haskells]
- runQueryFoldExplicit :: FromFields fields haskells -> Connection -> Select fields -> b -> (b -> haskells -> IO b) -> IO b
- declareCursor :: Default FromFields fields haskells => Connection -> Select fields -> IO (Cursor haskells)
- declareCursorExplicit :: FromFields fields haskells -> Connection -> Select fields -> IO (Cursor haskells)
- closeCursor :: Cursor fields -> IO ()
- foldForward :: Cursor haskells -> Int -> (a -> haskells -> IO a) -> a -> IO (Either a a)
- data Cursor haskells
- data FromFields columns haskells
- data FromField pgType haskellType
- type QueryRunner = FromFields
- type QueryRunnerColumn = FromField
- type QueryRunnerColumnDefault = DefaultFromField
- fieldQueryRunnerColumn :: FromField haskell => FromField pgType haskell
- fieldParserQueryRunnerColumn :: FieldParser haskell -> FromField pgType haskell
Documentation
runQuery :: Default FromFields fields haskells => Connection -> Select fields -> IO [haskells] Source #
Deprecated: Use runSelect
instead. runQuery
will be removed in 0.8.
runQueryFold :: Default FromFields fields haskells => Connection -> Select fields -> b -> (b -> haskells -> IO b) -> IO b Source #
Deprecated: Use runSelectFold
instead. runQueryFold
will be removed in 0.8.
queryRunnerColumn :: (Column a' -> Column a) -> (b -> b') -> FromField a b -> FromField a' b' Source #
Deprecated: Use unsafeFromField
instead. queryRunnerColumn
will be removed in 0.8.
runQueryExplicit :: FromFields fields haskells -> Connection -> Select fields -> IO [haskells] Source #
Deprecated: Use runSelectExplict
instead. Will be removed in 0.8.
runQueryFoldExplicit :: FromFields fields haskells -> Connection -> Select fields -> b -> (b -> haskells -> IO b) -> IO b Source #
Deprecated: Use runSelectFoldExplict
instead. Will be deprecated in 0.8.
declareCursor :: Default FromFields fields haskells => Connection -> Select fields -> IO (Cursor haskells) Source #
Deprecated: Use declareCursor
instead. Will be removed in 0.8.
declareCursorExplicit :: FromFields fields haskells -> Connection -> Select fields -> IO (Cursor haskells) Source #
Deprecated: Use declareCursorExplicit
instead. Will be removed in 0.8.
closeCursor :: Cursor fields -> IO () Source #
Deprecated: Use closeCursor
instead. Will be removed in 0.8.
foldForward :: Cursor haskells -> Int -> (a -> haskells -> IO a) -> a -> IO (Either a a) Source #
Deprecated: Use foldForward
instead. Will be removed in 0.8.
Datatypes
data FromFields columns haskells Source #
A FromFields
specifies how to convert Postgres values (fields
)
into Haskell values (haskells
). Most likely you will never need
to create on of these or handle one directly. It will be provided
for you by the Default
FromFields
instance.
"FromFields
fields
haskells
" corresponds to
postgresql-simple's "RowParser
haskells
". "Default
FromFields
columns
haskells
" corresponds to
postgresql-simple's "FromRow
haskells
".
Instances
data FromField pgType haskellType Source #
A FromField
sqlType
haskellType
encodes how to turn
a value of Postgres type sqlType
into a value of Haskell type
haskellType
. For example a value of type FromField
SqlText
String
encodes how to turn a SqlText
result from the
database into a Haskell String
.
"FromField
sqlType
haskellType
" corresponds to
postgresql-simple's "FieldParser
haskellType
".
Instances
type QueryRunner = FromFields Source #
type QueryRunnerColumn = FromField Source #
Creating new QueryRunnerColumn
s
fieldQueryRunnerColumn :: FromField haskell => FromField pgType haskell Source #
fieldParserQueryRunnerColumn :: FieldParser haskell -> FromField pgType haskell Source #