Skip to content

Releases: amphp/sql

2.0.1

23 Nov 16:52
v2.0.1
2a7962d
Compare
Choose a tag to compare

What's Changed

  • Added PHP 8.4 compatibility by @Bilge in #9

New Contributors

  • @Bilge made their first contribution in #9

Full Changelog: v2.0.0...v2.0.1

2.0.0

10 Mar 15:16
v2.0.0
4cf80b4
Compare
Choose a tag to compare

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.

  • Added template types to interfaces for better type expression on implementations and extensions.
  • All classes now start with Sql as a prefix to avoid name collisions with other libraries.
  • Combined ResultSet and CommandResult into a single interface, SqlResult.
  • SqlTransaction now extends SqlLink instead of SqlExecutor to support nested transactions.
  • Added onCommit() and onRollback() methods to SqlTransaction. These methods attach callbacks after the transaction is either committed or rolled back, respectively.
  • Removed the methods 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.
  • 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.
  • SqlTransientResource and now extends Amp\Closable.
  • Added SqlTransactionIsolation and an enum-based implementation, SqlTransactionIsolationLevel.
  • Renamed ConnectionConfig to SqlConfig.
  • Renamed FailureException to SqlException.

2.0.0 Beta 6

12 Dec 23:58
v2.0.0-beta.6
9479805
Compare
Choose a tag to compare
2.0.0 Beta 6 Pre-release
Pre-release

What's Changed

  • The Transaction interface now extends Link, adding nested transaction functionality through beginTransaction() on a transaction object.
  • Added Connection interface with methods to retrieve the config and get/set the current transaction isolation.
  • The 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.
  • Renamed Transaction::getIsolationLevel() to getIsolation().
  • Removed the methods createSavepoint(), rollbackTo(), and releaseSavepont() from Transaction. Use nested transactions through beginTransaction() instead.
  • Added 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

2.0.0 Beta 5

22 Oct 14:27
v2.0.0-beta.5
2cd168c
Compare
Choose a tag to compare
2.0.0 Beta 5 Pre-release
Pre-release

2.0.0 Beta 4

01 May 22:40
v2.0.0-beta.4
2eeb178
Compare
Choose a tag to compare
2.0.0 Beta 4 Pre-release
Pre-release
  • Removed PoolError
  • Updated several docblock types to be non-empty-string instead of string

2.0.0 Beta 3

18 Dec 23:08
v2.0.0-beta.3
1f93ed0
Compare
Choose a tag to compare
2.0.0 Beta 3 Pre-release
Pre-release
  • 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');

1.0.2

18 Dec 23:03
v1.0.2
5a1dcfd
Compare
Choose a tag to compare
  • Fix a deprecation notice on PHP 8.1 if a configuration key does not have a value.

2.0.0 Beta 2

23 Sep 18:21
v2.0.0-beta.2
b2a7d46
Compare
Choose a tag to compare
2.0.0 Beta 2 Pre-release
Pre-release
  • Fix template type restriction in Amp\Sql\Pool.

2.0.0 Beta 1

17 Jul 16:25
v2.0.0-beta.1
226053b
Compare
Choose a tag to compare
2.0.0 Beta 1 Pre-release
Pre-release

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.

  • Added template types to interfaces for better type expression on implementations and extensions.
  • TransientResource now extends Amp\Closable
  • Added TransactionIsolation and an enum-based implementation, TransactionIsolationLevel
  • Combined ResultSet and CommandResult into a single interface, Result
  • Renamed ConnectionConfig to SqlConfig
  • Renamed Connector to SqlConnector
  • Renamed FailureException to SqlException

1.0.1

26 Sep 16:28
0445ac3
Compare
Choose a tag to compare
  • ConnectionConfig::parseConnectionString() will now parse the port from the host, i.e.: host=localhost:3306 will return the array ['host' => 'localhost', 'port' => '3306'].