1.0.0
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 usingpecl-pq. - Common interfaces such as
StatementandPoolthat are shared withamphp/mysqlare now in a separate library,amphp/sql. ConnectionConfigis now built with a list of parameters instead of a connection string. UseConnectionConfig::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
Operationinterface 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.