mysql.one

mysql.one

mysql.one

Function

Execute a query and return a single row of results.

Syntax

Parameters

No parameters.

Return value

TypeDescription
Object/EmptyReturns an object when a row is found; returns Empty if there is no result.

Example

Notes

  • SQL must be set before execution.
  • Batch configuration of binds, batch, and workers is not supported.
  • The MySQL global connection pool grouped by DSN is reused by default; the pool status can be viewed through BT.stats().mysql.
  • When there is no query result, empty will be returned, and null will not be used to indicate that it was not found.
  • Single call subject to BT_MYSQL_QUERY_TIMEOUT_MS limit.