NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #3579 most downloaded on Packagist
Asynchronous SQL client for Amp.
Latest stable
v2.1.1
Last release 9 months ago
25 Feb 2026
Release timing varies
gaps range from 4 weeks to 2.8 years
Most releases are documented
notes for 6 of 7 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
13 releases · first in 2018
Drag across the ruler to compare, or tap a release to open it.
Fix acceptance of escaped spaces in connection strings
Full Changelog: v2.1.0...v2.1.1
Added support for quoted strings within connection strings, e.g. "host=localhost port=5432 options='--client_encoding=UTF8'"
"host=localhost port=5432 options='--client_encoding=UTF8'"Full Changelog: v2.0.1...v2.1.0
Added PHP 8.4 compatibility by @Bilge in #9
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Full Changelog: https://github.com/amphp/sql/compare/v2.0.0...v2.0.1
Stable release compatible with AMPHP v3 and fibers! 🎉
Stable release compatible with AMPHP v3 and fibers! 🎉
As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType> have been replaced with ResolutionType.
Sql as a prefix to avoid name collisions with other libraries.ResultSet and CommandResult into a single interface, SqlResult.SqlTransaction now extends SqlLink instead of SqlExecutor to support nested transactions.onCommit() and onRollback() methods to SqlTransaction. These methods attach callbacks after the transaction is either committed or rolled back, respectively.createSavepoint(), rollbackTo(), and releaseSavepont() from SqlTransaction. Use nested transactions through SqlTransaction::beginTransaction() instead.SqlPool now extends SqlConnection instead of SqlLink. SqlPool::extractConnection() returns an instance of SqlConnection instead of SqlLink.SqlResult::fetchRow(), which will return a single row (associative array) from the result set on each call until no further rows remain in the result.SqlTransientResource and now extends Amp\Closable.SqlTransactionIsolation and an enum-based implementation, SqlTransactionIsolationLevel.ConnectionConfig to SqlConfig.FailureException to SqlException.Transaction interface now extends Link, adding nested transaction functionality through beginTransaction() on a transaction object.Connection interface with methods to retrieve the config and get/set the current transaction isolation.TransactionIsolation argument of Link::beginTransaction() has been removed. Transaction isolation is now set on the connection in the new Connection interface.Pool now extends Connection instead of Link. Pool::extractConnection() returns an instance of Connection instead of Link.SqlConnector::connect() returns an instance of Connection instead of Link.Transaction::getIsolationLevel() to getIsolation().createSavepoint(), rollbackTo(), and releaseSavepont() from Transaction. Use nested transactions through beginTransaction() instead.onCommit() and onRollback() methods to Transaction. These methods attach callbacks when the transaction is either committed or rolled back, respectively.Full Changelog: v2.0.0-beta.5...v2.0.0-beta.6
PoolErrornon-empty-string instead of stringResult::fetchRow(), which will return a single row (associative array) from the result set on each call until no further rows remain in the result.// Iterate over result rows with a simple while loop
while ($row = $result->fetchRow()) {
// ...
}
// Also useful if you know your result will contain only a single row
$id = $result->fetchRow()['id'] ?? throw new Exception('Item not found');The Transaction interface now extends Link, adding nested transaction functionality through beginTransaction() on a transaction object.
Transaction interface now extends Link, adding nested transaction functionality through beginTransaction() on a transaction object.Connection interface with methods to retrieve the config and get/set the current transaction isolation.TransactionIsolation argument of Link::beginTransaction() has been removed. Transaction isolation is now set on the connection in the new Connection interface.Pool now extends Connection instead of Link. Pool::extractConnection() returns an instance of Connection instead of Link.SqlConnector::connect() returns an instance of Connection instead of Link.Transaction::getIsolationLevel() to getIsolation().createSavepoint(), rollbackTo(), and releaseSavepont() from Transaction. Use nested transactions through beginTransaction() instead.onCommit() and onRollback() methods to Transaction. These methods attach callbacks when the transaction is either committed or rolled back, respectively.Full Changelog: https://github.com/amphp/sql/compare/v2.0.0-beta.5...v2.0.0-beta.6
Fixed return type by @danog in https://github.com/amphp/sql/pull/8
Updated several docblock types to be non-empty-string instead of string
PoolErrornon-empty-string instead of stringAdded Result::fetchRow(), which will return a single row (associative array) from the result set on each call until no further rows remain in the resu
Result::fetchRow(), which will return a single row (associative array) from the result set on each call until no further rows remain in the result.// Iterate over result rows with a simple while loop
while ($row = $result->fetchRow()) {
// ...
}
// Also useful if you know your result will contain only a single row
$id = $result->fetchRow()['id'] ?? throw new Exception('Item not found');
Fix template type restriction in Amp\Sql\Pool.
Amp\Sql\Pool.Initial release compatible with AMPHP v3.
Initial release compatible with AMPHP v3.
As with other libraries compatible with AMPHP v3, most cases of parameters or returns of Promise<ResolutionType> have been replaced with ResolutionType.
TransientResource now extends Amp\ClosableTransactionIsolation and an enum-based implementation, TransactionIsolationLevelResultSet and CommandResult into a single interface, ResultConnectionConfig to SqlConfigConnector to SqlConnectorFailureException to SqlExceptionFix a deprecation notice on PHP 8.1 if a configuration key does not have a value.
ConnectionConfig::parseConnectionString() will now parse the port from the host, i.e.: host=localhost:3306 will return the array ['host' => 'localhost
ConnectionConfig::parseConnectionString() will now parse the port from the host, i.e.: host=localhost:3306 will return the array ['host' => 'localhost', 'port' => '3306'].Nothing published for this version
One column per quarter.