-
Notifications
You must be signed in to change notification settings - Fork 2
7. Using with Swoole and Amphp
Pranjal Pandey edited this page Jun 1, 2022
·
1 revision
If you are interested in using Arca ORM with Async libraries there are various drivers available for same. Here are example for usage
Scrawler Labs provide a integration for swoole Postgres here
composer require scrawler/swoole-postgresql-doctrine
Use the following configuration during setup
<?php
include './vendor/autoload.php'
$connectionParams = array(
'dbname' => 'YOUR_DB_NAME',
'user' => 'YOUR_DB_USER',
'password' => 'YOUR_DB_PASSWORD',
'host' => 'YOUR_DB_HOST',
'driverClass' =>\Scrawler\Swoole\PostgreSQL\Driver::class,
'poolSize' => 8, //you can set pool size to any number of parallel connection your db can support
);
$db = new \Scrawler\Arca\Database($connectionParams);
To know about using Co-routines please check readme here
You can use amphp with ARCA ORM using there official mysql-dbal implementation
composer require amphp/mysql-dbal
Use the following configuration during setup
<?php
include './vendor/autoload.php'
$connectionParams = array(
'driverClass' => \Amp\Mysql\DBAL\MysqlDriver::class,
'user' => 'YOUR_DB_USER',
'password' => 'YOUR_DB_PASSWORD',
'dbname' => 'YOUR_DB_NAME',
'host' => 'YOUR_DB_HOST'
);
$db = new \Scrawler\Arca\Database($connectionParams);
Something is missing? Have a suggestion? Feel free to open issue here