# mysql.one ## Function Execute a query and return a single row of results. ## Syntax ```bt mysql(dsn).query(sql).one() ``` ## Parameters No parameters. ## Return value | Type | Description | | ------ | ------ | | Object/Empty | Returns an object when a row is found; returns Empty if there is no result. | ## Example ```bt db = mysql('mysql://user:pass@127.0.0.1/test') row = db.query('select id, name from user where id=?').bind(1).one() // Output: Object echo(type(row)) ``` ## 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.