fix(codegen): FindManyArgs TCondition slot fix + regenerate SDK from latest constructive-db#819
Merged
pyramation merged 2 commits intomainfrom Mar 15, 2026
Merged
Conversation
… for TCondition) When no condition type exists for a table, both model-generator.ts and queries.ts were passing 3 type args to FindManyArgs<TSelect, TWhere, TCondition, TOrderBy>, which caused OrderBy to land in the TCondition slot (position 3) and TOrderBy to default to never. This broke orderBy on all tables without condition types. Fix: always emit 4 type args, using never for TCondition when absent.
… latest constructive-db introspection - Fresh introspection includes fields parameter on SecureTableProvisionInput - 103 public tables, 32 admin tables, 7 auth tables, 5 objects tables - All generated code uses fixed FindManyArgs with explicit never for TCondition
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:
|
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.
fix(codegen): explicit
neverfor FindManyArgs TCondition + regenerate SDK from latest constructive-dbSummary
Bug fix (3 files, ~6 lines of actual logic):
FindManyArgs<TSelect, TWhere, TCondition = never, TOrderBy = never>hasTConditionat position 3. When a table has no condition type, bothmodel-generator.tsandqueries.tswere using a spread pattern that omitted TCondition entirely, producing 3-arg calls likeFindManyArgs<S, Filter, OrderBy>. TypeScript resolves this asTCondition = OrderBy, TOrderBy = never, which breaks everyorderByparameter on tables without condition types.Fix: always emit 4 type arguments, passing
neverexplicitly when no condition type exists:SDK regeneration (~920 auto-generated files): Fresh introspection of constructive-db picks up schema changes including
fieldsjsonb parameter onSecureTableProvisionInputfor inline field definitions, new tables (DefaultPrivilege,NodeTypeRegistry,HierarchyModule,SqlMigration,AstMigration), removal ofTableModule, and new*TrgmSimilarity/searchScorecolumns across many tables.Review & Testing Checklist for Human
*TrgmSimilarityandsearchScorefields on create. Verify this is expected from the DB schema and that existing consumers (e.g. agent-os provision scripts) are updated before publishing.private.graphqlwas added tosdk/constructive-sdk/schemas/. This file is identical topublic.graphqland is excluded by the codegen'sEXCLUDE_TARGETS, but it wasn't present before. Confirm this is acceptable or should be excluded from the commit.FindManyArgstype args with the same spread pattern. The fix coversmodel-generator.tsandqueries.ts— search for other spread-into-FindManyArgs patterns that may have been missed.secureTableProvision.create()acceptsfieldsparameter, (2)findManywithorderByworks on tables that lack condition types (e.g.ViewRule), (3) React hooks build without type errors.Notes