PHP code example of crowdstar / vertica-swoole-adapter
1. Go to this page and download the library: Download crowdstar/vertica-swoole-adapter library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
crowdstar / vertica-swoole-adapter example snippets
use CrowdStar\VerticaSwooleAdapter\VerticaAdapter;
use CrowdStar\VerticaSwooleAdapter\VerticaProxy;
use Swoole\ConnectionPool;
$pool = new ConnectionPool(
function () {
return new VerticaAdapter($config);
},
ConnectionPool::DEFAULT_SIZE,
VerticaProxy::class
);
/** @var VerticaAdapter $conn */
$conn = $pool->get();
$data = $conn->fetchAll($conn->query($sql)) ?: [];
$pool->put($conn);
bash
docker exec -ti $(docker ps -qf "name=app") ./examples/example.php
docker exec -ti $(docker ps -qf "name=app") ./examples/benchmark.php
docker exec -ti $(docker ps -qf "name=app") ./examples/test-coroutine-capability.php