Skip to content

fix(codegen): filter conflict detection by configured schemas & preserve db config merging#721

Merged
pyramation merged 2 commits intomainfrom
devin/1771128823-fix-codegen-schema-filtering-clean
Feb 15, 2026
Merged

fix(codegen): filter conflict detection by configured schemas & preserve db config merging#721
pyramation merged 2 commits intomainfrom
devin/1771128823-fix-codegen-schema-filtering-clean

Conversation

@pyramation
Copy link
Contributor

@pyramation pyramation commented Feb 15, 2026

fix(codegen): filter conflict detection by configured schemas & preserve db config merging

Summary

Clean extraction of functional changes from #720, with all linting/formatting-only changes removed.

ConflictDetectorPlugin (conflict-detector.ts): Filters codec conflict detection to only check schemas listed in pgServices.schemas, preventing false-positive warnings from unrelated schemas.

Codegen CLI (index.ts, shared.ts): Fixes db config merging so file-config db fields (e.g., pgpm settings) aren't silently dropped when CLI args also contribute db properties. Also wraps buildDbConfig output with filterDefined to prevent undefined values from overwriting real config during merge.

Updates since last revision

  • Removed functionResourceName override from InflektPlugin — all resource names (tables and functions) remain flat with no schema prefixes, per project convention.

Review & Testing Checklist for Human

  • Verify (build as any).resolvedPreset?.pgServices in conflict-detector is the correct path to access configured services at schema build time — this uses an any cast and the path may not be stable across PostGraphile versions
  • Test codegen with multi-target config where file config has db.pgpm settings and CLI passes --schemas — confirm db.pgpm is preserved in the merged config
  • Confirm the one-level-deep db merge ({ ...fileConfig.db, ...merged.db }) is sufficient — if db contains nested objects beyond schemas/apiNames/pgpm, they would be overwritten rather than merged
  • Verify filterDefined in buildDbConfig doesn't break downstream consumers that may distinguish between a key being undefined vs. absent

Notes

  • Extracted from PR Fix/codegen schema filtering #720 — same functional changes (minus functionResourceName), with all quote style ('") and whitespace/formatting diffs removed
  • No new tests added; relies on existing test suites passing
  • custom-inflector.ts is intentionally unchanged — no schema prefixes on functions or tables

Link to Devin run: https://app.devin.ai/sessions/741db16bcb8b43eaa343b3a5befd80c1
Requested by: @pyramation

fix(graphile-settings): resolve function/table resource name collisions

- Add functionResourceName override to InflektPlugin to restore schema
  prefixes for functions while keeping clean names for tables
- Filter ConflictDetectorPlugin by configured pgServices.schemas to
  prevent false-positive warnings from unrelated schemas
- Deep-merge db config in codegen CLI to preserve file config db fields
- Use filterDefined in buildDbConfig to strip undefined values
@devin-ai-integration
Copy link
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

@devin-ai-integration devin-ai-integration bot changed the title fix(codegen): resolve function/table resource name collisions & preserve db config merging fix(codegen): filter conflict detection by configured schemas & preserve db config merging Feb 15, 2026
@pyramation pyramation merged commit 0a8611c into main Feb 15, 2026
44 checks passed
@pyramation pyramation deleted the devin/1771128823-fix-codegen-schema-filtering-clean branch February 15, 2026 04:24
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