Created
May 17, 2012 22:09
-
-
Save nmmmnu/2721873 to your computer and use it in GitHub Desktop.
Cassandra cqlsh replacement written in php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!/usr/local/bin/php | |
<? | |
require_once(__DIR__.'/../lib/autoload.php'); | |
use phpcassa\Connection\ConnectionPool; | |
if ($argc < 2){ | |
echo "Usage {$argv[0]} keyspace cql\n"; | |
exit; | |
} | |
$space = $argv[1]; | |
$cql = $argv[2]; | |
$pool = new ConnectionPool($space, array("127.0.0.1")); | |
$raw = $pool->get(); | |
$rows = $raw->client->execute_cql_query($cql, 2); | |
$pool->return_connection($raw); | |
unset($raw); | |
$pool->close(); | |
print_r($rows); | |
//print_r($rows["rows"]); // result data only |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment