| Copyright | (c) Ole Krüger 2015-2016 |
|---|---|
| License | BSD3 |
| Maintainer | Ole Krüger <ole@vprsm.de> |
| Safe Haskell | None |
| Language | Haskell2010 |
Database.PostgreSQL.Store.Errand
Contents
Description
- data ErrandError
- data ErrorCode
- data Errand a
- runErrand :: Connection -> Errand a -> IO (Either ErrandError a)
- execute :: Query a -> Errand Result
- execute' :: Query a -> Errand Int
- query :: Entity a => Query a -> Errand [a]
- queryWith :: Query a -> RowParser a -> Errand [a]
- insert :: TableEntity a => a -> Errand Bool
- insertMany :: TableEntity a => [a] -> Errand Int
- deleteAll :: TableEntity a => proxy a -> Errand Int
- findAll :: TableEntity a => Errand [a]
- create :: TableEntity a => proxy a -> Errand ()
Errand
data ErrandError Source #
Error during errand
Constructors
| NoResult | No |
| UserError String | A user has thrown an error. |
| ExecError ExecStatus ErrorCode ByteString ByteString ByteString | Query execution failed. |
| ParseError RowError | Result processing failed. |
Instances
Error codes
An interaction with the database
runErrand :: Connection -> Errand a -> IO (Either ErrandError a) Source #
Run an errand.
queryWith :: Query a -> RowParser a -> Errand [a] Source #
Execute a query and process its result set using the provided RowParser.
insertMany :: TableEntity a => [a] -> Errand Int Source #
Insert many rows into a Table.