@earth-app/collegedb
    Preparing search index...

    Function allByLookupKey

    • Retrieves all records using a secondary lookup key when available.

      This helper attempts to resolve the lookup key through KV first. If a mapping exists, the query executes on that shard directly. If the mapping is missing, stale, or returns no rows, the helper safely falls back to fanout (allAllShards) and returns merged results.

      Type Parameters

      • T = Record<string, unknown>

        Type of the result records

      Parameters

      • lookupKey: string

        Secondary key such as email:user@example.com or username:alice

      • sql: string

        SQL statement to execute

      • bindings: any[] = []

        Parameter values to bind to the SQL statement

      • batchSize: number = 50

        Number of concurrent shard queries during fanout (default: 50)

      • Optionaloptions: ReadOptions

        Read guarantee for this call. The mapped shard and the fanout share one session per shard

      Returns Promise<QueryResult<T>>

      Promise resolving to merged query results

      1.1.4