New to PostgreSQL - Best way to use it?

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
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • node-pg-migrate

    Node.js database migration management for Postgresql

    b) How you will manage schema migrations: every time you change tables, columns, foreign keys, every time you create or modify stored procedures, and so on, you need to do this through a migration. Here I'm at loss to recommend anything specific, but if you went with Prisma, I would read their docs and use whatever they are recommending you (if they actually recommend something). If you want something more neutral but still in the node ecosystem, node-pg-migrate might be the winner here? I'm not sure.

  • Prisma

    Next-generation ORM for Node.js & TypeScript | PostgreSQL, MySQL, MariaDB, SQL Server, SQLite, MongoDB and CockroachDB

    a) How will you do your queries from node. There's two, actually three approaches. First, writing SQL directly in your code (which I think is the one you should take), and in this case you would use node-postgres. The great thing about this is that you can try out some query in DBeaver or in psql (the command line) or some other tool and when it's right, just copy to your node.js code. Or conversely, if a query in your program isn't right, you can debug it in psql / DBeaver with some test inputs. Anyway another approach would be to use an ORM, and for this one I think the most popular in node land is Prisma (but I may be wrong). And then there's a middle ground which is like just writing queries, but instead of using sql syntax, you write it with JS methods and get them converted to SQL using a query builder. A nice query builder would be knexjs, and actually it's the kind of thing I would use myself (but I don't program in node). (Prisma itself has a comparison on those 3 approaches (actually, the whole Prisma documentation is pretty good))

  • 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.

  • refinery

    Powerful SQL migration toolkit for Rust. (by rust-db)

    What I personally use here is Refinery, but it's within the Rust ecosystem. It lets you write your migrations in pure SQL - which is what I prefer - but still requires about 5 lines of boilerplate Rust code.

  • PostgreSQL

    PostgreSQL client for node.js.

    a) How will you do your queries from node. There's two, actually three approaches. First, writing SQL directly in your code (which I think is the one you should take), and in this case you would use node-postgres. The great thing about this is that you can try out some query in DBeaver or in psql (the command line) or some other tool and when it's right, just copy to your node.js code. Or conversely, if a query in your program isn't right, you can debug it in psql / DBeaver with some test inputs. Anyway another approach would be to use an ORM, and for this one I think the most popular in node land is Prisma (but I may be wrong). And then there's a middle ground which is like just writing queries, but instead of using sql syntax, you write it with JS methods and get them converted to SQL using a query builder. A nice query builder would be knexjs, and actually it's the kind of thing I would use myself (but I don't program in node). (Prisma itself has a comparison on those 3 approaches (actually, the whole Prisma documentation is pretty good))

  • Knex

    A query builder for PostgreSQL, MySQL, CockroachDB, SQL Server, SQLite3 and Oracle, designed to be flexible, portable, and fun to use.

    a) How will you do your queries from node. There's two, actually three approaches. First, writing SQL directly in your code (which I think is the one you should take), and in this case you would use node-postgres. The great thing about this is that you can try out some query in DBeaver or in psql (the command line) or some other tool and when it's right, just copy to your node.js code. Or conversely, if a query in your program isn't right, you can debug it in psql / DBeaver with some test inputs. Anyway another approach would be to use an ORM, and for this one I think the most popular in node land is Prisma (but I may be wrong). And then there's a middle ground which is like just writing queries, but instead of using sql syntax, you write it with JS methods and get them converted to SQL using a query builder. A nice query builder would be knexjs, and actually it's the kind of thing I would use myself (but I don't program in node). (Prisma itself has a comparison on those 3 approaches (actually, the whole Prisma documentation is pretty good))

  • nhost

    The Open Source Firebase Alternative with GraphQL.

    What are you missing with Supabase? You might want to check what we're building at Nhost (https://nhost.io/). We also use Postgres as the database.

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