incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul \"LeoNerd\" Evans" <leon...@leonerd.org.uk>
Subject Re: List support in Net::Async::CassandraCQL ?
Date Sat, 22 Feb 2014 17:15:27 GMT
(resending for the list now I'm subscribed)

On Sat, 22 Feb 2014 14:03:06 +1100
Jacob Rhoden <jacob.rhoden@me.com> wrote:

> This perl library has been extremely useful for scripting up data
> migrations. I wonder if anyone knows of the easiest way to use lists
> with this driver? Throwing a perl array in as a parameter doesn’t
> work as is:
> 
>     my $q = $cass->prepare("update contact set name=?, address=?
> where uuid=?")->get; push @f, $q->execute([$name, @address, $uuid]);
>     Future->needs_all( @f )->get;
> 
> Returns the following:
> 
>     Cannot encode address: not an ARRAY
> at /usr/local/share/perl/5.14.2/Net/Async/CassandraCQL/Query.pm line
> 182

It needs to arrive as an ARRAYref:

  $q->execute([$name, \@address, $uuid]);

Or if you'd prefer you can use named bindings:

  $q->execute({name => $name, address => \@address, uuid => $uuid});

-- 
Paul "LeoNerd" Evans

leonerd@leonerd.org.uk
ICQ# 4135350       |  Registered Linux# 179460
http://www.leonerd.org.uk/

Mime
View raw message