本页还没有译文
本页 22 段还没译成日本語,下面显示的是英文原文。MergeContextWithJoinType
还没翻译译自英文(tanstack.com)本页 22 段都还没译
type MergeContextWithJoinType<TContext, TNewSchema, TJoinType> = Omit<TContext, "schema" | "refsSchema" | "hasJoins" | "joinTypes"> & object;Defined in: packages/db/src/query/builder/types.ts:983
MergeContextWithJoinType - Creates a new context after a join operation
This is the core type that handles the complex logic of merging schemas when tables are joined, applying the correct optionality based on join type.
Key Responsibilities:
- Schema Merging: Combines existing schema with newly joined tables
- Optionality Logic: Applies join-specific optionality rules:
LEFT JOIN: New table becomes optionalRIGHT JOIN: Existing tables become optionalFULL JOIN: Both existing and new become optionalINNER JOIN: No tables become optional
- State Tracking: Updates hasJoins and joinTypes for future operations
Context Evolution:
baseSchema: Unchanged (always the originalfrom()tables)schema: Expanded with new tables and proper optionalityhasJoins: Set to truejoinTypes: Updated to track this join typeresult: Preserved from previous operations- All other context state is preserved
Type Declaration
baseSchema
baseSchema: TContext["baseSchema"];fromSourceName
fromSourceName: TContext["fromSourceName"];hasJoins
hasJoins: true;joinTypes
joinTypes: TContext["joinTypes"] extends Record<string, any> ? TContext["joinTypes"] : object & { [K in keyof TNewSchema & string]: TJoinType };refsSchema
refsSchema: ApplyJoinOptionalityToMergedSchema<RefsSchemaForContext<TContext>, TNewSchema, TJoinType, FromSourceNamesForOptionality<TContext>>;schema
schema: ApplyJoinOptionalityToMergedSchema<TContext["schema"], TNewSchema, TJoinType, FromSourceNamesForOptionality<TContext>>;Type Parameters
TContext
TContext extends Context
TNewSchema
TNewSchema extends ContextSchema
TJoinType
TJoinType extends "inner" | "left" | "right" | "full" | "outer" | "cross"
AI 翻译查看英文原文