Skip to content

feat: pass schema naming strategy env vars to pgSettings#816

Merged
pyramation merged 1 commit into
mainfrom
devin/1773532496-schema-naming-pgsettings
Mar 15, 2026
Merged

feat: pass schema naming strategy env vars to pgSettings#816
pyramation merged 1 commit into
mainfrom
devin/1773532496-schema-naming-pgsettings

Conversation

@pyramation
Copy link
Copy Markdown
Contributor

Summary

Forwards two environment variables into PostgreSQL session context via pgSettings, enabling the schema naming strategy customization added in constructive-db#576.

When set, these env vars are included in every PG session as SET LOCAL variables:

  • CONSTRUCTIVE_SIMPLE_SCHEMA_NAMESconstructive.simple_schema_names — skips hash suffix for multi-tenant schema names
  • CONSTRUCTIVE_SCHEMA_USE_UNDERSCORESconstructive.schema_use_underscores — uses underscores instead of dashes

Both are no-ops when unset. Intended for local development only.

Review & Testing Checklist for Human

Notes

  • No tests added — the change is purely pass-through (env var → pgSettings dict). The SQL-side behavior is tested via constructive-db CI.
  • If someone sets CONSTRUCTIVE_SIMPLE_SCHEMA_NAMES=false, it still gets forwarded, but the SQL trigger checks = 'true' so it's correctly ignored.

Link to Devin session: https://app.devin.ai/sessions/5675853a0d16427d85ca6d32b3188097
Requested by: @pyramation

Forward CONSTRUCTIVE_SIMPLE_SCHEMA_NAMES and CONSTRUCTIVE_SCHEMA_USE_UNDERSCORES
env vars into PostgreSQL session context via pgSettings. This allows the
constructive-db schema naming triggers to read these settings and produce
simpler, more readable schema names for local development.

Companion to constructive-db PR #576.
@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 25144ae into main Mar 15, 2026
43 checks passed
@pyramation pyramation deleted the devin/1773532496-schema-naming-pgsettings branch March 15, 2026 00:30
devin-ai-integration Bot pushed a commit that referenced this pull request Apr 16, 2026
Add entity_type string property to AuthzMembership, AuthzEntityMembership,
AuthzRelatedEntityMembership, AuthzPeerOwnership, and AuthzRelatedPeerOwnership.

This allows policy definitions to use entity_type: 'channel' instead of
membership_type: 3. The RLS parser resolves the prefix to the correct
membership_type integer via memberships_module lookup.

For AuthzMembership, required fields updated: either membership_type or
entity_type must be provided (validated server-side in parse.sql).

Companion to constructive-db PR #816.
devin-ai-integration Bot pushed a commit that referenced this pull request May 9, 2026
- rls_settings: schema/function text fields → uuid FK fields
- pubkey_settings: schema/function text fields → uuid FK fields
- webauthn_settings: schema/table/field text fields → uuid FK fields
- Matches constructive-db PR #1060 schema changes for #816 and #817
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