Skip to content

Commit 0eb9d1d

Browse files
committed
Update readme
1 parent 45a3c91 commit 0eb9d1d

File tree

1 file changed

+22
-13
lines changed

1 file changed

+22
-13
lines changed

README.md

+22-13
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
AMPHP is a collection of event-driven libraries for PHP designed with fibers and concurrency in mind.
44
`amphp/mysql` is an asynchronous MySQL client.
5-
The library allows to dynamically query a server with multiple MySQL connections concurrently.
6-
The client transparently distributes these queries across a scalable pool of available connections and does so using 100% userland PHP; there are *no external extension dependencies* (e.g. `ext/mysqli`, `ext/pdo`, etc).
5+
The library implements concurrent querying by transparently distributing queries across a scalable pool of available connections. The client transparently distributes these queries across a scalable pool of available connections and does so using 100% userland PHP; there are *no external extension dependencies* (e.g. `ext/mysqli`, `ext/pdo`, etc.).
76

87
## Features
98

10-
- Exposes a non-blocking API for issuing multiple MySQL queries concurrently
11-
- Transparent connection pooling to overcome MySQL's fundamentally synchronous connection protocol
12-
- MySQL transfer encoding support (gzip, TLS encryption)
13-
- *Full* MySQL protocol support including *all*<sup>†</sup> available commands asynchronously
9+
- Exposes a non-blocking API for issuing multiple MySQL queries concurrently
10+
- Transparent connection pooling to overcome MySQL's fundamentally synchronous connection protocol
11+
- MySQL transfer encoding support (gzip, TLS encryption)
12+
- Support for parameterized prepared statements
13+
- Nested transactions with commit and rollback event hooks
14+
- Unbuffered results to reduce memory usage for large result sets
15+
- *Full* MySQL protocol support including *all*<sup>†</sup> available commands asynchronously
1416

1517
<sup>† As documented in [official Mysql Internals Manual](https://dev.mysql.com/doc/internals/en/client-server-protocol.html)</sup>
1618

@@ -22,22 +24,29 @@ This package can be installed as a [Composer](https://getcomposer.org/) dependen
2224
composer require amphp/mysql
2325
```
2426

25-
This package requires PHP 8.1 or later.
27+
## Requirements
28+
29+
- PHP 8.1+
2630

2731
## Usage
2832

2933
More extensive code examples reside in the [`examples`](examples) directory.
3034

3135
```php
32-
$config = Amp\Mysql\MysqlConfig::fromString(
33-
"host=127.0.0.1 user=username password=password db=test"
36+
use Amp\Mysql\MysqlConfig;
37+
use Amp\Mysql\MysqlConnectionPool;
38+
39+
$config = MysqlConfig::fromString(
40+
"host=localhost user=username password=password db=test"
3441
);
3542

36-
$pool = new Amp\Mysql\MysqlConnectionPool($config);
43+
$pool = new MysqlConnectionPool($config);
3744

3845
$statement = $pool->prepare("SELECT * FROM table_name WHERE id = :id");
39-
foreach ($statement->execute(['id' => 1337]) as $row) {
40-
// $row is an associative array of column values. e.g.: $row['column_name']
46+
47+
$result = $statement->execute(['id' => 1337]);
48+
foreach ($result as $row) {
49+
// $row is an associative-array of column values, e.g.: $row['column_name']
4150
}
4251
```
4352

@@ -47,7 +56,7 @@ foreach ($statement->execute(['id' => 1337]) as $row) {
4756

4857
## Security
4958

50-
If you discover any security related issues, please email [`[email protected]`](mailto:[email protected]) instead of using the issue tracker.
59+
If you discover any security related issues, please use the private security issue reporter instead of using the public issue tracker.
5160

5261
## License
5362

0 commit comments

Comments
 (0)