Repository navigation
test(db-postgres): run on a schema of its own; document database isolation - #206
Merged
Merged
Conversation
…ation The pgbouncer CI job now connects as a role whose search_path is its own schema (database isolation L1), set up with the SQL the docs show. A new test checks that tables, from push and from migration files, land in that schema and none in public. Test cleanup drops tables in current_schema(). New "Database isolation" page (EN/TH): levels L0-L3 and when to pick each, why a separate pool does not isolate CPU or IO, the L1 setup, read grants for the app, and moving an existing install to L1 (tested against Postgres 17: data, ids and migrations carry over). Closes #156 Co-Authored-By: Claude Opus 5.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.
Closes #156 (M5, ADR-0055 L1 step 1).
CI
pgbouncerjob now connects as rolecms, whosesearch_pathis its own schemaeasy_cms. The role is set up with the same three statements the docs show, and it has no rights onpublic.postgresjob stays onpublic.postgres-schema.test.tschecks that every table lands ineasy_cmsand none inpublic, both from push and from migration files (createMigration→migrate→verify). It runs only whenPOSTGRES_SCHEMAis set.current_schema()instead ofpublic.Docs
New page Database isolation (EN/TH), linked from Databases and the sidebar. It covers:
GRANTs so the app can read CMS tablesurlThe
schemaoption (#172) and the DML-only role (#173) are mentioned in one line as planned.No changeset: no package changes. The website shows these docs from the next release, or earlier via
docs-ref.txt.Verified locally (Docker, Postgres 17 + PgBouncer 1.26)
cmsthrough PgBouncer: 351 passed. Afterwards no Easy CMS table is inpublic.search_path: gets "permission denied for schema public", as the docs say.verifypasses, nothing is re-applied, and all 9 tables are ineasy_cms.pnpm turbo run test --continue53/53vitepress buildpasses, with matching EN/TH anchorsbiome cipasses (the 7 warnings were already there)🤖 Generated with Claude Code