scrawler/arca
Composer 安装命令:
composer require scrawler/arca
包简介
Arca ORM by Scrawler
README 文档
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.
scrawler/arca 适用场景与选型建议
scrawler/arca 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 348 次下载、GitHub Stars 达 34, 最近一次更新时间为 2022 年 05 月 24 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 scrawler/arca 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 scrawler/arca 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 348
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 34
- 点击次数: 10
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2022-05-24
