Begin an async connection and query to a MySQL instance


public static function connectAndQuery(
  Traversable<string> $queries,
  string $host,
  int $port,
  string $dbname,
  string $user,
  string $password,
  AsyncMysqlConnectionOptions $conn_opts,
): Awaitable<Vector<AsyncMysqlQueryResult>>;

Use this to asynchronously connect and query a MySQL instance.

Normally you would use this to make one query to the MySQL client.

If you want to be able to reuse the connection use connect or connectWithOpts


  • Traversable<string> $queries
  • $host - The hostname to connect to.
  • $port - The port to connect to.
  • $dbname - The initial database to use when connecting.
  • $user - The user to connect as.
  • $password - The password to connect with.
  • AsyncMysqlConnectionOptions $conn_opts

Return Values