Skip to content

1.0.0

Choose a tag to compare

@trowski trowski released this 14 Oct 16:15
6306f4f

The interface structure of this library changed significantly, however most consumers of this library should be able to upgrade from v0.2.x by only updating the code initializing a connection or pool to use an instance of ConnectionConfig instead of a connection string. Using a connection or pool to perform queries has remained unchanged since v0.2.x, with the exception that transactions are now started with Link::beginTransaction() instead of Link::transaction().

  • Prepared statements now support ? and named placeholders (e.g.: SELECT * FROM people WHERE name = :name). Named placeholders are used by providing an array with keys matching the placeholders: $statement->execute(['name' => $name]).
  • The fetch-type parameter has been removed from ResultSet::getCurrent(). All rows are always returned as associate arrays.
  • Table data that is scalar or an array are automatically cast to the appropriate PHP type when using ext-pgsql. This matches the behavior when using pecl-pq.
  • Common interfaces such as Statement and Pool that are shared with amphp/mysql are now in a separate library, amphp/sql.
  • ConnectionConfig is now built with a list of parameters instead of a connection string. Use ConnectionConfig::fromString() to use a connection string.
  • Statements created in a pool are cached and reused if the same statement is prepared or executed again.
  • The Operation interface has been dropped in favor of decorators. This interface was internally used to automatically free resources on destruction.

Please review the interfaces in amphp/sql to ensure no other interface changes or method renames may affect your code.