fix(codegen): use resolved entity name for manyToMany rightTable instead of re-singularizing#934
Merged
pyramation merged 2 commits intomainfrom Mar 30, 2026
Conversation
…ead of re-singularizing The inferHasManyOrManyToMany function was extracting the entity name from the field name prefix and re-singularizing it, which produced incorrect inflections for some words (e.g. 'codebases' → 'Codebasis' instead of 'Codebase'). The related entity name was already correctly resolved from the connectionToEntity map, so we use that directly instead.
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
…taSearch embedding params
The data_embedding SQL trigger already supports a 'chunks' passthrough config
that inserts into metaschema_public.embedding_chunks when present. This adds the
corresponding TypeScript type definitions so consumers (e.g. agentic-db provision)
can use chunks: {} in blueprint DataSearch/DataEmbedding node configs without
TypeScript errors.
Properties match the embedding_chunks table columns:
- content_field_name, chunk_size, chunk_overlap, chunk_strategy
- metadata_fields, enqueue_chunking_job, chunking_task_name
This was referenced Apr 21, 2026
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.
Summary
Fixes a bug where manyToMany
rightTablevalues in the inferred table metadata used incorrect inflections (e.g.Codebasisinstead ofCodebase), causing type errors in generated SDKs.The
inferHasManyOrManyToManyfunction was extracting the entity name from the GraphQL field name prefix via regex, then re-singularizing it withinflekt. For irregular plurals likecodebases,singularize("Codebases")produced"Codebasis"instead of"Codebase".The fix: use
relatedEntityName, which is already correctly resolved from theconnectionToEntitymap (derived from the connection type'snodesfield) earlier in the same function. This is the same resolution path already used forhasManyrelations.Review & Testing Checklist for Human
connectionToEntitybut the field-name prefix regex would have produced the correct entity name. The fallback on line 532-537 still callssingularize, so unresolved connection types would still get wrong inflections — confirm this is acceptable.codebasesByXxxAndYyy→CodebasenotCodebasis) should be added toinfer-tables.test.ts.Codebasistype references.Notes
rightTable === 'Product'.products→Product) so it didn't catch this bug. The bug only manifests with words wheresingularizeproduces an incorrect result (likecodebases→Codebasis).Link to Devin session: https://app.devin.ai/sessions/6dd1a19fd02948fda1fee04c955f4bf2
Requested by: @pyramation