generated from tpl/purs
Add AUTHORS file
This commit is contained in:
parent
3e074d1c0c
commit
71bbf44227
16
README.md
16
README.md
@ -27,12 +27,18 @@ import Effect.Class (liftEffect)
|
|||||||
import Test.Assert (assert)
|
import Test.Assert (assert)
|
||||||
```
|
```
|
||||||
|
|
||||||
The whole API for interaction with postgres is performed asynchronously in `Aff`. To be honest
|
The whole API for interaction with PostgreSQL is performed asynchronously in `Aff`
|
||||||
it is `type PG a = ExceptT PGError Aff a` so you can easily catch database related errors in
|
(the only function which runs in plain `Effect` is `newPool`). To be honest we
|
||||||
a sane (read typed) manner. The only function which is done in plain `Effect` is `newPool`.
|
are wrapping `Aff` in `ExceptT` so you can easily handle database related errors
|
||||||
|
in a sane manner:
|
||||||
|
|
||||||
Don't be scarred you can turn `PG a` into `Aff (Either PGError a)` just running single function
|
```purescript
|
||||||
`runExceptT`.
|
type PG a = ExceptT PGError Aff a
|
||||||
|
```
|
||||||
|
|
||||||
|
Don't be scarred by this `PG` type alias. It just wraps every db result in `Either`.
|
||||||
|
You can turn `PG a` into the `Aff (Either PGError a)` by just running a single
|
||||||
|
function - `runExceptT`.
|
||||||
|
|
||||||
We assume here that postgres is running on a standard local port
|
We assume here that postgres is running on a standard local port
|
||||||
with `ident` authentication so configuration can be nearly empty (`defaultPoolConfiguration`).
|
with `ident` authentication so configuration can be nearly empty (`defaultPoolConfiguration`).
|
||||||
|
Loading…
Reference in New Issue
Block a user