Releases: rotexsoft/leanorm
Major Minor Release
-
Updated the logic for calculating number of deleted records in deleteMatchingDbTableRows(array $cols_n_vals): int in the Model class
- Now using a select count(*) with the same where conditions as the delete statement to get the count of matching values before and after executing the delete statement and then returning the difference of these values
- The old method relied on PDOStatement::rowCount() which seems to have different behaviors for Sqlite & PostgreSQL under certain conditions
- see https://www.php.net/manual/en/pdostatement.rowcount.php
- public PDOStatement::rowCount(): int
- This method returns "0" (zero) with the SQLite driver at all times, and with the PostgreSQL driver only when setting the PDO::ATTR_CURSOR statement attribute to PDO::CURSOR_SCROLL.
- public PDOStatement::rowCount(): int
- see https://www.php.net/manual/en/pdostatement.rowcount.php
-
ReadOnlyRecord
- protected function throwNotSupportedException($function_name): void
- is now
- protected function throwNotSupportedException(string $function_name): void
-
Documentation updates
Full Changelog: 2.2.5...2.3.0
Major Minor Release
- Documentation updates
- All queries generated by LeanOrm now strictly use named parameters / place-holders, which means all users of this library must use named parameters / place-holders in all their queries as PDO does not allow mixing and matching named parameters / place-holders & question-mark place-holders
- The Model, Collection & Record classes now explicitly implement \Stringable
Full Changelog: 4.0.1...4.1.0
Minor Release
- Updated documentation
- Updated dev depndencies
Full Changelog: 4.0.0...4.0.1
New Major Release
- Bumped min PHP version to PHP 8.1
- Now using version 3.0+ of rotexsoft/gdao which is more strictly typed
- Switched from aura/sqlschema to rotexsoft/sqlschema
- Now using psr/log ^2.0.0 || ^3.0.0
- Added ./run-tests-against-multiple-db-versions.php, a script for testing the package against multiple versions of MariaDB, MySQL & Postgres
- Added more strict typing across the code base
- Moved all exception classes to an Exceptions sub-folder & they are all in the \LeanOrm\Exceptions namespace
- No longer using atlas/info for fetching db meta-data
- Most methods that return self now return static
- removeRecord(\GDAO\Model\RecordInterface $record): static has been added to the Collection class
Full Changelog: 3.0.2...4.0.0
Under the hood optimizations
Full Changelog: 3.0.1...3.0.2
Maintenance Release
- Added
- \LeanOrm\Model::fetchOneByPkey($id, array $relations_to_include = []): ?\GDAO\Model\RecordInterface
- and \LeanOrm\Model\Collection::getData(): array
Full Changelog: 3.0.0...3.0.1
Maintenance Release
- Added
- \LeanOrm\Model::fetchOneByPkey($id, array $relations_to_include = []): ?\GDAO\Model\RecordInterface
- and \LeanOrm\Model\Collection::getData(): array
Full Changelog: 2.2.4...2.2.5
New Major Release
- Updated the aura/sqlquery dependency to the latest version 3.0.0+
- Deprecated Utils::search2D(...) in 2.X has been removed in this version
- Apart from the two changes above, I will strive to maintain the same features across the latest 2.X & 3.X version
- The next version 4.X will have a minimum requirement of PHP 8.1. 2.X & 3.X both require a minimum of PHP 7.4
Full Changelog: 2.2.4...3.0.0
Performance Improvements
- More improvement of algorithm for stitching eager fetched related data into parent records.
Full Changelog: 2.2.3...2.2.4
Performance Improvements
-
Improved algorithm for stitching eager fetched related data into parent records.
- Will reduce run-time with very large data sets.
- It was taking about 30 seconds to load 10K Author Records together with approx 50K Post Records. After the enhancement, it now takes about 3 seconds to load the same amount of data.
- See https://github.com/rotexdegba/benchmarkorms/blob/main/index.php
-
If the table_cols array is pre-populated with a table / view column meta data array in a Model class, the Model constructor will no longer query the info schema for table column metadata, thereby reducing the number of run time sql queries. It is up to the developer to make sure future modifications to the table / view columns are reflected in the hard-coded array in the appropriate Model classes.
- This enhancement is related to the new option in the cli tool to allow generating a metadata array file during Model, Record & Collection class generation. See https://github.com/rotexsoft/leanorm-cli/releases/tag/1.0.8
-
Deprecated Utils::search2D as it's no longer used anywhere in the package, will be removed in version 3.0.0
Full Changelog: 2.2.2...2.2.3