amphp/sql
Asynchronous SQL client for Amp.
v2.1.1
1.4M downloads/mo
#3766 most downloaded on Packagist
amphp/sql
What this package is like to depend on
Last release 5 months ago
25 Feb 2026
Release timing varies
gaps range from 4 weeks to 2.8 years
Most releases are documented
notes for 5 of 7 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
13 releases · first in 2018
2 releases in the last 12 months
see the full history below
Release timeline
13 releases · Oct 2018 to Feb 2026Releases
latest 13-
v2.1.125 Feb 2026Release notes
Open source →What's Changed
- Fix acceptance of escaped spaces in connection strings
Full Changelog: v2.1.0...v2.1.1
-
v2.1.022 Feb 2026Release notes
Open source →What's Changed
- Added support for quoted strings within connection strings, e.g.
"host=localhost port=5432 options='--client_encoding=UTF8'"
Full Changelog: v2.0.1...v2.1.0
- Added support for quoted strings within connection strings, e.g.
-
v2.0.123 Nov 2024 -
v2.0.010 Mar 2024Release notes
Open source →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 withResolutionType.- Added template types to interfaces for better type expression on implementations and extensions.
- All classes now start with
Sqlas a prefix to avoid name collisions with other libraries. - Combined
ResultSetandCommandResultinto a single interface,SqlResult. SqlTransactionnow extendsSqlLinkinstead ofSqlExecutorto support nested transactions.- Added
onCommit()andonRollback()methods toSqlTransaction. These methods attach callbacks after the transaction is either committed or rolled back, respectively. - Removed the methods
createSavepoint(),rollbackTo(), andreleaseSavepont()fromSqlTransaction. Use nested transactions throughSqlTransaction::beginTransaction()instead. SqlPoolnow extendsSqlConnectioninstead ofSqlLink.SqlPool::extractConnection()returns an instance ofSqlConnectioninstead ofSqlLink.- Added
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. SqlTransientResourceand now extendsAmp\Closable.- Added
SqlTransactionIsolationand an enum-based implementation,SqlTransactionIsolationLevel. - Renamed
ConnectionConfigtoSqlConfig. - Renamed
FailureExceptiontoSqlException.
Release notes
Open source →What's Changed
- The
Transactioninterface now extendsLink, adding nested transaction functionality throughbeginTransaction()on a transaction object. - Added
Connectioninterface with methods to retrieve the config and get/set the current transaction isolation. - The
TransactionIsolationargument ofLink::beginTransaction()has been removed. Transaction isolation is now set on the connection in the newConnectioninterface. Poolnow extendsConnectioninstead ofLink.Pool::extractConnection()returns an instance ofConnectioninstead ofLink.SqlConnector::connect()returns an instance ofConnectioninstead ofLink.- Renamed
Transaction::getIsolationLevel()togetIsolation(). - Removed the methods
createSavepoint(),rollbackTo(), andreleaseSavepont()fromTransaction. Use nested transactions throughbeginTransaction()instead. - Added
onCommit()andonRollback()methods toTransaction. 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
Release notes
Open source →- Removed
PoolError - Updated several docblock types to be
non-empty-stringinstead ofstring
Release notes
Open source →- Added
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');
-
v2.0.0-beta.608 Dec 2023 pre-releaseNothing published for this version
-
v2.0.0-beta.522 Oct 2023 pre-releaseNothing published for this version
-
v2.0.0-beta.416 Jan 2023 pre-releaseNothing published for this version
-
v2.0.0-beta.318 Dec 2022 pre-releaseNothing published for this version
-
v2.0.0-beta.223 Sep 2022 pre-releaseNothing published for this version
-
v2.0.0-beta.117 Jul 2022 pre-releaseNothing published for this version
-
v1.0.218 Dec 2022Release notes
Open source →- Fix a deprecation notice on PHP 8.1 if a configuration key does not have a value.
-
v1.0.126 Sep 2019Nothing published for this version
-
v1.0.013 Oct 2018Nothing published for this version