RegreSQL: Regression Testing for PostgreSQL Queries

(boringsql.com)

40 points | by radimm 2 hours ago ago

7 comments

  • mbvisti 7 minutes ago ago

    I have nothing to add but this looks cool! Will definitely check it out :)

  • h1fra an hour ago ago

    Interesting. Perf regression can happen locally but they mostly happen in prod when data change in volume or in shape, can this run safely on a prod db?

    • radimm an hour ago ago

      The primary direction is to make RegreSQL part of CI/CD pipelines. In theory in can be run against production DB, but I believe it needs much more work to provide real value there. Thank you for the comment!

    • null_deref an hour ago ago

      Yeah my question exactly, another one from me would be will the best practice be to run it periodically?

  • WilcoKruijer an hour ago ago

    It's pretty terrible how poorly developers test their database queries. This looks like a great step in the right direction. I think how the ORM story in RegreSQL develops is crucial. The SQLAlchemy integration looks interesting, but at the same time super specific. There are a million ways to generate SQL statements and ORMs are just one of them. A question that comes to mind is how will you handle interactive transactions? I'd say most complexity in queries comes from the back-and-forth between database and server. Is that out of scope?

    Would also be fun if you could support PGLite [0], that's what I've been using to write "unit" tests connected to a "real" database.

    [0] https://pglite.dev/

    • radimm an hour ago ago

      OP here - I do agree some of the problems that come with SQL/ORM queries are pretty horrendous and that's exactly where I would like RegreSQL going. For now I can't promise the particular direction, but comments like this are the reason why I pushed myself to release it and keep it beyond my own playground. Thank you!

    • jci an hour ago ago

      My goto for this lately has been ephemeralpg [0] and pgTAP [1]. It’s been pretty great

      [0] https://github.com/eradman/ephemeralpg [1] https://github.com/theory/pgtap