Pg

Pgtestdb, fast Postgres dbs for Golang tests

Hacker News

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 strategies: - 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

Share card

Actual performance

4points
1comments
Did not reach leaderboard

Launch Intel predictions

Analyze your own launch →
Product HuntOn track for Day 1 leaderboard · Strong signals: new · Missing: mac, agents, macos
80%80% predicted probability of success on Product Hunt, based on ML models trained on real launch data.
best fitHighest predicted score across all platforms for this description.
Indie HackersFits the IH revenue-focused audience · Missing: supports, reddit linkedin, podcasting
65%65% predicted probability of success on Indie Hackers, based on ML models trained on real launch data.
Hacker NewsStrong engagement from HN community · Strong signals: io · Missing: https docs, excited, just released
60%60% predicted probability of success on Hacker News, based on ML models trained on real launch data.
nativeThis product was originally launched on this platform.
TrustMRRLess likely to generate early MRR · Strong signals: way · Missing: mobile apps, ios, personal
31%31% predicted probability of success on TrustMRR, based on ML models trained on real launch data.
AppSumoMay struggle as an AppSumo deal · Missing: plus, platform, intuitive
30%30% predicted probability of success on AppSumo, based on ML models trained on real launch data.
Acquire.comPre-revenue stage for this audience · Missing: arr, mrr, revenue
20%20% predicted probability of success on Acquire.com, based on ML models trained on real launch data.
BetaListMay not resonate with beta-testers · Missing: web3, chat, crypto
0%0% predicted probability of success on BetaList, based on ML models trained on real launch data.

Incorrect prediction on native model

Similar products

Pg
Pgrust, Postgres in Rust (passing 100% of Postgres regression tests)77%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Pgrust, Postgres in Rust (passing 100% of Postgres regression tests)

Hacker News6
Pg
PgModeler – EER Diagramming for postgres73%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

PgModeler – EER Diagramming for postgres

Hacker News9
Me
Merging RethinkDB and Postgres with GraphQL79%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Merging RethinkDB and Postgres with GraphQL

Hacker News6
Fi
First experiment wih Vertx,Vue,Postgres48%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

First experiment wih Vertx,Vue,Postgres

Hacker News1
Lo
Logchain – ClickHouse/Postgres gRPC hook for logrus81%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Logchain – ClickHouse/Postgres gRPC hook for logrus

Hacker News3
pg
pglockanalyze - See the locks your Postgres migrations will acquire59%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

pglockanalyze - See the locks your Postgres migrations will acquire

Hacker News8
Ap
Apache Iceberg FDW for Postgres72%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Apache Iceberg FDW for Postgres

Hacker News1
Fa
FaultWall – Which tenant is killing your Postgres? Now you can find out61%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

FaultWall – Which tenant is killing your Postgres? Now you can find out

Hacker News2
No
Now supporting MySQL, Postgres, Redis, Mongo60%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

Now supporting MySQL, Postgres, Redis, Mongo

Hacker News3
Gr
GraphQL for Postgres83%Launch Intel prediction score: how likely this product is to succeed on its source platform, based on its name, tagline, and description.

GraphQL for Postgres

Hacker News195