dyna-record
    Preparing search index...

    Type Alias InferQueryResults<T, F, SK>

    InferQueryResults: ExtractTypeFromFilter<F> extends infer Names
        ? ShouldNarrow<T, Names> extends true
            ? IntersectTypeWithOr<T, F, SK>
            : FallbackToFilterKeys<T, F, SK>
        : FallbackToFilterKeys<T, F, SK>

    Infers query results from filter and SK for the non-index query overload.

    Narrowing strategy (respects DynamoDB's AND semantics):

    1. If the filter specifies a top-level type value, narrow by that — then intersect with $or narrowing and skCondition narrowing if present.
    2. Otherwise, if top-level filter keys narrow to specific entities, use that — then intersect with $or narrowing and skCondition narrowing if present.
    3. Otherwise, if $or blocks resolve to specific entities (by type or keys), use that — then intersect with skCondition narrowing if present.
    4. Otherwise, if skCondition matches an exact entity name or $beginsWith an entity name, narrow by that.
    5. Otherwise, return the full QueryResults<T> union.

    skCondition is always intersected with other narrowing signals because it is a DynamoDB key condition that physically limits which items are scanned, unlike filter expressions which are applied post-scan.

    When multiple narrowing signals resolve to different entity sets, the intersection is taken. An empty intersection produces never[], reflecting that no DynamoDB record can satisfy all combined conditions.

    Type Parameters

    • T extends default

      The root entity being queried.

    • F

      The inferred filter type (captured via const generic).

    • SK = unknown

      The inferred sort key condition type.