Skip to content

feat(registry): support configured db schema#102

Merged
EfeDurmaz16 merged 1 commit into
mainfrom
fides-registry-db-schema
May 6, 2026
Merged

feat(registry): support configured db schema#102
EfeDurmaz16 merged 1 commit into
mainfrom
fides-registry-db-schema

Conversation

@EfeDurmaz16

Copy link
Copy Markdown
Owner

Summary

  • add REGISTRY_DB_SCHEMA support by applying a validated Postgres search_path to registry clients
  • create the configured registry schema before running migrations
  • wire the Docker Compose default to a dedicated registry schema and document the env var
  • cover unsafe schema names locally and configured schema creation in Postgres-backed tests

Verification

  • pnpm --filter @fides/registry-service test
  • pnpm --filter @fides/registry-service lint
  • pnpm build
  • git diff --check
  • POSTGRES_PASSWORD=fides docker compose config >/tmp/fides-compose-registry-schema.yml && rg -n "REGISTRY_DB_SCHEMA|registry:" /tmp/fides-compose-registry-schema.yml

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 239596c8e4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

assertValidRegistrySchemaName(schemaName)

const url = new URL(connectionString)
url.searchParams.set('options', `-c search_path=${schemaName},public`)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Quote mixed-case schema names in search_path

When REGISTRY_DB_SCHEMA contains uppercase letters (which the validator accepts), this unquoted search_path entry is folded to lowercase by Postgres, while ensureConfiguredRegistrySchema creates the schema as a quoted case-sensitive name. For example REGISTRY_DB_SCHEMA=Registry creates schema "Registry", but the client searches registry,public, so migrations and runtime tables fall back to public instead of the configured schema. Either reject uppercase names or quote/escape the search path entry consistently with schema creation.

Useful? React with 👍 / 👎.

@EfeDurmaz16 EfeDurmaz16 merged commit 4d353d9 into main May 6, 2026
9 checks passed
@EfeDurmaz16 EfeDurmaz16 deleted the fides-registry-db-schema branch May 6, 2026 19:17
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.

2 participants