本页还没有译文
本页 19 段还没译成日本語,下面显示的是英文原文。ApplyJoinOptionalityToMergedSchema
还没翻译译自英文(tanstack.com)本页 19 段都还没译
type ApplyJoinOptionalityToMergedSchema<TExistingSchema, TNewSchema, TJoinType, TFromSourceNames> = { [K in keyof TExistingSchema]: K extends TFromSourceNames ? TJoinType extends "right" | "full" ? TExistingSchema[K] | undefined : TExistingSchema[K] : TExistingSchema[K] } & { [K in keyof TNewSchema]: TJoinType extends "left" | "full" ? TNewSchema[K] | undefined : TNewSchema[K] };Defined in: packages/db/src/query/builder/types.ts:1037
ApplyJoinOptionalityToMergedSchema - Applies optionality rules when merging schemas
This type implements the SQL join optionality semantics:
For Existing Tables:
RIGHT JOINorFULL JOIN: Main table (from fromSourceName) becomes optional- Other join types: Existing tables keep their current optionality
- Previously joined tables: Keep their already-applied optionality
For New Tables:
LEFT JOINorFULL JOIN: New table becomes optionalINNER JOINorRIGHT JOIN: New table remains required
Examples:
FROM users LEFT JOIN orders -- orders becomes optional
FROM users RIGHT JOIN orders -- users becomes optional
FROM users FULL JOIN orders -- both become optional
FROM users INNER JOIN orders -- both remain requiredThe intersection (&) ensures both existing and new schemas are merged into a single type while preserving all table references.
Type Parameters
TExistingSchema
TExistingSchema extends ContextSchema
TNewSchema
TNewSchema extends ContextSchema
TJoinType
TJoinType extends "inner" | "left" | "right" | "full" | "outer" | "cross"
TFromSourceNames
TFromSourceNames extends string
AI 翻译查看英文原文