justim / access
A simple MySQL wrapper optimized for bigger data sets
v1.21.0
2023-12-13 14:55 UTC
Requires
- php: ^8.1
- ext-pdo: *
- psr/clock: ^1.0
Requires (Dev)
- php-coveralls/php-coveralls: ^2.5.2
- phpbench/phpbench: ^1.2.3
- phpstan/phpstan: ^1.2.0
- phpstan/phpstan-phpunit: ^1.0.0
- phpunit/phpunit: ^9.5.11
- psalm/plugin-phpunit: ^0.18.4
- squizlabs/php_codesniffer: ^3.6.2
- symfony/var-dumper: ^6.0.1
- vimeo/psalm: ^5.17
- dev-master
- v1.21.0
- v1.20.0
- v1.19.3
- v1.19.2
- v1.19.1
- v1.19.0
- v1.18.1
- v1.18.0
- v1.17.2
- v1.17.1
- v1.17.0
- v1.16.1
- v1.16.0
- v1.15.3
- v1.15.2
- v1.15.1
- v1.15.0
- v1.14.1
- v1.14.0
- v1.13.1
- v1.13.0
- v1.12.2
- v1.12.1
- v1.12.0
- v1.11.0
- v1.10.1
- v1.10.0
- v1.9.4
- v1.9.3
- v1.9.2
- v1.9.1
- v1.9.0
- v1.8.1
- v1.8.0
- v1.7.2
- v1.7.1
- v1.7.0
- v1.6.1
- v1.6.0
- v1.5.0
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.2
- v1.3.1
- v1.3.0
- v1.2.1
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.0
This package is auto-updated.
Last update: 2024-12-20 10:34:13 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.