access

A simple MySQL wrapper optimized for bigger data sets

MIT License

Downloads
743
Stars
1
Committers
3

Bot releases are hidden (Show)

access - Nested transactions + filter clauses Latest Release

Published by justim over 2 years ago

Nested transactions

  • Inner transactions will use savepoints to roll back to

Filter clauses

  • Filter the presentation markers in a declarative way

Full Changelog: https://github.com/justim/access/compare/v1.16.1...v1.17.0

access - Improved generic typings + clauses for multiple

Published by justim over 2 years ago

Improved generic typings

  • This gives a better usage of the helper methods of collection
  • The presenter now better understands what entity it is dealing with
  • Start linting tests to give better insight

Rework how multiple entities are handled in presenters

  • Removal of workaround for broken JSON responses
  • Clauses to presentMultiple

Full Changelog: https://github.com/justim/access/compare/v1.15.3...v1.16.0

access - Rework query conditions + PHP 8.0

Published by justim almost 3 years ago

Rework query conditions

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.

Updated PHP dependency

From this release forward the minimal required PHP version is 8.0.

access - Allow entities to be passed as a value

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,
]);
access - Convert entities with presenters

Published by justim over 4 years ago

New features

  • Presenters: Easily present your entities as JSON without worrying about n+1 queries
  • Filter method on collections

Changes

  • Use prettier to format all code
access - Grouped collections

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

access - Subqueries, locks and more

Published by justim almost 5 years ago

New features:

  • Subqueries in virtual fields
  • Simple lock mechanism
  • Add hydration times to profile
  • A couple more helper methods for collections

Changes:

  • Add support for where statements with same condition
access - Transactions and more

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

access - Blackhole profiler

Published by justim over 5 years ago

access - Initial release

Published by justim over 5 years ago

Package Rankings
Top 22.96% on Packagist.org
Badges
Extracted from project README
Coverage Status