Type of the result records
Secondary key such as email:user@example.com or username:alice
SQL statement to execute
Parameter values to bind to the SQL statement
Number of concurrent shard queries during fanout (default: 50)
Promise resolving to merged query results
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.