Type of the result record
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 the first matching record, or null
Retrieves the first record using a secondary lookup key when available.
This helper avoids creating new primary-key mappings for secondary identifiers. It first checks KV for a lookup-key mapping and queries that shard directly. If no mapping exists (or the mapping is stale), it falls back to fanout (
firstAllShards) and returns the first non-null result.