diff --git a/CHANGELOG.md b/CHANGELOG.md index 72110f6..f92778e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,44 +4,59 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [Unreleased] +## [6.3.0] - 2024-10-05 +### Changed +- Use `mysqli_stmt::get_result()` instead of `bind_result()` internally +to slightly improve performance and reduce memory usage. + +### Deprecated +- Unnecessary getter methods (in `InsertResult`, `BulkInsertResult`, `SqlParams`, and `SqlException`). + ## [6.2.0] - 2022-03-14 ### Added - Support for empty bulk insert queries (previously an error was thrown). + ## [6.1.0] - 2021-12-15 ### Added -- Shorthand `select` method which takes a `SqlParams` object to allow +- Shorthand `select()` method which takes a `SqlParams` object to allow bound params in the base select query. - Support for MySQL exception error handling mode (default in PHP 8.1). + ## [6.0.3] - 2021-08-06 ### Changed - Improved type declarations for static analysis. + ## [6.0.2] - 2021-02-11 ### Changed - Specified additional types and enabled Psalm static analysis. - PHP 7.4+ is now required. + ## [6.0.1] - 2019-08-05 ### Changed - Implemented missing return type declarations. - Excluded additional test files from production bundle. + ## [6.0.0] Deprecation Elimination - 2019-01-16 ### Added - Scaler and return type declarations. ### Removed - Support for HHVM as well as PHP versions prior to 7.1. -- Unnecessary `$maximum` parameter from `Selector::offset` method. +- Unnecessary `$maximum` parameter from `Selector::offset()` method. - All previously-deprecated methods and options. + ## [5.5.1] Differentiated Bit - 2017-11-09 ### Added -- Support for using `makeBinaryParam` with nullable columns (issue [#5]). +- Support for using `makeBinaryParam()` with nullable columns +(issue [#5](https://github.com/theodorejb/peachy-sql/issues/5)). + ## [5.5.0] Null Appreciation - 2017-10-19 ### Added @@ -51,38 +66,43 @@ is not null. ### Deprecated - Ability to use null values with `eq` and `ne` operators. + ## [5.4.0] Boolean Affectation - 2017-03-08 ### Added -- `makeBinaryParam` method. +- `makeBinaryParam()` method. ### Fixed -- `Statement::getAffected` method now consistently returns -1 when no +- `Statement::getAffected()` method now consistently returns -1 when no affected count is available. - "Incorrect integer value" MySQL error when binding a false value. + ## [5.3.1] Deprecation Proclamation - 2017-01-31 ### Changed -- Updated readme to document `offset` method instead of deprecated -`paginate` method. +- Updated readme to document `offset()` method instead of deprecated +`paginate()` method. ### Deprecated -- Unnecessary option getter/setter methods (`setTable`, `getTable`, -`setAutoIncrementValue`, `getAutoIncrementValue`, `setIdColumn`, -`getIdColumn`). +- Unnecessary option getter/setter methods (`setTable()`, `getTable()`, +`setAutoIncrementValue()`, `getAutoIncrementValue()`, `setIdColumn()`, +`getIdColumn()`). + ## [5.3.0] Descending Increase - 2016-11-04 ### Added -- `Selector::offset` method to enable setting an offset that isn't a +- `Selector::offset()` method to enable setting an offset that isn't a multiple of the page size. ### Deprecated -- `Selector::paginate` method. +- `Selector::paginate()` method. + ## [5.2.3] Protracted Refinement - 2016-08-28 ### Added - Support for generating filters with IS NOT NULL and multiple LIKE operators. + ## [5.2.2] Chainable Reparation - 2016-08-25 ### Changed - Updated dependencies and removed unused code. @@ -90,6 +110,7 @@ operators. ### Fixed - Return type of `Selector` functions to support subclass autocompletion. + ## [5.2.1] Simple Safety - 2016-07-21 ### Changed - An exception is now thrown when attempting to use pagination without @@ -97,18 +118,19 @@ sorting rows. - Qualified column identifiers are now automatically escaped. As a consequence, column names containing periods are no longer supported. + ## [5.2.0] Intermediate Injection - 2016-07-07 ### Added -- `selectFrom`, `insertRow`, `insertRows`, `updateRows`, and `deleteFrom` +- `selectFrom()`, `insertRow()`, `insertRows()`, `updateRows()`, and `deleteFrom()` methods which can be passed a table name rather than depending on options passed to the PeachySQL constructor. This simplifies dependency injection and also removes the need for implementation-specific options. The new -`selectFrom` method also supports pagination and more complex -sorting/filtering. +`selectFrom()` method also supports pagination and more complex sorting/filtering. ### Deprecated -- Old shorthand methods (`select`, `insertBulk`, `insertOne`, `update`, -and `delete`) +- Old shorthand methods (`select()`, `insertBulk()`, `insertOne()`, `update()`, +and `delete()`) + ## [5.1.0] Futuristic Resourcefulness - 2016-04-15 ### Changed @@ -122,10 +144,11 @@ and `delete`) ### Removed - HHVM generator compatibility hack (no longer necessary as of HHVM v3.11). + ## [5.0.0] Escaping Execution - 2015-09-16 ### Added -- `prepare` method which binds parameters and returns a `Statement` -object. This object has an `execute` method which makes it possible +- `prepare()` method which binds parameters and returns a `Statement` +object. This object has an `execute()` method which makes it possible to run the prepared query multiple times with different values. ### Changed @@ -137,56 +160,62 @@ This object has setters and getters for each setting, which improves discoverability and refactoring. ### Removed -- `setConnection` and `setOptions` methods. Options can still be +- `setConnection()` and `setOptions()` methods. Options can still be dynamically changed by calling `getOptions()->setterMethod()`. ### Fixed - Bug where MySQL insert IDs weren't calculated correctly if the increment value was altered. + ## [4.0.2] Preparatory Fixture - 2015-05-11 ### Fixed -- Missing error info for MySQL prepared statement failures (issue [#4]). +- Missing error info for MySQL prepared statement failures +(issue [#4](https://github.com/theodorejb/peachy-sql/issues/4)). ### Removed -- Unnecessary `SqlResult::getQuery` method. +- Unnecessary `SqlResult::getQuery()` method. + ## [4.0.1] Stalwart Sparkle - 2015-02-08 ### Changed - Unused code cleanup - Documentation improvements + ## [4.0.0] Economical Alternator - 2015-02-06 ### Added -- `SqlResult::getIterator` method which returns a `Generator`, making +- `SqlResult::getIterator()` method which returns a `Generator`, making it possible to iterate over very large result sets without running into memory limitations. -- Optional third parameter on `select` method which accepts an array of +- Optional third parameter on `select()` method which accepts an array of column names to sort by in ascending order. -- `SqlException::getSqlState` method which returns the standard SQLSTATE +- `SqlException::getSqlState()` method which returns the standard SQLSTATE code for the failure. ### Changed -- `SqlException::getMessage` now includes the SQL error message for the +- `SqlException::getMessage()` now includes the SQL error message for the failed query. -- `SqlException::getCode` now returns the MySQL or SQL Server error code. +- `SqlException::getCode()` now returns the MySQL or SQL Server error code. ### Removed - PHP 5.4 support (5.5+ is now required - recent versions of HHVM should also work if using MySQL). -- Deprecated `insert` and `insertAssoc` methods. +- Deprecated `insert()` and `insertAssoc()` methods. - Deprecated `TSQL` class. -- Ability to call `SqlResult::getFirst` and `SqlResult::getAll` multiple +- Ability to call `SqlResult::getFirst()` and `SqlResult::getAll()` multiple times for a given result (since rows are no longer cached in the object). + ## [3.0.1] Uniform Optimization - 2014-12-06 ### Changed - Improved documentation consistency - Minor code cleanup and performance tweaks + ## [3.0.0] Hyperactive Lightyear - 2014-12-02 ### Added -- `insertOne` and `insertBulk` methods, which accept an associative array +- `insertOne()` and `insertBulk()` methods, which accept an associative array of columns/values and return `InsertResult` and `BulkInsertResult` objects, respectively. - It is now possible to bulk-insert an arbitrarily large set of rows. @@ -202,33 +231,35 @@ The following classes have been renamed to improve API consistency: - `SQLResult` is now `SqlResult` - `MySQLResult` is now `MysqlResult` -Since class and function names in PHP are case insensitive (as are file +Since class and function names in PHP are case-insensitive (as are file names on some platforms), these renames do not necessarily break backwards compatibility. However, existing references should still be updated to avoid confusion. ### Deprecated -- `insertAssoc` method - use `insertOne` instead. -- `insert` method - use `insertBulk` instead. +- `insertAssoc()` method - use `insertOne()` instead. +- `insert()` method - use `insertBulk()` instead. - `TSQL` class - use `SqlServer` instead. ### Removed -- Previously deprecated `SqlResult::getRows` method. -- Optional callback parameters from `query` and shorthand methods. +- Previously deprecated `SqlResult::getRows()` method. +- Optional callback parameters from `query()` and shorthand methods. + ## [2.1.0] Progressive Substitution - 2014-08-03 ### Added -- `SQLResult::getFirst` method for retrieving the first selected row. -- `SQLResult::getAll` method for retrieving all selected rows. +- `SQLResult::getFirst()` method for retrieving the first selected row. +- `SQLResult::getAll()` method for retrieving all selected rows. ### Deprecated -- `SQLResult::getRows` is now a deprecated alias of `SQLResult::getAll`. +- `SQLResult::getRows()` is now a deprecated alias of `SQLResult::getAll()`. + ## [2.0.0] Peachy Sequel - 2014-07-29 ### Added -- `begin`, `commit`, and `rollback` methods to support transactions. -- `insertAssoc` method to easily insert a single row from an associative array. -- `setConnection` method to change the database connection after instantiation. +- `begin()`, `commit()`, and `rollback()` methods to support transactions. +- `insertAssoc()` method to easily insert a single row from an associative array. +- `setConnection()` method to change the database connection after instantiation. - Option to override the default auto increment value for MySQL. - Custom `PeachySQL\SQLException` thrown for query errors, with methods to retrieve the error array, SQL query string, and bound parameters. @@ -237,9 +268,9 @@ to retrieve the error array, SQL query string, and bound parameters. ### Changed - The library is now namespaced under `PeachySQL`. - Callbacks for shorthand methods are now optional. If no callback is -specified, the methods will return sensible defaults (e.g. `select` -returns selected rows, `insert` returns insert IDs, and `update` and -`delete` return the number of affected rows). +specified, the methods will return sensible defaults (e.g. `select()` +returns selected rows, `insert()` returns insert IDs, and `update()` and +`delete()` return the number of affected rows). - A list of valid columns must now be passed to the options array to generate queries which reference a column. This allows queries to be generated from user data without the potential for SQL injection attacks. @@ -247,18 +278,18 @@ generated from user data without the potential for SQL injection attacks. arguments for selected and affected rows. - Table name and identity column options are now passed to the constructor as an associative array. -- If a flat array of values is passed to `insert`, the insert ID will +- If a flat array of values is passed to `insert()`, the insert ID will now be returned as an integer instead of an array. -- Updated code to follow the PSR-2 [coding style guide](http://www.php-fig.org/psr/psr-2/). +- Updated code to follow the [PSR-2 coding style guide](http://www.php-fig.org/psr/psr-2/). ### Removed - `$dbType` argument from constructor (use `new PeachySQL\MySQL($conn)` or `new PeachySQL\TSQL($conn)` instead). -- `getTableName` and `setTableName` methods (replaced with `getOptions` -and `setOptions`). -- `$idCol` parameter from `insert` method (specify via options array +- `getTableName()` and `setTableName()` methods (replaced with `getOptions()` +and `setOptions()`). +- `$idCol` parameter from `insert()` method (specify via options array instead if using SQL Server). -- `splitRows` method (not core to PeachySQL's goal). The same functionality is +- `splitRows()` method (not core to PeachySQL's goal). The same functionality is available in the [ArrayUtils library](https://github.com/theodorejb/array-utils). ## Fixed @@ -266,6 +297,7 @@ available in the [ArrayUtils library](https://github.com/theodorejb/array-utils) auto-incremented column. - Errors are now thrown if required table/column names aren't specified. + ## [1.1.1] - 2014-04-20 ### Fixed - Bug where additional (non-existent) insert IDs were returned when @@ -274,24 +306,28 @@ inserting a single row into a MySQL table with a flat array. ### Removed - Unnecessary usage of variable variables. + ## [1.1.0] - 2014-04-11 ### Changed -- The `query`, `select`, `insert`, `update`, and `delete` methods now +- The `query()`, `select()`, `insert()`, `update()`, and `delete()` methods now return the value of their callback function, making it easier to use data outside the callback. -- A flat array of values can now be passed to the `insert` method to +- A flat array of values can now be passed to the `insert()` method to insert a single row. + ## [1.0.1] - 2014-03-28 ### Changed -- Simplified `splitRows` example in readme. +- Simplified `splitRows()` example in readme. - Short array syntax is now used consistently. - Minor unit test improvements. + ## [1.0.0] - 2014-02-20 - Initial release -[Unreleased]: https://github.com/theodorejb/peachy-sql/compare/v6.2.0...HEAD + +[6.3.0]: https://github.com/theodorejb/peachy-sql/compare/v6.2.0...v6.3.0 [6.2.0]: https://github.com/theodorejb/peachy-sql/compare/v6.1.0...v6.2.0 [6.1.0]: https://github.com/theodorejb/peachy-sql/compare/v6.0.3...v6.1.0 [6.0.3]: https://github.com/theodorejb/peachy-sql/compare/v6.0.2...v6.0.3 @@ -320,6 +356,3 @@ insert a single row. [1.1.0]: https://github.com/theodorejb/peachy-sql/compare/v1.0.1...v1.1.0 [1.0.1]: https://github.com/theodorejb/peachy-sql/compare/v1.0.0...v1.0.1 [1.0.0]: https://github.com/theodorejb/peachy-sql/tree/v1.0.0 - -[#5]: https://github.com/theodorejb/peachy-sql/issues/5 -[#4]: https://github.com/theodorejb/peachy-sql/issues/4