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

    Function firstAllShards

    • Executes a query on all shards and returns the first matching record from each shard.

      This function is useful for scenarios where you need to retrieve a single record from each shard, such as fetching the latest entry or a specific item that may exist on multiple shards.

      Type Parameters

      • T = Record<string, unknown>

      Parameters

      • sql: string

        The SQL statement to execute

      • bindings: any[] = []

        Parameter values to bind to the SQL statement

      • batchSize: number = 50

        Number of concurrent queries to run at once (default: 50)

      Returns Promise<(null | T)[]>

      Promise resolving to an array of first matching records from each shard

      1.0.4