Registry / database / amphp-mysql

amphp-mysql

JSON →
library3.1.1phppackagistunverified

Asynchronous MySQL client for PHP based on Amp.

composer require amphp/mysql
INSTALL
IMPORT
SIG · AMPHP-MYSQL
A
amphp-mysql
databasephpv3.1.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Connection
use Amp\Mysql\Connection;

Execute an asynchronous MySQL query

use Amp\Mysql\Connection; $connection = Connection::connect('host=localhost;user=root;password=secret;dbname=test'); $result = yield $connection->query('SELECT * FROM users'); while (yield $result->advance()) { $row = $result->getCurrent(); echo $row['name']; }
Debug
Known issues
breakingRequires the Amp event loop to run; not compatible with synchronous code.
fix
Wrap usage in Amp\Loop::run() or use a coroutine.
affects: >=3.0.0
Upgrade
Version history
3.1.1latest on Packagist
Audit
Dependencies

No dependency data recorded yet.

Agent activity
39 hits · last 30 days
node
34
Amazon
1
Resources
amphp-mysql — pip install amphp-mysql · libregistry