Closed akheron closed 5 years ago
Thanks again @akheron!
Some notes (quotes from chat) for myself so I know what I should do before release:
Update docs
Test paulyoung/literate-purescript
before updating README docs
I think those docstrings should be revisited at some point, because some things might not be correct anymore
Also, explaining runExceptT and pointing to its documentation should be done somewhere. Probably in README and near type PG a = ExceptT PGError Aff a
I pushed an update for some docstrings.
F***! The whole review is broken as I've commented above lines which I was interested in and in this form this review is completely unreadable. Probably I have to rewrite it tomorrow ;-)
@akheron Could you read my comments using Files changed
tab. All my comments are above the code line of interest ;-)
Thanks a lot @akheron! I'm going to try to compile/test examples from README and finally make a release ;-)
@akheron , @Kamirus
I've migrated Thimoteus/literate-purescript
and related libs and I'm waiting for its release (possibly also npm
"executable" release), so I can update docs, package.json etc. and make proper release. I hope it is going to happen in the next few days. If not I'm going to make release anyway.
Add
PGError
type to model different errors that can happen when querying PostgreSQL. The mapping from SQLSTATE to error was inspired bypsycopg2
.Run all actions in a new
PG
monad, which is justAff
stacked withExceptT 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
andcommand
by reusingffiUnsafeQuery
in both cases.Fixes #25