Reads the first matching row, taking the routing key from the statement.
Type of the result record
Statement text using ? placeholders
?
Positional bindings for the statement
Optional
Read guarantee for this call
The first matching row, or null
null
If the routing key cannot be determined and onUnroutable is throw
onUnroutable
throw
1.3.0
const user = await queryFirst<User>('SELECT * FROM users WHERE id = ?', ['user-1']); Copy
const user = await queryFirst<User>('SELECT * FROM users WHERE id = ?', ['user-1']);
Reads the first matching row, taking the routing key from the statement.