Hacker News new | ask | show | jobs
by pharmakom 1213 days ago
You can unit test SQL by spinning up Docker containers.

You should just write SQL for the database you are using (e.g. PostgreSQL). Switching databases without changing queries is unrealistic anyways.

I agree with your other points, but I am yet to see a layer above SQL that improves on them enough to justify its additional complexity.

1 comments

I know a team who used JooQ (code-generated query builder for Java) to generate SQL which worked on both Postgres and Oracle and worked well enough that they could support both in production (Oracle for top end perf, Postgres for everything else). There were certain places where they had to switch on SQL format, but over years they felt comfortable enough only unit testing on one kind of database.