Remove the Postgres storage backend - #29
Merged
Merged
Conversation
The managed Postgres cluster this talked to has been destroyed and the service runs on SQLite, so PostgresStore is a code path that can no longer be reached: there is nothing left to connect to. Keeping it was not neutral. Storage selection fell through to Postgres whenever SQLITE_PATH was unset, so a missing variable produced a confusing dial failure at startup instead of naming the actual problem. SQLITE_PATH is now required unless -ephemeral is passed, and the error says so. Removing it also takes pgx and three transitive dependencies out of the module, and lets CI stop provisioning a Postgres service container and seeding a schema purely to exercise unreachable code. The three test wrappers collapse into one. test.sh now provisions its own SQLite file in its scratch directory, so the end-to-end suite needs no database server; docker_test.sh, local_test.sh and sqlite_test.sh are all redundant. The dev compose stack drops its database service and keeps its data in a named volume. Separately, dev/Dockerfile pinned golang:1.24-alpine while go.mod requires 1.25.0. Alpine images set GOTOOLCHAIN=local, so `docker compose up` -- the quickstart the README points at -- has been failing to build since the Go bump. Bumped to match the production Dockerfile. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Why
The managed Postgres cluster has been destroyed and the service runs on SQLite, so
PostgresStoreis a code path that can no longer be reached — there is nothing left to connect to.Keeping it wasn't neutral, either. Storage selection fell through to Postgres whenever
SQLITE_PATHwas unset, so a missing variable produced a confusing dial-and-fail at startup rather than naming the actual problem.What
Removed:
postgres.go,postgres_test.go,links.sql,docker_test.sh,local_test.sh,dev/psql.sh,sqlite_test.sh.SQLITE_PATHis now required unless--ephemeralis passed, and the error says exactly that:Dependencies:
pgx/v5pluspgpassfile,pgservicefileandpuddleleave the module.modernc.org/sqlitebecomes a direct requirement.CI stops provisioning a database. No Postgres service container, no schema-seeding step, no
DATABASE_URL— it was standing up a database purely to exercise code that no longer exists.Three test wrappers collapse into one.
test.shnow provisions its own SQLite file in its scratch directory, so the end-to-end suite needs no database server and cleans up after itself.Dev stack drops its
dbservice and keeps data in a namedlinks_datavolume.Drive-by fix
dev/Dockerfilepinnedgolang:1.24-alpinewhilego.modrequires1.25.0. Alpine images setGOTOOLCHAIN=local, so it can't self-upgrade:docker compose up— the quickstart the README points at — has been failing to build since the Go bump. This is pre-existing and unrelated to the Postgres removal, but it surfaced while verifying the dev environment and it would have been dishonest to document a quickstart I'd just watched fail. Bumped to match the production Dockerfile.Testing
go build,go vet,gofmt,go test ./...all clean./test.shpasses end to end with no database server, leaving no scratch directory behindSQLITE_PATHgives the fatal above;--ephemeralstarts in-memorydocker compose up --build): server opens SQLite, a link added through the dev client redirects correctly, web frontend returns 200restart, anddown -vwipes itTradeoff
SQLite pins the app to a single machine in a single region with no replication. That's already how it runs, and it suits the workload — but horizontal scaling would mean reintroducing a networked database rather than reviving this one. It stays in git history.
🤖 Generated with Claude Code