Skip to content

refactor(server): remove schema naming env var forwarding from pgSettings#830

Merged
pyramation merged 1 commit intomainfrom
devin/1773710098-remove-schema-naming-env-vars
Mar 17, 2026
Merged

refactor(server): remove schema naming env var forwarding from pgSettings#830
pyramation merged 1 commit intomainfrom
devin/1773710098-remove-schema-naming-env-vars

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

Summary

Removes the CONSTRUCTIVE_SIMPLE_SCHEMA_NAMES and CONSTRUCTIVE_SCHEMA_USE_UNDERSCORES environment variable forwarding from the GraphQL server's pgSettings context (added in PR #816).

These schema naming strategy settings are now configured at the database level via ALTER DATABASE SET during provision, so every PostgreSQL connection inherits them automatically. The server no longer needs to act as a pass-through for these values, keeping it generic and decoupled from schema naming concerns.

What changed: 9 lines removed from graphql/server/src/middleware/graphile.ts — the two if (process.env.CONSTRUCTIVE_*) blocks in buildPreset's context callback. No new code added.

Review & Testing Checklist for Human

  • Verify all active databases have ALTER DATABASE SET configured — Any database that was relying on CONSTRUCTIVE_SIMPLE_SCHEMA_NAMES / CONSTRUCTIVE_SCHEMA_USE_UNDERSCORES env vars on the server must now have equivalent database-level settings (constructive.simple_schema_names, constructive.schema_use_underscores). Without this, schema creation will revert to default behavior (hash suffixes, dashes). Check with: psql <dbname> -c "SELECT name, setting FROM pg_db_role_setting WHERE setdatabase = (SELECT oid FROM pg_database WHERE datname = '<dbname>')" or SHOW constructive.simple_schema_names;
  • Confirm no other consumers depend on these env vars — Grep across deployment configs, docker-compose files, CI pipelines, and Kubernetes manifests for CONSTRUCTIVE_SIMPLE_SCHEMA_NAMES or CONSTRUCTIVE_SCHEMA_USE_UNDERSCORES to ensure nothing else references them.
  • Test a provision + schema creation cycle — After deploying this change, provision a new database and verify schema names are still clean (e.g., myapp_app_public not myapp_1234567_app_public).

Notes

…ings

These settings (constructive.simple_schema_names, constructive.schema_use_underscores)
are now set at the database level via ALTER DATABASE SET during provision,
so the server no longer needs to forward them from env vars.

This keeps the server generic and open-source — schema naming strategy
is a database-level concern, not a server configuration concern.
@devin-ai-integration
Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@pyramation pyramation merged commit 9074311 into main Mar 17, 2026
43 checks passed
@pyramation pyramation deleted the devin/1773710098-remove-schema-naming-env-vars branch March 17, 2026 01:38
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