Repository navigation
Local-first database: containerized Postgres, portable anywhere - #16
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Postgres-backed stacks fall back to a local Docker Postgres (pinned postgres:16-alpine, port 54322, healthcheck, volume) when no Supabase cloud config exists. Adds migration 018 database_targets, the database.rs provision/schema/check module, scaffold compose + local-first DATABASE_URL, a prisma-toolchain verification check, and schema apply in the pipeline. Daemon-down pauses as awaiting_user. Tests: 7 new unit + a self-skipping live container test. Design + E2E steps in LOCAL-DATABASE.md. Gates: 235 lib + 42 integration.
This branch was successfully deployed
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.
Implements the local-first database design: containerized Postgres on this machine, portable anywhere later via Prisma.
What it does
provisionbootspostgres:16-alpinevia the scaffoldeddocker-compose.yml(port 54322, healthcheck, named volume), waits for healthy, and records adatabase_targetsrow. Cloud config still wins when present.npm installphase also applies the Prisma schema (migrate deploywith a migrations dir, elsedb push); a schema that can't be applied fails the run.database reachable + schema appliedruns the reachability + per-modelto_regclassqueries through the project's own Prisma toolchain (npx prisma db execute --stdin) — same path the app uses. Skips cleanly without a schema.docker-compose.ymland defaultsDATABASE_URLto the local container; the Supabase-cloud URL stays as a commented migration template.awaiting_userwith an actionable message — never a cryptic failure.Verification
psqlroundtrip + teardown; it runs automatically once Docker is up (the engine was still starting at ship time — exact commands inLOCAL-DATABASE.md).docs/2026-09-26-defect-closure/handoffs/LOCAL-DATABASE.md(design, migration-anywhere story, follow-ups).Known follow-ups (in the handoff doc)
Target-status UI command, express-stack schema, app-tier DB health ping, password-change refresh rule.