GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  PROTOCOL::CASSANDRACQL::RESULT (3)

.ds Aq ’

NAME

"Protocol::CassandraCQL::Result" - stores the result of a Cassandra CQL query

CONTENTS

DESCRIPTION

Objects in this class store the result of a direct query or executed prepared statement, as returned by an OPCODE_RESULT giving RESULT_ROWS. It allows convenient access to the decoded row data.

As a subclass of Protocol::CassandraCQL::ColumnMeta it also provides information about column metadata, such as column names and types.

CONSTRUCTORS

CW$result = Protocol::CassandraCQL::Result->from_frame( CW$frame, CW$version )

Returns a new result object initialised from the given OPCODE_RESULT / RESULT_ROWS message frame and CQL version number. (Version will default to 1 if not supplied, but this may become a required parameter in a future version).

CW$result = Protocol::CassandraCQL::Result->new( CW%args )

Returns a new result object initialised directly from the given row data. This constructor is intended for use by unit test scripts, to create results directly from mocked connection objects or similar.

In addition to the arguments taken by the superclass constructor, it takes the following named arguments:
rows => ARRAY[ARRAY] An ARRAY reference containing ARRAY references of the individual rows’ data.

CW$result->set_metadata( CW$meta )

If the result was constructed from a message frame with the ROWS_NO_METADATA flag set, it would not have embedded metadata allowing the object to correctly decode the encoded byte strings. This method allows the caller to provide the metadata as previously returned by the OPCODE_PREPARE operation that prepared the query initially, enabling its decoding.

If the result object lacks this metadata, then before this method is called only the rows and columns methods may be used to return the general shape of the data; any of the row data methods will throw exceptions until the metadata is set.

CW$n = CW$result->rows

Returns the number of rows

CW$data = CW$result->row_array( CW$idx )

Returns the row’s data decoded, as an ARRAY reference

CW$data = CW$result->row_hash( CW$idx )

Returns the row’s data decoded, as a HASH reference mapping column short names to values.

CW@data = CW$result->rows_array

Returns a list of all the rows’ data decoded as ARRAY references.

CW@data = CW$result->rows_hash

Returns a list of all the rows’ data decoded as HASH references.

CW$map = CW$result->rowmap_array( CW$keyidx )

Returns a HASH reference mapping keys to rows deccoded as ARRAY references. $keyidx gives the column index of the value to use as the key in the returned map.

CW$map = CW$result->rowmap_hash( CW$keyname )

Returns a HASH reference mapping keys to rows decoded as HASH references. $keyname gives the column shortname of the value to use as the key in the returned map.

SPONSORS

This code was paid for by
o Perceptyx <http://www.perceptyx.com/>
o Shadowcat Systems <http://www.shadow.cat>

AUTHOR

Paul Evans <leonerd@leonerd.org.uk>
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 PROTOCOL::CASSANDRACQL::RESULT (3) 2016-03-17

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.