HackerReposA FIELD GUIDE TO OPEN SOURCE
ProSponsor the shelf♧ 0
← Back to top all-time
peterldowns
pgtestdb
Go2023–2026
peterldowns / pgtestdb

pgtestdb

quickly run tests in their own temporary, isolated, postgres databases

4Distinct people
13Mentions
0Explicit recommenders
517GitHub stars
REPOSITORY AT A GLANCE

What to know before exploring

What it is

quickly run tests in their own temporary, isolated, postgres databases

GitHub

Where it is used

No documented product use has been verified yet.

What people are saying

No recommendation phrase was found in the indexed comments.

No classified warning is attached to this page. Read the discussions before treating silence as approval.

Also in these discussions

Mentioned in the same Hacker News threads. That is not proof they are substitutes.

This week on Hacker News

Nov 8–Nov 15 UTC · Direct repository links and separately labeled related project stories. Indexed through 11/15/2026, 5:05:26 PM UTC.

No direct repository links were found in the indexed HN discussions over the past seven days. Older discussions are available below.

Mentions over time

HN mentions by year13 dated mentions

Observed mentions: 2023-06-04 20:37:56 UTC to 2026-08-01 17:42:49 UTC.

024682023-01-01 00:00:00 UTC to 2024-01-01 00:00:00 UTC (exclusive): 3 mentions; 1 submissions, 2 comments20232024-01-01 00:00:00 UTC to 2025-01-01 00:00:00 UTC (exclusive): 8 mentions; 0 submissions, 8 comments20242025-01-01 00:00:00 UTC to 2026-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments2026-01-01 00:00:00 UTC to 2027-01-01 00:00:00 UTC (exclusive): 1 mentions; 0 submissions, 1 comments. Incomplete calendar period.2026*

* An incomplete calendar period is marked with an outlined bar. Its count is not directly comparable with a full period.

Counts come from the repository’s dated source evidence. Index cutoff: 2026-11-02 08:16:59 UTC.

View mention counts and date ranges
UTC ranges include their start and exclude their end. Select a period to filter the source evidence.
PeriodStart (UTC)End (exclusive, UTC)MentionsSubmissionsComments
20232023-01-01 00:00:00 UTC2024-01-01 00:00:00 UTC312
20242024-01-01 00:00:00 UTC2025-01-01 00:00:00 UTC808
20252025-01-01 00:00:00 UTC2026-01-01 00:00:00 UTC101
2026 (partial)2026-01-01 00:00:00 UTC2027-01-01 00:00:00 UTC101

What Hacker News says

3 sources
Agreed with most of this but I’m skeptical of the rsc.io/script dsl approach. I’ll try it, though, because Russ is often right. shameless advert: do you wish testify was implemented with generics and go-cmp, and had a more understandable surface area? Check out my small library, testy https://github.com/peterldowns/testy shameless advert: do you want to write tests against your postgres database, but each new test adds seconds to your test suite? Check out pgtestdb, the marginal cost of each test is measured in tens of milliseconds, and each test gets a unique and isolated postgres instance — with all your migrations applied. https://github.com/peterldowns/pgtestdb
In Go Testing by Example [video]

Show HN: Pgtestdb, fast Postgres dbs for Golang tests

Hi HN, I'd like to get your feedback on pgtestdb, a new library for helping you write more useful database-backed tests. Many applications rely heavily on their database — and why shouldn't they! But writing tests that use the database is always a bit awkward, or in the worst case, very slow. Sometimes teams even mock their database out for an in-memory one, which works but only as long as you're not relying on specific features of your database. Postgres is a fantastic database, and at my last job we relied heavily on its views, functions, data types, etc. A lot of our application logic was tied up with it. But writing tests against it was slow. Naively, each test would have to: - Create a new database - Run our migrations on it - Then run the test - Then tear down the database pgtestdb makes this all a lot faster with two major strategi
Read the rest
es: - Use a ram-backed or tmpfs-backed server that drops all data consistency guarantees. This isn't an issue for tests at all, and makes them much faster. - Use template databases to only ever have to run the migrations once, when they change, and then fork that template each time a test asks for a new database. Check out the docs on the Github page for more information but I hope you find this useful. I've written adaptors for most common migration frameworks so hopefully you can try it out without much issue. Sincerely, Peter
4 points · Open discussion
Hi Weston, congratulations on launching. You've done a great job of explaining what the project is and how it works. I'm not in the ecosystem you've built this for so I can't comment too much on the project itself, but nice work communicating it. EDIT: after reading through the linked docs a bit more, I have to say that they are quite confusing. I'm not sure what the difference is between Ratifier, Kulvert, and SQL Simulator. I'd recommend finding a potential user and watching them go through the setup/install process and see where they have questions. If anyone is interested in something similar for postgres, I recently released https://github.com/peterldowns/pgtestdb. It uses template databases and advisory locks to give each test its own unique database with a near-zero marginal cost for each additional test. Combined with a ram/tmpfs-
Read the rest
backed postgres server that is tuned for performance, it goes extremely fast. Currently just for golang but I'm planning on releasing equivalent-capability libraries for Python and Typescript over the next month. If anyone has any thoughts/comments/feedback/suggestions I'd be extremely thankful.
In Show HN: SQL Dry Runs with SQL Simulator

MAKE YOURSELF AT HOME

A few shortcuts

/
Search the collection
?
Open this guide
Esc
Close dialogs and navigation

Your saved repositories and interests stay in this browser.