17

I'm going to build a Nodejs application with Postgresql as back end. I'm not going to use ORMs like Sequelize due to poor documentation and performance problems or any other ORM - ORM is an anti-pattern.

I found node-postgres and pg-promise are candidates in this regard. So, can anyone clarify the scenarios which one of the tools is better than the other or which one is way to go with description, provided that node-postgres has been developing since 2010 and pg-promise since 2015.

Vao Tsun
  • 37,644
  • 8
  • 70
  • 98
Abdisamad Khalif
  • 550
  • 3
  • 17

1 Answers1

31

pg-promise uses node-postgres internally. AFAIK pg-promise is a promise-based set of higher-level APIs on top that you might find useful. I'd recommend using whichever you feel more comfortable with. I'm the author of node-postgres.

vitaly-t
  • 20,421
  • 5
  • 85
  • 117
brianc
  • 2,546
  • 1
  • 16
  • 7
  • 1
    @brainc I know you're the author of node-postgres. I heard that a high-level API is something that is easier to use, is that correct? – Abdisamad Khalif Oct 24 '16 at 14:44
  • 2
    @AbdihafithKhalif that is generally the notion of higher-level, LOL. – vitaly-t Oct 24 '16 at 15:35
  • Ah, Thanks @vitaly-t, any other details you would like to add this answer? – Abdisamad Khalif Oct 24 '16 at 15:40
  • 1
    @AbdihafithKhalif Ahem, I'm the author of [pg-promise](https://github.com/vitaly-t/pg-promise), not that it matters here, but you weren't specific either :) – vitaly-t Oct 25 '16 at 08:32
  • 21
    "So, can anyone clarify the scenarios which one of the tools is better than the other" ? Just quoting the line from the OP that has not been answered – PrimeLens Mar 02 '17 at 16:03
  • 1
    @PrimeLens [pg-promise documents what it adds on top of the base driver](https://github.com/vitaly-t/pg-promise#about). – vitaly-t Nov 30 '20 at 18:50
  • @brianc could you also tell whats the difference between 'node-postgres' and 'pg'? They seem to be same, then why two different npm packages? – ashwin mahajan Apr 25 '21 at 22:05