https://github.com/scrawler-labs/arca-orm
Low code , Zero Configuration ORM that creates models, config, database and tables on the fly.
https://github.com/scrawler-labs/arca-orm
amphp database doctrine doctrine-dbal eloquent-orm mysql orm php sql swoole
Last synced: 4 months ago
JSON representation
Low code , Zero Configuration ORM that creates models, config, database and tables on the fly.
- Host: GitHub
- URL: https://github.com/scrawler-labs/arca-orm
- Owner: scrawler-labs
- License: mit
- Created: 2022-05-24T08:07:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-04-14T14:43:20.000Z (6 months ago)
- Last Synced: 2025-06-05T09:43:40.932Z (4 months ago)
- Topics: amphp, database, doctrine, doctrine-dbal, eloquent-orm, mysql, orm, php, sql, swoole
- Language: PHP
- Homepage: https://component.scrawlerlabs.com/arca-orm/
- Size: 8.39 MB
- Stars: 34
- Watchers: 1
- Forks: 2
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
๐ ARCA ORM
ย
ย
ย
![]()
ย
![]()
๐ฅ Low code , Zero Configuration ORM that creates models, config, database and tables on the fly. ๐ฅ
๐ฎ๐ณ Made in India ๐ฎ๐ณ

Complete documentation can be found [here](http://component.scrawlerlabs.com/arca-orm)
## ๐ค Why use Arca Orm ?
- Automatically creates tables and columns as you go
- No configuration, just fire and forget
- Save loads of time while working on database
- Built upon stable foundation of Doctrine Dbal and extensively tested
- Thanks to [loophp](https://github.com/loophp/collection) Arca comes with Lazy collection and tons of helper collection functions
- Supports lots database platforms , you can see the complete list [here](https://component.scrawlerlabs.com/arca-orm/database/)
- Supports concurrent queries and connection pooling with swoole and async with amphp. Check out integration docs [here](https://component.scrawlerlabs.com/arca-orm/swoole/)## โRequirements
- PHP 8.1 or greater
- PHP PDO or other supported database adapter
- Mysql, MariaDB, Sqlite or any other supported database. check the list [here](https://component.scrawlerlabs.com/arca-orm/database/)
## ๐ป Installation
You can install Arca ORM via Composer. If you don't have composer installed , you can download composer from [here](https://getcomposer.org/download/)```
composer require scrawler/arca
```## ๐ QuickStart
### โจ Setup
```php
'YOUR_DB_NAME',
'user' => 'YOUR_DB_USER',
'password' => 'YOUR_DB_PASSWORD',
'host' => 'YOUR_DB_HOST',
'driver' => 'pdo_mysql', //You can use other supported driver this is the most basic mysql driver
);
$db = \Scrawler\Arca\Facade\Database::connect($connectionParams);//If you dont want to use facade , directly build from factory
$factory = \Scrawler\Arca\Factory\DatabaseFactory()
$db = $factory->build($connectionParams)
```
For complete list of driver check [here](https://component.scrawlerlabs.com/arca-orm/database/)
### โ๏ธ CRUD
```php// Create new record
// The below code will automatically create user table and store the record$user = $db->create('user');
$user->name = "Pranja Pandey";
$user->age = 24
$user->gender = "male"
$user->save()
// Get record with id 1
$user = $db->getOne('user',1);
//Get all records
$users = $db->get('user');
// Update a record
$user = $db->getOne('user',1);
$user->name = "Mr Pranjal";
$user->save();
// Delete a record
$user = $db->getOne('user',1);
$user->delete();```
For complete CRUD documentaion visit [here](https://component.scrawlerlabs.com/arca-orm/crud/)### ๐ Finding data with query
```php// Using where clause
$users = $db->find('user')
->where('name = "Pranjal Pandey"')
->get();
// If where input in unsafe or user defined
$name = "Pranjal"
$users = $db->find('user')
->where('name = ?')
->setParameter(0,$name)
->get();
foreach ($users as $user){
// Some logic here
}
// Get only single record
$users = $db->find('user')
->where('name = "Pranjal Pandey"')
->first();// Using limit in query
$users = $db->find('user')
->setFirstResult(10)
->setMaxResults(20);
->get()```
For complete Query documentaion visit [here](https://component.scrawlerlabs.com/arca-orm/finding/)
## ๐ Supporters
If you have reached here consider giving a star to help this project โค๏ธ
[](https://github.com/scrawler-labs/arca-orm/stargazers)## โ Roadmap
Here is list of few things that i would like to add in upcoming release
- [ ] Models should be extendible with custom models
- [ ] Validations for custom models
- [ ] Automatically create migrations when table is updated or created
- [X] Support eager loading for relations
- [X] Better documentaions## ๐ Similar projects and inspiration
- [Eloquent ORM](https://laravel.com/docs/5.0/eloquent)
- [Redbean PHP](https://redbeanphp.com/index.php)
- [Doctrine ORM](https://www.doctrine-project.org/projects/doctrine-orm/en/2.11/index.html)## ๐ License
Arca ORM is created by [Pranjal Pandey](https://www.github.com/ipranjal) and released under the [Apache 2.0 License](https://github.com/scrawler-labs/arca-orm/blob/main/LICENSE).