ytake / voltdb-client-wrapper
voltdb client wrapper
Fund package maintenance!
ytake
Requires
- php: >=5.4.0
- ext-curl: *
Requires (Dev)
- mockery/mockery: 0.9.*
- phpunit/phpunit: 4.*
- satooshi/php-coveralls: dev-master
Suggests
- ext-voltdb: Required for VoltClient. use extension https://github.com/VoltDB/voltdb-client-php/tree/native
This package is auto-updated.
Last update: 2024-12-04 23:28:10 UTC
README
voltdb client wrapper / json interface support.
required extension
curl
suggest
voltdb-client-php(native branch)
#Install
"require": { "php": ">=5.4.0", "ext-curl": "*", "ext-voltdb": "*", "ytake/voltdb-client-wrapper": "0.*" },
#Usage ##VoltDB json API(simple)
$client = new \Ytake\VoltDB\HttpClient(new \Ytake\VoltDB\Parse); // get request $result = $client->request('http://localhost')->get(['Procedure' => 'allUser'])->getResult(); // post request $result = $client->request('http://localhost')->post([ 'Procedure' => 'addUser', 'Parameters' => [1, "voltdb"] ])->getResult();
###use parameters
JSON HTTP Interface
same arguments
// procedure-name 'Procedure' => null, // procedure-parameters 'Parameters' => null, // username for authentication 'User' => null, // password for authentication 'Password' => null, // Hashed password for authentication 'Hashedpassword' => null, // true|false 'admin' => false, // function-name 'jsonp' => null
###get SystemInformation
// default "OVERVIEW" $client->request('http://localhost')->info()->getResult(); // DEVELOPMENT $client->request('http://localhost')->info("DEPLOYMENT")->getResult();
##VoltClient wrapper ###AdHoc Queries
$connection = new \Ytake\VoltDB\Client(new \VoltClient, new \Ytake\VoltDB\Parse); $connection->connect()->excute("SELECT * FROM users");
not supported prepared statements
JDBC driver(java) supports or stored procedure(DDL)
###Stored Procedure
$connection = new \Ytake\VoltDB\Client(new \VoltClient, new \Ytake\VoltDB\Parse); $connection->connect()->procedure("Procedure-Name");
###Async Stored Procedure
$connection = new \Ytake\VoltDB\Client(new \VoltClient, new \Ytake\VoltDB\Parse); $async = $connection->connect()->asyncProcedure("allUser"); // blocking and get result $async->drain(); $async->asyncResult();