Motivation
The current impl has us connect to a local PostgreSQL server as part of a connection Pool. This is abstracted behind the PostgresAdaptater class. While this is fine for simple queries, there currently isn't any good way to make more complex requests to the db (transactions in particular). It seems like a lot of this could be simplified using more of the core builtins provided by node-postgress.
Request
The following could be streamlined:
Scope
Are you willing to help with this issue?
Yes!
Motivation
The current impl has us connect to a local PostgreSQL server as part of a connection Pool. This is abstracted behind the
PostgresAdaptaterclass. While this is fine for simple queries, there currently isn't any good way to make more complex requests to the db (transactions in particular). It seems like a lot of this could be simplified using more of the core builtins provided bynode-postgress.Request
The following could be streamlined:
node-postgresswill already load pg env variables automatically to set up a connection: we should not need to set those up programatically.PostgresAdapter.PostgresAdapterwith a singleton instance ofPoolas it does not make sense to create multiple pooled connections to the db.Scope
PostgresAdapterin favor of more direct usage ofnode-postgres. Error handling would still be central todatabase.tsbut we would have no abstraction around different query type and would just be passing raw SQL and arguments. This has the upside that we would no longer be limited to a very specific set of elementary queries.PostgesAdapter. This should make individual queries clearer.Are you willing to help with this issue?
Yes!