https://github.com/naftali100/async-orm
https://github.com/naftali100/async-orm
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/naftali100/async-orm
- Owner: naftali100
- Created: 2022-10-31T12:35:48.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-05T00:25:12.000Z (over 3 years ago)
- Last Synced: 2025-02-06T17:43:27.757Z (over 1 year ago)
- Language: PHP
- Size: 59.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# async-orm
async orm lib inspired by [redbean](https://redbeanphp.com)
implements only the basic CURD functionality (no relations atm)
# usage
almost the same as redbean. notice the `yield` every time you do db call
```php
Amp\Loop::run(function(){
yield ORM::connect('127.0.0.1', 'user', 'pass', 'db');
$user = ORM::create('user');
$user->name = 'john';
$userid = yield ROM::store($user);
$same_user = yield ORM::load('user', $userid);
print $same_user->id; // id
print $same_user->name; // john
});
```
## todo
- [x] tests
- [ ] relations
- [ ] fix structure