Closed kelunik closed 6 years ago
Any updates?
Not yet, feel free to make an API suggestion.
$connection = $mysqlPool->getConnection();
$connection->query();
$connection->release();
$connection->beginTransaction();
START TRANSACTION
$connection->commit();
COMMIT
$connection->rollback();
ROLLBACK
$connection = $mysqlPool->beginTransaction();
$mysqlPool->getConnection()
, then $connection->beginTransaction()
, return a ready-to-use connection for transaction.Example Usage:
$connection = $mysqlPool->beginTransaction();
$connection->query("SELECT 1");
$connection->commit();
$connection->release();
or
$connection = $mysqlPool->getConnection();
$connection->beginTransaction();
$connection->query("SELECT 1");
$connection->commit();
$connection->release();
@trowski This has been implemented, no?
@kelunik Yes, it was. See e.g. https://github.com/amphp/mysql/blob/master/examples/6-transaction.php
There should be examples for transactions and probably a dedicated API.