mirror of
https://github.com/nikita-volkov/hasql.git
synced 2024-11-22 01:52:45 +03:00
Implement "listTx"
This commit is contained in:
parent
40326f33e0
commit
0015dd5501
@ -7,7 +7,6 @@
|
||||
* The transaction mode is now extended to support uncommittable transactions with the `TxWriteMode` type.
|
||||
* All `Tx` functions are now appended with a "Tx" suffix.
|
||||
* `q` statement quasi-quoter is now renamed to more meaningful `stmt`.
|
||||
* There is no `list` transaction any more. Instead there is `vectorTx`.
|
||||
* The `Statement` type is renamed to `Stmt` and is now exported from the main API.
|
||||
* `RowParser` is now uninstantiable. This enforces the idiomatic usage of the library.
|
||||
* Statement templates now support UTF-8.
|
||||
|
@ -34,6 +34,7 @@ module Hasql
|
||||
unitTx,
|
||||
countTx,
|
||||
maybeTx,
|
||||
listTx,
|
||||
vectorTx,
|
||||
streamTx,
|
||||
|
||||
@ -264,6 +265,13 @@ maybeTx :: RowParser.RowParser c r => Bknd.Stmt c -> Tx c s (Maybe r)
|
||||
maybeTx =
|
||||
fmap (fmap Vector.unsafeHead . mfilter (not . Vector.null) . Just) . vectorTx
|
||||
|
||||
-- |
|
||||
-- Execute a @SELECT@ statement,
|
||||
-- and produce a list of results.
|
||||
listTx :: RowParser.RowParser c r => Bknd.Stmt c -> Tx c s [r]
|
||||
listTx =
|
||||
fmap toList . vectorTx
|
||||
|
||||
-- |
|
||||
-- Execute a @SELECT@ statement,
|
||||
-- and produce a vector of results.
|
||||
|
Loading…
Reference in New Issue
Block a user