Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #11 +/- ##
==========================================
- Coverage 81.35% 81.28% -0.07%
==========================================
Files 58 59 +1
Lines 5761 5772 +11
==========================================
+ Hits 4687 4692 +5
- Misses 744 749 +5
- Partials 330 331 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Migrate the database layer from raw database/sql + inline DDL to sqlx +
golang-migrate, supporting both SQLite and PostgreSQL as a config option.
- Add sqlx, golang-migrate, and pgx/v5 dependencies
- Extract inline DDL into versioned migration files under
internal/db/migrations/{sqlite,postgres}/
- Replace *sql.DB with *sqlx.DB, add db struct tags to all row types
- Convert all queries to use Rebind and struct scanning
- Add Dialect enum, Open() dispatch, openSQLite/openPostgres paths
- Add IsUniqueConstraintError dialect helper
- Expand DatabaseConfig with driver and url fields, add validation
- Add config tests for driver validation and env var overrides
- Add eachDB test helper to run all DB tests against both backends
- Add PostgreSQL service to CI and devcontainer (docker-compose)
- Update design doc to match implementation
Docker client v28.3.3 deprecated ImageInspectWithRaw in favor of ImageInspect. Fixes golangci-lint staticcheck SA1019 failure.
pgx cannot encode Go bool into PostgreSQL INTEGER columns. Convert bool to 0/1 explicitly before passing to the query.
236a96a to
719a506
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
database/sql+ inline DDL tosqlx+golang-migrate, supporting both SQLite and PostgreSQL as a config optionIsUniqueConstraintErrorhelpereachDBtest helper that runs all DB tests against both backendsmerge_grouptrigger fromci.yml(handled bymerge.yml)