We built our customer data warehouse all on Postgres

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • postgres_lsp

    A Language Server for Postgres

  • Thank you for turning me on top Cornucopia, it looks awesome. I've used the very similar aiosql in Python, but I hadn't realized there was a Rust analog.

    To tell the truth I've been waiting for postgres_lsp to mature before trying it out, but based on this example [1] I think it does support multiple queries.

    Since it uses a parser extracted from Postgres, the nonstandard syntax would probably trip it up, but there's probably a way to fix that.

    [1] https://github.com/supabase/postgres_lsp/blob/main/example/f...

  • cornucopia

    Generate type-checked Rust from your PostgreSQL.

  • There are multiple queries each separated by ; and on top of each query, there's a comment giving a name to the query (it's more like a header)

    I think the only thing that would require specific support in postgres_lsp is using the :parameter_name syntax for prepared statements [1] (in vanilla Postgres would be something like $1 or $2, but in Cornucopia it is named to aid readability). But, if postgres_lsp is forgiging enough to not choke on that, then it seems completely fit for this use case.

    [0] https://github.com/cornucopia-rs/cornucopia

    [1] https://cornucopia-rs.netlify.app/book/writing_queries/writi...

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • testcontainers-node

    Testcontainers is a NodeJS library that supports tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.

  • pgpkg

    Simplify Postgresql stored procedure development.

  • I wrote something [0]. It lets you write plpgsql functions, views, triggers and casts in a way that can be re-created without migration scripts. It’s a complete work in progress, not production ready, probably has bugs, but I use it daily. It lets me use Postgres as my main development environment.

    It also managea migrations for tables, types, and other stuff, if fully atomic, and lets you write unit tests in SQL (which run inside save points so they don’t affect the database and can run during production deployments). It’s sort of my Swiss Army knife of plpgsql development.

    [0] https://github.com/pgpkg/pgpkg

  • shmig

    Database migration tool written in BASH.

  • I was looking for a way to run migrations across SQLite and Postgres without requiring an unrelated language ecosystem (e.g., Node, Python, Ruby, Java, etc), and discovered Shmig.

    It's pretty great.

    https://github.com/mbucc/shmig

    Would love to see DB unit test infra with the the same values.

  • pg_extractor

    PG Extractor - Advanced PostgreSQL Dump Filter

  • no. it was a private project, and my solution wasn't general enough.

    for functions/views/etc: I've used https://github.com/omniti-labs/pg_extractor

  • Logger

    Logger is used by Oracle developers to instrument their PL/SQL code (by OraOpenSource)

  • Deployment: Upgrade SQL scripts. You already have to do this on any relational DB if you need to alter existing tables. We just also deploy new/updated packages. We trigger them via pipelines.

    Also keep in mind that the logic you deploy in the database is generally not as complex as other software as you mostly just query, modify and write highly structured data.

    But we still run plenty of tests. There is a great unit testing tool for Oracle: utPLSQL [1]. We also spin up databases and run the installation and upgrade scripts on pull-requests.

    [0] https://github.com/OraOpenSource/Logger

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

    WorkOS logo
  • utPLSQL

    Testing Framework for PL/SQL

  • paradedb

    Postgres for Search and Analytics

  • There are definitely ways to cleanly make Postgres scale for analytics. We didn't discuss in this blog, but we will be writing about them in the future. For example, check out what the folks at ParadeDB are doing. https://github.com/paradedb/paradedb. Neon is doing an awesome job separating compute from storage. Supabase contributed foreign data wrappers make it super easy to read from S3 into Postgres. Lots of great work going out there :)

  • postgrest

    REST API for any Postgres database

  • You might find some info in the docs of PostgREST [1] or in the previous discussions on HN about it [2].

    For the versioning, I just have a git repo where I keep every role, schema, table, view, function, trigger, etc. definitions. Every time I change something in the database I first change it in the git repo too to have an history.

    [1] https://postgrest.org

    [2] https://hn.algolia.com/?q=postgrest

    You might find some info in the docs of PostgREST [1] or in the previous discussions on HN about it [2].

    For the versioning, I just have a git repo where I keep every role, schema, table, view, function, trigger, etc. definitions. Every time I change something in the database I first change it in the git repo too to have an history.

    [1] https://postgrest.org

    [2] https://hn.algolia.com/?q=postgrest

  • sqldef

    Idempotent schema management for MySQL, PostgreSQL, and more

  • Thanks! Yeah definitely agree that building out declarative table management for Postgres would be a major effort. A few open source projects I've seen in that area include:

    https://github.com/sqldef/sqldef (Go)

    https://github.com/bikeshedder/tusker (Python but being ported to Rust)

    https://github.com/tyrchen/renovate (Rust)

    https://github.com/blainehansen/postgres_migrator (Rust)

    Some of these are based on parsing SQL, and others are based on running the CREATEs in a temporary location and introspecting the result.

    The schema export side can be especially tricky for Postgres, since it lacks a built-in equivalent to MySQL's SHOW CREATE TABLE. So most of these declarative pg tools shell out to pg_dump, or require the user to do so. But sqldef actually implements CREATE TABLE dumping in pure Golang if I recall correctly, which is pretty cool.

    There's also the question of implementing the table diff logic from scratch, vs shelling out to another tool or using a library. For the latter path, there's a nice blog post from Supabase about how they evaluated the various options: https://supabase.com/blog/supabase-cli#choosing-the-best-dif...

  • tusker

    PostgreSQL migration management tool

  • Thanks! Yeah definitely agree that building out declarative table management for Postgres would be a major effort. A few open source projects I've seen in that area include:

    https://github.com/sqldef/sqldef (Go)

    https://github.com/bikeshedder/tusker (Python but being ported to Rust)

    https://github.com/tyrchen/renovate (Rust)

    https://github.com/blainehansen/postgres_migrator (Rust)

    Some of these are based on parsing SQL, and others are based on running the CREATEs in a temporary location and introspecting the result.

    The schema export side can be especially tricky for Postgres, since it lacks a built-in equivalent to MySQL's SHOW CREATE TABLE. So most of these declarative pg tools shell out to pg_dump, or require the user to do so. But sqldef actually implements CREATE TABLE dumping in pure Golang if I recall correctly, which is pretty cool.

    There's also the question of implementing the table diff logic from scratch, vs shelling out to another tool or using a library. For the latter path, there's a nice blog post from Supabase about how they evaluated the various options: https://supabase.com/blog/supabase-cli#choosing-the-best-dif...

  • renovate

    Renovate is a CLI tool to help you to work on Postgres SQL migration easily. (by tyrchen)

  • Thanks! Yeah definitely agree that building out declarative table management for Postgres would be a major effort. A few open source projects I've seen in that area include:

    https://github.com/sqldef/sqldef (Go)

    https://github.com/bikeshedder/tusker (Python but being ported to Rust)

    https://github.com/tyrchen/renovate (Rust)

    https://github.com/blainehansen/postgres_migrator (Rust)

    Some of these are based on parsing SQL, and others are based on running the CREATEs in a temporary location and introspecting the result.

    The schema export side can be especially tricky for Postgres, since it lacks a built-in equivalent to MySQL's SHOW CREATE TABLE. So most of these declarative pg tools shell out to pg_dump, or require the user to do so. But sqldef actually implements CREATE TABLE dumping in pure Golang if I recall correctly, which is pretty cool.

    There's also the question of implementing the table diff logic from scratch, vs shelling out to another tool or using a library. For the latter path, there's a nice blog post from Supabase about how they evaluated the various options: https://supabase.com/blog/supabase-cli#choosing-the-best-dif...

  • postgres_migrator

    A postgres migration generator and runner that uses raw declarative sql.

  • Thanks! Yeah definitely agree that building out declarative table management for Postgres would be a major effort. A few open source projects I've seen in that area include:

    https://github.com/sqldef/sqldef (Go)

    https://github.com/bikeshedder/tusker (Python but being ported to Rust)

    https://github.com/tyrchen/renovate (Rust)

    https://github.com/blainehansen/postgres_migrator (Rust)

    Some of these are based on parsing SQL, and others are based on running the CREATEs in a temporary location and introspecting the result.

    The schema export side can be especially tricky for Postgres, since it lacks a built-in equivalent to MySQL's SHOW CREATE TABLE. So most of these declarative pg tools shell out to pg_dump, or require the user to do so. But sqldef actually implements CREATE TABLE dumping in pure Golang if I recall correctly, which is pretty cool.

    There's also the question of implementing the table diff logic from scratch, vs shelling out to another tool or using a library. For the latter path, there's a nice blog post from Supabase about how they evaluated the various options: https://supabase.com/blog/supabase-cli#choosing-the-best-dif...

  • SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
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