Commit Graph

15 Commits

Author SHA1 Message Date
Tomasz Rybarczyk
0df63e841d Handle Argonaut.Json 2019-11-10 15:27:24 +01:00
Tomasz Rybarczyk
67960570a5 Drop pg import from Value.js so typeclasses are accessible for frontend JS. 2019-09-30 11:11:05 +02:00
Petri Lehtinen
de6404b82f Make ffiUnsafeQuery better typed, fix indentation 2018-11-30 08:35:29 +02:00
Petri Lehtinen
10a868b166 Implement monadic error handling, get rid of JavaScript exceptions
- Add `PGError` type to model different errors that can happen when
  querying PostgreSQL. The mapping from SQLSTATE to error was inspired
  by `psycopg2`.

- Run all actions in a new `PG` monad, which is just `Aff` stacked
  with `ExceptT PGError` to provide monadic error handling. Any errors
  caused by database access are not thrown as JavaScript exceptions
  anymore.

- While at it, remove some duplication between `query` and `command`
  by reusing `ffiUnsafeQuery` in both cases.
2018-11-16 13:40:30 +02:00
Tomasz Rybarczyk
2da6a3a767 Add command function returning command tag value of a query 2018-10-20 22:34:00 +02:00
Petri Lehtinen
9eb66e7068 Avoid UnhandledPromiseRejectionWarning on integrity errors 2018-10-12 08:01:34 +03:00
Tomasz Rybarczyk
6a0f231eb7 Upgrade to purescript-aff 4.0.0 2017-12-04 22:43:36 +01:00
rightfold
feadfc2694
Use makeAff instead of importing PS in FFI code 2017-06-03 13:43:30 +02:00
rightfold
c1f9391701
Remove tuple machinery in favour of row types
These are more efficient and provide better error messages.
2017-06-03 13:27:14 +02:00
William Wolf
862257df9b Update for 0.11 2017-04-20 01:19:05 -07:00
rightfold
efd988b640
Pass error to done function 2017-03-04 23:09:41 +01:00
rightfold
c14897d6ed Support Instant serialization 2017-01-30 11:12:55 +01:00
rightfold
4c1577c2b9 Return cancelers from Aff actions 2017-01-27 09:45:47 +01:00
rightfold
ada69d008a Add ByteString support
Fixes #5.
2017-01-07 15:30:31 +01:00
rightfold
50b88ebbf1 Extract from dinote 2016-12-22 19:12:38 +01:00