Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data QueryResult t = forall row.FromRow row => QueryResult {
- qrSQL :: !SomeSQL
- qrBackendPid :: !BackendPid
- qrResult :: !(ForeignPtr PGresult)
- qrFromRow :: !(row -> t)
- mkQueryResult :: (FromRow t, IsSQL sql) => sql -> BackendPid -> ForeignPtr PGresult -> QueryResult t
- ntuples :: QueryResult t -> Int
- nfields :: QueryResult t -> Int
- foldrImpl :: (HasCallStack, Monad m) => Bool -> (t -> acc -> m acc) -> acc -> QueryResult t -> m acc
- foldlImpl :: (HasCallStack, Monad m) => Bool -> (acc -> t -> m acc) -> acc -> QueryResult t -> m acc
Documentation
data QueryResult t Source #
Representation of a query result. Provides Functor
and Foldable
instances for data transformation and
extraction appropriately.
forall row.FromRow row => QueryResult | |
|
Instances
mkQueryResult :: (FromRow t, IsSQL sql) => sql -> BackendPid -> ForeignPtr PGresult -> QueryResult t Source #
ntuples :: QueryResult t -> Int Source #
Extract number of returned tuples (rows) from query result.
nfields :: QueryResult t -> Int Source #
Extract number of returned fields (columns) from query result.
Implementation
foldrImpl :: (HasCallStack, Monad m) => Bool -> (t -> acc -> m acc) -> acc -> QueryResult t -> m acc Source #
foldlImpl :: (HasCallStack, Monad m) => Bool -> (acc -> t -> m acc) -> acc -> QueryResult t -> m acc Source #