Using GitHub Actions and Neon to Validate Database Schema Changes
autoblocks.ai
autoblocks.ai
I recently open-sourced the code that helps us use GitHub Actions and Neon DB for seamless database schema change validation.
Here are some highlights from our blog post. [1] Feel free to check out the repo for more details! [2]
> Serverless Postgres Database
Autoblocks uses Neon for serverless Postgres database management. This simplifies the complexity of managing
database changes, reducing engineering overhead.
> Automate Neon Branch Creation Use GitHub Actions to trigger Neon branch creation for database migrations. This automates the workflow, creating a
Neon branch only when there are changes in the migrations folder, optimizing resource usage.
> Dry Runs on Production Data Test database changes on a copy of the production data before actual deployment, increasing reliability and
reducing risks.
> Automated Deletion of Branches Automatically delete Neon branches post GitHub branch merge/delete. This ensures a clean environment by
automatically removing temporary database branches.
> Extensible Setup (smoke tests, Vercel preview environments, etc.) Use Neon branches for various test scenarios and environments, not just database migration checks.
> Direct and Pooled Connections Supported Offers the choice between two types of database connections: direct for immediate tasks like migrations and pooled
for queue-based tasks like tests.
Links:[1] https://www.autoblocks.ai/blog/validate-schema-changes [2] https://github.com/autoblocksai/neon-actions