justim / access
A simple MySQL wrapper optimized for bigger data sets
v1.23.1
2026-06-02 12:36 UTC
Requires (Dev)
- carthage-software/mago: ^1.29
- guzzlehttp/guzzle: ^7.8
- php-coveralls/php-coveralls: ^2.7
- phpbench/phpbench: ^1.2
- phpunit/phpunit: ^10.5
- psalm/plugin-phpunit: ^0.19.2
- symfony/var-dumper: ^6.4
- vimeo/psalm: ^6.5
This package is auto-updated.
Last update: 2026-06-08 09:07:04 UTC
README
A simple MySQL wrapper optimized for bigger data sets
Quick usage
class User extends Entity { // .. } $db = Database::create('some PDO connection string'); $user = $db->findOne(User::class, 1); $user->setName('Dave'); $db->update($user); $users = $db->findBy(User::class, ['name' => 'Dave']); // uses a generator foreach ($users as $user) { // $user is an instance of User }
Features
- Uses a PDO prepared statement pool for faster queries
- Optimized for bulk queries (ie. easy to fetch collections of collections)
- Easily present your entities as JSON without worrying about n+1 queries
Requirements
- PHP 8.1, or higher
- PDO extension
Installation
- Available at Packagist
composer require justim/access=dev-master
Docs
For now, see the tests for usage.
Nice to have
- For now only MySQL and SQLite is supported, it would be nice to have support for more RDMSs, like Postgres
- Tests are currently run with an in-memory SQLite database, a MySQL database would be better
Final notes
Currently used in a single production product, features are tied to this product.