This is available as SQL\Query in the www repository.
SQL\Query
namespace HH\Lib\SQL; final class Query {...}
->__construct(QueryFormatString $format, mixed ...$args)
->toString__FOR_DEBUGGING_ONLY(\AsyncMysqlConnection $conn): string
->toUnescapedString__FOR_DEBUGGING_ONLY__UNSAFE(): string