diff --git a/CHANGELOG-7.0.md b/CHANGELOG-7.0.md new file mode 100644 index 0000000..cf1baea --- /dev/null +++ b/CHANGELOG-7.0.md @@ -0,0 +1,78 @@ +# Changelog - Version 7.0 + +## Overview + +Version 7.0 upgrades the underlying persistence stack to `byjg/micro-orm` 7.0 and +`byjg/anydataset-db` 7.0. The AuthUser public API is **unchanged**: `UsersService`, +`UsersRepository`, `UserPropertiesRepository`, models, enums and mapper interfaces keep the exact +same signatures as 6.x. + +Since 6.0 the library was already wired exclusively through `DatabaseExecutor` — the API that +became mandatory in anydataset-db 7.0 — so no library code had to change beyond the dependency +constraints. + +## Breaking Changes + +### Dependencies + +| Package | 6.x | 7.0 | +|---|---|---| +| `byjg/micro-orm` | `^6.0` | `^7.0` | +| `byjg/anydataset-db` (transitive) | `^6.0` | `^7.0` | + +### Removed driver query methods (via anydataset-db 7.0) + +The query methods deprecated on the drivers since anydataset-db 6.0 no longer exist +(`$dbDriver->execute()`, `getIterator()`, `getScalar()`, `executeAndGetId()`, `getAllFields()`). +If your application still calls them on the driver instance it passes to AuthUser, migrate to: + +```php +execute($sql, $params); +``` + +The recommended wiring is unchanged and keeps working as-is: + +```php +=8.3 <8.6", - "byjg/micro-orm": "^6.0", - "byjg/cache-engine": "^6.0", + "byjg/micro-orm": "^7.0", + "byjg/cache-engine": "^7.0", "byjg/jwt-wrapper": "^6.0" }, "require-dev": { - "phpunit/phpunit": "^10.5|^11.5", - "vimeo/psalm": "^5.9|^6.13" + "phpunit/phpunit": "^12.5", + "vimeo/psalm": "^6.13" }, "scripts": { "test": "vendor/bin/phpunit", diff --git a/tests/PasswordMd5MapperTest.php b/tests/PasswordMd5MapperTest.php index 6257082..ab20070 100644 --- a/tests/PasswordMd5MapperTest.php +++ b/tests/PasswordMd5MapperTest.php @@ -25,7 +25,8 @@ class PasswordMd5MapperTest extends TestCase public function setUp(): void { $this->db = Factory::getDbInstance(self::CONNECTION_STRING); - $this->db->execute('create table users ( + $executor = DatabaseExecutor::using($this->db); + $executor->execute('create table users ( userid integer primary key autoincrement, name varchar(45), email varchar(200), @@ -37,7 +38,7 @@ public function setUp(): void role varchar(20));' ); - $this->db->execute('create table users_property ( + $executor->execute('create table users_property ( id integer primary key autoincrement, userid integer, name varchar(45), @@ -45,7 +46,6 @@ public function setUp(): void ); // Create repositories and service with custom MD5 password mapper via UserModelMd5 - $executor = DatabaseExecutor::using($this->db); $usersRepository = new UsersRepository($executor, UserModelMd5::class); $propertiesRepository = new UserPropertiesRepository($executor, UserPropertiesModel::class); $this->service = new UsersService( diff --git a/tests/UsersDBDataset2ByUserNameTestUsersBase.php b/tests/UsersDBDataset2ByUserNameTestUsersBase.php index 25c9687..5622d87 100644 --- a/tests/UsersDBDataset2ByUserNameTestUsersBase.php +++ b/tests/UsersDBDataset2ByUserNameTestUsersBase.php @@ -22,8 +22,9 @@ public function __setUp($loginField) $this->prefix = ""; $this->loginField = $loginField; - $this->db = Factory::getDbRelationalInstance(self::CONNECTION_STRING); - $this->db->execute('create table mytable ( + $this->db = Factory::getDbInstance(self::CONNECTION_STRING); + $executor = DatabaseExecutor::using($this->db); + $executor->execute('create table mytable ( myuserid integer primary key autoincrement, myname varchar(45), myemail varchar(200), @@ -35,14 +36,13 @@ public function __setUp($loginField) myrole varchar(20));' ); - $this->db->execute('create table theirproperty ( + $executor->execute('create table theirproperty ( theirid integer primary key autoincrement, theiruserid integer, theirname varchar(45), theirvalue varchar(45));' ); - $executor = DatabaseExecutor::using($this->db); $usersRepository = new UsersRepository($executor, CustomUserModel::class); $propertiesRepository = new UserPropertiesRepository($executor, CustomUserPropertiesModel::class); $this->object = new UsersService( diff --git a/tests/UsersDBDatasetByUsernameTestUsersBase.php b/tests/UsersDBDatasetByUsernameTestUsersBase.php index 4a5b266..3c9f2e1 100644 --- a/tests/UsersDBDatasetByUsernameTestUsersBase.php +++ b/tests/UsersDBDatasetByUsernameTestUsersBase.php @@ -26,7 +26,8 @@ public function __setUp($loginField) $this->loginField = $loginField; $this->db = Factory::getDbInstance(self::CONNECTION_STRING); - $this->db->execute('create table users ( + $executor = DatabaseExecutor::using($this->db); + $executor->execute('create table users ( userid integer primary key autoincrement, name varchar(45), email varchar(200), @@ -38,14 +39,13 @@ public function __setUp($loginField) role varchar(20));' ); - $this->db->execute('create table users_property ( + $executor->execute('create table users_property ( id integer primary key autoincrement, userid integer, name varchar(45), value varchar(45));' ); - $executor = DatabaseExecutor::using($this->db); $usersRepository = new UsersRepository($executor, UserModel::class); $propertiesRepository = new UserPropertiesRepository($executor, UserPropertiesModel::class); $this->object = new UsersService( diff --git a/tests/UsersDBDatasetDefinitionTest.php b/tests/UsersDBDatasetDefinitionTest.php index e3479d5..de544ca 100644 --- a/tests/UsersDBDatasetDefinitionTest.php +++ b/tests/UsersDBDatasetDefinitionTest.php @@ -38,7 +38,8 @@ public function __setUp($loginField) $this->loginField = $loginField; $this->db = Factory::getDbInstance(self::CONNECTION_STRING); - $this->db->execute('create table mytable ( + $executor = DatabaseExecutor::using($this->db); + $executor->execute('create table mytable ( myuserid integer primary key autoincrement, myname varchar(45), myemail varchar(200), @@ -51,14 +52,13 @@ public function __setUp($loginField) myrole varchar(20));' ); - $this->db->execute('create table theirproperty ( + $executor->execute('create table theirproperty ( theirid integer primary key autoincrement, theiruserid integer, theirname varchar(45), theirvalue varchar(45));' ); - $executor = DatabaseExecutor::using($this->db); $usersRepository = new UsersRepository($executor, MyUserModel::class); $propertiesRepository = new UserPropertiesRepository($executor, MyUserPropertiesModel::class); $this->object = new UsersService(