@karmaniverous/entity-client-dynamodb
    Preparing search index...

    Class QueryBuilder<C, ET, ITS, CF, K>

    Provides a fluent API for building a ShardQueryMap using a DynamoDB Document client.

    Type Parameters

    • C extends BaseConfigMap

      Entity-manager config map.

    • ET extends EntityToken<C> = EntityToken<C>

      Entity token type.

    • ITS extends string = string

      Index token type.

    • CF = unknown

      Values-first config literal type carried by the client.

    • K = unknown

      Projection tuple type (type-only channel).

    Hierarchy

    Index

    Other

    • BaseQueryBuilder constructor.

      Type Parameters

      • C extends BaseConfigMap

        Entity-manager config map.

      • ET extends string | number | symbol = EntityToken<C>

        Entity token type.

      • ITS extends string = string

        Index token type.

      • CF = unknown

        Values-first config literal type carried by the client.

      • K = unknown

        Projection tuple type (type-only channel).

      Parameters

      Returns QueryBuilder<C, ET, ITS, CF, K>

    entityClient: EntityClient

    EntityClient instance.

    entityToken: Extract<keyof Exactify<C["EntityMap"]>>

    Entity token.

    hashKeyToken: C["HashKey"] | C["ShardedKeys"]

    Hash key token.

    indexParamsMap: Record<ITS, IndexParams>

    Maps indexToken values to database platform-specific query parameters.

    pageKeyMap?: string

    Dehydrated page key map.

    • Set a projection (attributes) for an index token.

      Type Parameters

      • KAttr extends readonly string[]

        Projection tuple type.

      Parameters

      • indexToken: ITS

        Index token to set projection for.

      • attributes: KAttr

        Attributes to include in ProjectionExpression.

        • Type-only: narrows K when called with a const tuple.
        • Runtime: populates ProjectionExpression for the index.

        Note: At query time, uniqueProperty and any explicit sort keys will be auto-included to preserve dedupe/sort invariants.

      Returns QueryBuilder<C, ET, ITS, CF, KAttr>

    • Apply the same projection across the supplied indices. Narrows K to KAttr.

      Type Parameters

      • KAttr extends readonly string[]

        Projection tuple type.

      Parameters

      • indices: ITS[] | readonly ITS[]

        Index tokens to apply the projection to.

      • attributes: KAttr

        Attributes to include in ProjectionExpression.

      Returns QueryBuilder<C, ET, ITS, CF, KAttr>

      A new builder type whose K is narrowed to KAttr.

    • Set scan direction for an index.

      Parameters

      • indexToken: ITS

        Index token to set scan direction for.

      • value: boolean

        Direction (true = forward, false = reverse).

      Returns this

      The same builder instance.

    QueryBuilder