What package do you guys use for postgres in node js?

This page summarizes the projects mentioned and recommended in the original post on /r/PostgreSQL

Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • slonik

    A Node.js PostgreSQL client with runtime and build time type safety, and composable SQL.

    Lately though I've been using slonik (and @slonik/migrator) for lighter setups -- it very much gets out of your way so if you want to do some simple queries really quickly and don't want any ceremony it's a nice light option.

  • TypeORM

    ORM for TypeScript and JavaScript. Supports MySQL, PostgreSQL, MariaDB, SQLite, MS SQL Server, Oracle, SAP Hana, WebSQL databases. Works in NodeJS, Browser, Ionic, Cordova and Electron platforms.

    typeorm is the best IMO, good support for different paradigms (Repository pattern, entity-based, query building, raw queries), migration support (wiring together your mini migration framework migration code isn't hard but is likely a waste of time). Working with composite types takes a little bit of work but is doable).

  • SurveyJS

    Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.

  • slonik-tools

    PostgreSQL🤝TypeScript monorepo. SQL client/admin UI/smart migrator/type generator/schema inspector

    Lately though I've been using slonik (and @slonik/migrator) for lighter setups -- it very much gets out of your way so if you want to do some simple queries really quickly and don't want any ceremony it's a nice light option.

  • PostgreSQL

    PostgreSQL client for node.js.

    Depends on what you want to do, the packages you suggest have different purposes. For just executing your own SQL code, use pg: https://node-postgres.com/

  • pg-promise

    PostgreSQL interface for Node.js

    Is there any difference to the named parameters already supported? https://github.com/vitaly-t/pg-promise#named-parameters

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts