ytake/voltdb-client-wrapper

voltdb client wrapper

0.2.4 2014-10-05 09:21 UTC

This package is auto-updated.

Last update: 2024-10-04 23:13:16 UTC


README

License Latest Version Total Downloads Dependency Status

Scrutinizer Code Quality Code Coverage Build Status

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();