Open akiroz opened 7 years ago
I think it is a good idea to have a promise interface. I'd suggest not roll out our own implementation though. This is a good package to get started: https://github.com/vitaly-t/pg-promise
Hmm... should we ship this package in the SDK alongside the existing https://github.com/brianc/node-postgres one? Maybe mark skygearCloud.poolConnect
as @deprecated
?
The pg-promise
depends on node-postgres
so the answer is yes, we will have pg-promise
and node-postgres
as dependencies.
As for poolConnect
, I think it is okay as is. If everyone uses the promise way to connect DB and no one uses poolConnect
, we can decide to deprecate poolConnect
at that time.
The pg-promise depends on node-postgres so the answer is yes, we will have pg-promise and node-postgres as dependencies.
pg-promise
includes he right version of node-postgres
, so do not include the latter as a dependency ;)
Usage:
Implementation: