type MergeContextWithJoinType<TContext, TNewSchema, TJoinType> = object & PreserveSingleResultFlag<TContext["singleResult"]>;
type MergeContextWithJoinType<TContext, TNewSchema, TJoinType> = object & PreserveSingleResultFlag<TContext["singleResult"]>;
Defined in: packages/db/src/query/builder/types.ts:573
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:
Context Evolution:
baseSchema: TContext["baseSchema"];
baseSchema: TContext["baseSchema"];
fromSourceName: TContext["fromSourceName"];
fromSourceName: TContext["fromSourceName"];
hasJoins: true;
hasJoins: true;
joinTypes: TContext["joinTypes"] extends Record<string, any> ? TContext["joinTypes"] : object & { [K in keyof TNewSchema & string]: TJoinType };
joinTypes: TContext["joinTypes"] extends Record<string, any> ? TContext["joinTypes"] : object & { [K in keyof TNewSchema & string]: TJoinType };
result: TContext["result"];
result: TContext["result"];
schema: ApplyJoinOptionalityToMergedSchema<TContext["schema"], TNewSchema, TJoinType, TContext["fromSourceName"]>;
schema: ApplyJoinOptionalityToMergedSchema<TContext["schema"], TNewSchema, TJoinType, TContext["fromSourceName"]>;
TContext extends Context
TNewSchema extends ContextSchema
TJoinType extends "inner" | "left" | "right" | "full" | "outer" | "cross"
