Skip to content
Pranjal Pandey edited this page Apr 4, 2023 · 11 revisions

Notice

Documentation have been moved to http://component.scrawlerlabs.com/Arca/

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

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 =  new \Scrawler\Arca\Database($connectionParams);

ID and UUID

using uuid instead of id is a good idea but it may come with some performance issues, uuid even takes up more space than auto increment id. For your usecase if you want to use uuid as primary key instead on auto increment id just do the following

$db->useUUID();

once you have switched to UUID don't switch back to using id as it will cause lot of unwanted issues.

Next Steps

Reaching out

  • If you are stuck or having trouble in documentation fell free to open a issue here
  • You can send me a mail at itspranjalpandey@gmail.com and I would try to reply to you query
  • You can send me tweet at @itspranjalpandey on twitter
  • If you would like to spread the word please do use #arcaorm #scrawler