Skip to content

Store the registry in PostgreSQL in production - #1

Merged
ralyodio merged 1 commit into
mainfrom
worktree-postgres-store
Sep 17, 2026
Merged

ralyodio merged 1 commit into
mainfrom
worktree-postgres-store

Conversation

@ralyodio

Copy link
Copy Markdown
Contributor

Summary

  • The registry store is now async and picks PostgreSQL when DATABASE_URL is set, SQLite otherwise (local dev and tests).
  • Every caller awaits the store: HTTP routes, site renderer, operations dispatch, conformance script, CLI/integration tests.
  • /healthz reports "storage": "postgres" | "sqlite".
  • Registry contract tests run against both backends when W3BS_TEST_DATABASE_URL is set; CI adds a postgres:18-alpine service.
  • Deployment docs and .env.example describe the self-hosted Railway Postgres service. No app volume is needed anymore.

Test plan

  • npm test on SQLite: 14 pass
  • node --test test/core.test.mjs with a local Postgres 18 container: 12 pass, including the 3 [postgres] cases
  • Server booted with DATABASE_URL: health shows storage: postgres, 10 seeded resources, /prompts 200, resolve returns the canonical manifest
  • npm run check, npm run conformance (evidence regenerated), npm run test:browser (8 pass)

🤖 Generated with Claude Code

Replace the synchronous SQLite-only store with an async store that uses PostgreSQL when DATABASE_URL is set and SQLite otherwise. Every caller (HTTP routes, site renderer, operations dispatch, conformance script, tests) now awaits the store. The registry contract tests run against both backends; CI adds a Postgres service. Health reports the active storage backend. Deployment docs describe the self-hosted Railway Postgres setup.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpg@​8.23.09910010087100

View full report

@ralyodio
ralyodio merged commit 8225165 into main Sep 17, 2026
4 checks passed
@ralyodio
ralyodio deleted the worktree-postgres-store branch September 17, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant