AsyncMysqlConnection
An active connection to a MySQL instance
When you call connect()
with a connection provided by the pool established
with AsyncMysqlConnectionPool
, you are returned this connection object to
actual do real work with the MySQL database, with the primary work being
querying the database itself.
Guides
Interface Synopsis
final class AsyncMysqlConnection {...}
Public Methods
->close(): void
Close the current connection->connectResult(): ?AsyncMysqlConnectResult
Returns theAsyncMysqlConnectResult
for the current connection->escapeString(string $data): string
Escape a string to be safe to include in a raw query->getSslCertCn(): string
Returns Common Name attribute of the TLS certificate presented by MySQL server->getSslCertExtensions(): Vector<string>
Returns values from the selected cert extensions of the TLS certificate presented by MySQL server->getSslCertSan(): Vector<string>
Returns Server Alternative Names attribute of the TLS certificate presented by MySQL server->host(): string
The hostname associated with the current connection->isReusable(): bool
Returns whether or not the current connection is reusable->isSSL(): bool
Returns whether or not the current connection was established as SSL based on client flag exchanged during handshake->isSslCertValidationEnforced(): bool
Returns a boolean value indicating if server cert validation was enforced for this connection->isValid(): bool
Checks if the data insideAsyncMysqlConnection
object is valid->lastActivityTime(): float
Last time a successful activity was made in the current connection, in seconds since epoch->multiQuery(Traversable<string, arraykey, mixed> $queries, int $timeout_micros = -1, dict<string> $query_attributes = dict [ ]): Awaitable<Vector<AsyncMysqlQueryResult>>
Begin running a query with multiple statements->port(): int
The port on which the MySQL instance is running->query(string $query, int $timeout_micros = -1, dict<string> $query_attributes = dict [ ]): Awaitable<AsyncMysqlQueryResult>
Begin running an unsafe query on the MySQL database client->queryAsync(HH\Lib\SQL\Query $query): Awaitable<AsyncMysqlQueryResult>
->queryf(HH\FormatString<HH\SQLFormatter> $pattern, ...$args): Awaitable<AsyncMysqlQueryResult>
Execute a query with placeholders and parameters->releaseConnection(): mixed
Releases the current connection and returns a synchronous MySQL connection->serverInfo(): string
The MySQL server version associated with the current connection->setReusable(bool $reusable): void
Sets if the current connection can be recycled without any clean up->sslSessionReused(): bool
Returns whether or not the current connection reused the SSL session from another SSL connection->warningCount(): int
The number of errors, warnings, and notes returned during execution of the previous SQL statement