Commit Graph

67 Commits

Author SHA1 Message Date
isaac tovsky
c45e9e80eb parse from postgres uri to ConnectionPool config 2020-04-13 22:58:24 +02:00
Serhii Khoma
a01442a2c8
feat: Database.PostgreSQL -> ConnectResult type -> export 2019-12-22 13:51:22 +02:00
Serhii Khoma
71c12d616b
feat: Database.PostgreSQL -> export connect function 2019-12-22 13:48:48 +02:00
Serhii Khoma
e74e715266
refactor: Database.PostgreSQL.PG -> remove unused type alias Database 2019-12-12 11:08:59 +02:00
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
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
Jordan Martinez
fa843a350f Update API due to breaking change 2019-07-27 13:22:14 -07:00
Tomasz Rybarczyk
45d6356fd8 Drop problematic newtype instances and provide helpers instead 2019-07-05 16:42:00 +02:00
Tomasz Rybarczyk
351a91af68 Default to newtype in *SQLValue classes instance chains. 2019-07-05 16:17:04 +02:00
Tomasz Rybarczyk
600c643738 Hoist to correct monad in PG.hoist* 2018-12-22 19:52:37 +01:00
Tomasz Rybarczyk
bd055928ae More polymorphic hoist functions 2018-12-22 18:32:24 +01:00
Tomasz Rybarczyk
07e1c0924b More fine grained hoist function 2018-12-16 20:02:24 +01:00
Tomasz Rybarczyk
a04090da0b Fix coding style 2018-12-16 18:58:02 +01:00
Tomasz Rybarczyk
280320b553 Add hoistPG function 2018-12-16 18:55:37 +01:00
Tomasz Rybarczyk
a6deace1cb Make tests pass 2018-12-16 18:35:58 +01:00
Tomasz Rybarczyk
6f2b198d02 Move PG into separate module 2018-12-16 18:05:49 +01:00
Tomasz Rybarczyk
87d6f7fc95 Drop ExceptT from functions 2018-12-09 21:50:13 +01:00
Tomasz Rybarczyk
111790af84 Let newPool run in Effect monad 2018-12-06 20:08:48 +01:00
paluh
89e3282ba6
Merge branch 'master' into master 2018-12-03 19:10:02 +01:00
Petri Lehtinen
de6404b82f Make ffiUnsafeQuery better typed, fix indentation 2018-11-30 08:35:29 +02:00
Petri Lehtinen
331b681bbf Revisit docstrings 2018-11-19 08:25:59 +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
Petri Lehtinen
ab46bbf47f Fix purs bundle output
`purs bundle` (used by e.g. `pulp build`) fails to output `DATE_OID`
in the output bundle due to some dead code elimination bug/feature, so
an app using `purescript-postgresql-client` fails to start.

Remove `DATE_OID` and use its value inline instead.
2018-10-22 12:46:51 +03:00
Tomasz Rybarczyk
85e01d38fe README: add query usage example 2018-10-21 03:56:11 +02:00
Tomasz Rybarczyk
751ced6d76 Make most fields optional in PoolConfiguration 2018-10-21 03:24:58 +02:00
Tomasz Rybarczyk
8683419e85 Allow nested tuples to be used as query rows 2018-10-21 03:20:58 +02:00
Tomasz Rybarczyk
c0ac46c00a Improve command docs 2018-10-20 22:34:00 +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
Kamirus
248058bf2f sql value for Object 2018-09-06 12:15:05 +02:00
Kamirus
eadcc58da1 type support for jsdate 2018-09-05 09:59:30 +02:00
adamczykm
bead426f14 Migrate to Purescript 0.12. 2018-07-15 19:51:17 +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
paluh
63c21fb220
Merge pull request #15 from abhin4v/patch-1
Makes `Array Foreign` an instance of ToSQLRow
2018-04-21 12:15:15 +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
Abhinav Sarkar
4178f9005e Makes Array Foreign an instance of ToSQLRow
For when the user wants to convert the values to foreign by themselves.
2017-10-06 19:03:22 +05:30
rightfold
13d0fcfb8e
Formatting 2017-06-13 11:49:07 +02:00
Stéphane Le Dorze
49a2465e5f Update Value.purs
Add support for toSQLValue for list an array
2017-06-08 18:05:58 +02:00
rightfold
35f9da6f50
Add Foreign instances 2017-06-08 13:56:21 +02: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
552e59ad92
Use more descriptive error messages for invalid row structures 2017-04-18 14:33:43 +02:00
rightfold
e58c71e26c
Add FromSQLValue Number 2017-04-18 14:19:57 +02:00