scrawler / arca
Arca ORM by Scrawler
v4.1.0
2025-03-03 11:12 UTC
Requires
- php: >=8.1.0
- doctrine/dbal: ^4.0
- dunglas/doctrine-json-odm: ^1.4
- loophp/collection: ^7.5
- php-di/php-di: ^7.0
- ramsey/uuid: ^4.3
- thecodingmachine/safe: ^2.5
Requires (Dev)
- pestphp/pest: ^3.0
- pestphp/pest-plugin-faker: ^3.0
- phpstan/phpstan: ^1.12
- rector/rector: ^1.0
- thecodingmachine/phpstan-safe-rule: ^1.2
- dev-main
- v4.1.0
- v4.0.2
- v4.0.1
- v4.0.0
- v3.4.0
- v3.3.0
- v3.2.0
- v3.1.1
- v3.1.0
- v3.0.0
- v3.0.0-beta1
- v2.1.1
- v2.1.0
- v2.0.0
- v1.1.3
- v1.1.2
- v1.1.1
- v1.1.0
- v1.0.1
- v1.0.0
- dev-dependabot/composer/pestphp/pest-3.7.1
- dev-dependabot/composer/rector/rector-1.2.10
- dev-dependabot/composer/composer-feae8101c0
- dev-dependabot/composer/phpstan/phpstan-1.12.7
- dev-dependabot/composer/doctrine/collections-2.2.2
- dev-renovate/rector-rector-1.x
- dev-renovate/rector-rector-0.x
- dev-renovate/pestphp-pest-plugin-faker-3.x
- dev-renovate/pestphp-pest-3.x
- dev-renovate/squizlabs-php_codesniffer-3.x
- dev-renovate/phpstan-packages
- dev-renovate/phpmd-phpmd-2.x
- dev-renovate/doctrine-collections-2.x
- dev-renovate/loophp-phpunit-iterable-assertions-1.x
- dev-renovate/font-awesome-5.x
This package is auto-updated.
Last update: 2025-03-03 11:17:04 UTC
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
๐ค 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 Arca comes with Lazy collection and tons of helper collection functions
- Supports lots database platforms , you can see the complete list here
- Supports concurrent queries and connection pooling with swoole and async with amphp. Check out integration docs here
โ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
๐ป Installation
You can install Arca ORM via Composer. If you don't have composer installed , you can download composer from here
composer require scrawler/arca
๐ QuickStart
โจ Setup
<?php include './vendor/autoload.php' $connectionParams = array( 'dbname' => '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
โ๏ธ CRUD
// 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
๐ Finding data with query
// 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
๐ Supporters
If you have reached here consider giving a star to help this project โค๏ธ
โ 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
- Support eager loading for relations
- Better documentaions
๐ Similar projects and inspiration
๐ License
Arca ORM is created by Pranjal Pandey and released under the Apache 2.0 License.