Skip to content

Instantly share code, notes, and snippets.

@talk2vino
Last active August 29, 2015 14:23
Show Gist options
  • Save talk2vino/096ea9762f637310df9b to your computer and use it in GitHub Desktop.
Save talk2vino/096ea9762f637310df9b to your computer and use it in GitHub Desktop.
Cassandra Client from Perl
#!/usr/bin/perl
use IO::Async::Loop;
use Net::Async::CassandraCQL;
use Protocol::CassandraCQL qw( CONSISTENCY_QUORUM );
use Protocol::CassandraCQL::Result;
my $loop = IO::Async::Loop->new;
my $cass = Net::Async::CassandraCQL->new(
host => "ipaddress of the Seed Nodes",
keyspace => "xxxx",
username => "xxxx",
password => "xxxxx",
default_consistency => CONSISTENCY_QUORUM,
);
$loop->add( $cass );
$cass->connect->get;
my $get_stmt = $cass->prepare( "insert statement" )->get;
$get_stmt->execute->get;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment