Tests Are SQL Files Too
14 hours ago
- #REST APIs
- #Testing
- #PostgreSQL
- NpgsqlRest 3.12.0 introduced SQL files as REST endpoints, eliminating deployment and migration needs.
- NpgsqlRest 3.19.0 enhances this with named parameters, watch mode for real-time validation, and a native test runner.
- Test runner uses SQL files with embedded HTTP comments for in-process endpoint testing, with automatic rollback for isolation.
- PostgreSQL features like transactional DDL, deferrable constraints, and cheap database creation make database testing feasible.
- Watch mode provides continuous validation and re-runs tests on save, improving development experience.
- AI TDD is enabled by fast, isolated tests with truthful feedback loops for AI agents.