A simple MySQL wrapper optimized for bigger data sets
MIT License
Bot releases are visible (Hide)
Full Changelog: https://github.com/justim/access/compare/v1.16.1...v1.17.0
Published by justim over 2 years ago
presentMultiple
Full Changelog: https://github.com/justim/access/compare/v1.15.3...v1.16.0
Published by justim almost 3 years ago
A rework of the query condition internals allows for a new external API as well:
$query = new Query\Select(User::class);
$query->where(Equals('id', 4));
These are the same conditions that are already in use in the presenters, for additional query clauses when selecting data.
The main reason this is helpful for queries is that it is now possible to use multiple conditions with multiple placeholders. The following indicates a query that was not previously possible:
$query = new Query\Select(User::class);
$query->whereOr([
'first_name = ? AND last_name = ?' => 'Dave', // second placeholder is not possible
'is_admin = ?' => true,
]);
With the new conditions API it is now possible:
$query = new Query\Select(User::class);
$query->where(new MultipleOr(
new Multiple(
new Equals('first_name = ?', 'Dave'),
new Equals('last_name = ?', 'Johnny'), // second placeholder is now possible
),
new Equals('is_admin = ?', true),
));
The new API is very much optional and the string like interface still works as expected and is converted to the conditions automatically internally.
From this release forward the minimal required PHP version is 8.0.
Published by justim about 4 years ago
This makes it a bit easier to build queries and select entities
This is now allowed:
// finder methods
$repo->findBy([
// an entity `Entity`
'id' => $user,
// a collection `Collection`
'id' => $users,
]);
// query builder
$query->innerJoin(SomeEntity::class, [
'other_table.user_id = ?' => $user,
]);
Published by justim over 4 years ago
New features
Changes
Published by justim over 4 years ago
Use GroupedCollection
instead of plain array, this makes type-hinting a lot easier and maybe some nice feature in the future
Published by justim almost 5 years ago
New features:
Changes:
Published by justim almost 5 years ago
New in this release:
Transactions:
$transaction = $db->beginTransaction();
// your fancy insert/update queries
$transaction->commit();
// or
$transaction->rollBack();
// make sure to either commit or roll back, otherwise an exception is thrown
More type information with Psalm
Small setup with a single benchmark
A new save
method if you don't want to think about choosing between insert
and update
Published by justim over 5 years ago
Published by justim over 5 years ago