mirror of
https://github.com/danog/AsyncOrm.git
synced 2024-11-26 12:24:59 +01:00
.vscode | ||
docs | ||
examples | ||
src | ||
tests | ||
.gitattributes | ||
.gitignore | ||
.php-cs-fixer.dist.php | ||
composer.json | ||
infection.json5 | ||
LICENSE | ||
NOTICE | ||
phpunit.xml | ||
psalm.xml | ||
README.md |
Async ORM
Async ORM based on amphp, created by Daniil Gentili daniil@daniil.it and Alexander Pankratov alexander@i-c-a.su.
Supports MySQL, Redis, Postgres.
Features read and write-back caching, type-specific optimizations, and much more!
Installation
composer require danog/async-orm
Usage
There are two main ways to use the ORM: through automatic ORM properties, which automatically connects appropriately marked DbArray
properties to the specified database, or by manually instantiating a DbArray
with a DbArrayBuilder
.
The DbArray
obtained through one of the methods above is an abstract array object that automatically stores and fetches elements from the specified database.
/** @var DbArray<TKey, TValue> $arr */
$value = $arr[$key];
$arr[$key] = $newValue;
if (isset($arr[$otherKey])) {
// Some logic
unset($arr[$otherKey]);
}
API Documentation
Click here » to view the API documentation.