Commit Graph

40 Commits

Author SHA1 Message Date
Tomasz Rybarczyk
343ea87283 Upgarde to purs-15 2023-02-25 19:10:41 +01:00
Tomasz Rybarczyk
0019baea2f Fix warnings. Add trivial helpers for queries with no input. 2021-11-09 10:38:12 +01:00
Tomasz Rybarczyk
3a1fa77691 Minor fixes 2021-11-09 09:16:11 +01:00
Tomasz Rybarczyk
7e03b445a6 Carry original exception instance in our error report 2021-11-09 09:02:46 +01:00
Tomasz Rybarczyk
b102e8ac8f Make Connection a newtype 2021-11-09 09:02:46 +01:00
Tomasz Rybarczyk
4c738fe72f s/Connection/Client/ + s/DBHandle/Connection/ 2021-11-09 09:02:46 +01:00
Tomasz Rybarczyk
76a5b41f3e Introduce pool based queries. Move Aff API to separate submodule. 2021-11-09 09:02:39 +01:00
Jordan Martinez
7e34a2a59a Replace removed unsafeStringify with local version 2021-05-12 04:36:49 -07:00
Tomasz Rybarczyk
26bb7ee471 Separate Pool module. Make test database configurable. 2020-11-09 15:54:23 +01:00
isaac tovsky
332e6f60c0 fix record indentation 2020-05-21 17:27:22 +02:00
isaac tovsky
7e1d5e2248 format records appropriately 2020-04-30 10:57:33 +02:00
isaac tovsky
c45e9e80eb parse from postgres uri to ConnectionPool config 2020-04-13 22:58:24 +02:00
Tomasz Rybarczyk
0df63e841d Handle Argonaut.Json 2019-11-10 15:27:24 +01:00
Kamirus
6ce8b99ecd README update; withConnection and withTransaction flipped parameter 2019-08-30 12:15:05 +02:00
Kamirus
ec1f6e447d drop PG type and change functions in PG module; some test changes; no README fix 2019-08-28 17:00:36 +02:00
Tomasz Rybarczyk
df492b108d Improve test debug log 2018-12-22 19:47:31 +01:00
Tomasz Rybarczyk
a6deace1cb Make tests pass 2018-12-16 18:35:58 +01:00
Tomasz Rybarczyk
3e074d1c0c Make tests pass 2018-12-06 20:14:08 +01:00
paluh
89e3282ba6
Merge branch 'master' into master 2018-12-03 19:10:02 +01:00
Petri Lehtinen
55d3ddd1bb Address test comments 2018-11-30 08:31:18 +02:00
Kamirus
e9d9e4ea0f nested tuple with one element: Tuple a Unit; and test 2018-11-16 13:46:19 +01: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
85e01d38fe README: add query usage example 2018-10-21 03:56:11 +02:00
Tomasz Rybarczyk
8683419e85 Allow nested tuples to be used as query rows 2018-10-21 03:20:58 +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
13eb0ef583 Cosmetics 2018-10-08 16:08:30 +02:00
Tomasz Rybarczyk
9ae93cede4 Add test for DELETE query which returns removed rows. 2018-10-08 15:57:33 +02:00
Kamirus
248058bf2f sql value for Object 2018-09-06 12:15:05 +02:00
Kamirus
0a01eec77b remove datetime 2018-09-05 18:13:49 +02:00
Kamirus
eadcc58da1 type support for jsdate 2018-09-05 09:59:30 +02:00
Kamirus
9ed14c1bb5 tests for 0.12 2018-09-04 15:30:02 +02:00
Tomasz Rybarczyk
ed2ce9e592 Handle date with parsing on PS side 2018-04-22 18:15:43 +02:00
Tomasz Rybarczyk
bb493e5983 Migrate tests to purescript-test-unit + Instant fetching + test 2018-04-22 16:47:07 +02:00
Tomasz Rybarczyk
9c006c72ce Handle numeric values using purescript-decimals 2018-04-21 13:12:20 +02:00
Tomasz Rybarczyk
f6f3328149 Improve coding style a bit 2017-12-05 22:12:01 +01:00
Tomasz Rybarczyk
6a0f231eb7 Upgrade to purescript-aff 4.0.0 2017-12-04 22:43:36 +01:00
rightfold
ac05e01a97
Test withTransaction 2017-06-03 13:59: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
rightfold
64c84351ec
Add tests 2017-05-06 17:09:05 +02:00