Show HN: I made pgdbtemplate to cut PostgreSQL test time by 1.5x using templates
a day ago
- #Testing
- #PostgreSQL
- #Go
- A high-performance Go library for creating PostgreSQL test databases using template databases for faster test execution.
- Features include lightning-fast test databases (1.2-1.6x faster than traditional approaches), thread-safe operations, and scalability with schema complexity.
- Supports PostgreSQL-specific features with connection string validation and multiple drivers (database/sql and pgx).
- Offers flexible testing support, including Testcontainers integration for containerized testing.
- Configurable migration runners and connection providers with support for advanced pooling options.
- Performance improvements include consistent database creation times regardless of schema complexity and superior concurrency handling.
- Memory efficient with 17% less memory usage per operation compared to traditional methods.
- Thread-safe operations designed for concurrent use in production test suites.
- Requires PostgreSQL 9.5+, Go 1.21+, and a PostgreSQL driver (github.com/lib/pq or github.com/jackc/pgx/v5).
- MIT licensed with contributions welcome under specified guidelines.