Behaviours: gen_server.
Authors: Mathieu D'Amours (matt@forest.io).
abstract datatype: client()
inet() = {inet:ip_address() | string(), Port::integer()} | inet:ip_address() | string() | binary() | {}
all_rows/1 | Returns a list of rows as property lists. |
all_rows/2 | |
code_change/3 | |
fetch_more/1 | Fetch the next page of result from Cassandra for a given continuation. |
fetch_more_async/1 | Asynchronously fetch the next page of result from cassandra for a given continuation. |
get_client/0 | |
get_client/1 | |
get_client/2 | |
get_global_opts/0 | |
get_protocol_version/0 | |
handle_call/3 | |
handle_cast/2 | |
handle_info/2 | |
has_more_pages/1 | Check to see if there are more result available. |
head/1 | Returns the first row of result, as a property list. |
head/2 | |
init/1 | |
make_option_getter/2 | |
next/1 | Returns a tuple of {HeadRow, ResultTail} . |
prepare_node_info/1 | |
put_protocol_version/1 | |
run_query/2 | Send a query to cassandra for execution. |
send_query/2 | Send a query to be executed asynchronously. |
size/1 | The number of rows in a result set. |
start_link/0 | |
tail/1 | Returns all rows of result, except the first one. |
terminate/2 |
all_rows(Cql_result) -> any()
Returns a list of rows as property lists
all_rows(Cql_result, Opts) -> any()
code_change(OldVsn, State, Extra) -> any()
fetch_more(Continuation::#cql_result{}) -> no_more_result | {ok, #cql_result{}}
Fetch the next page of result from Cassandra for a given continuation. The function will return with the result from Cassandra (synchronously).
fetch_more_async(Continuation::#cql_result{}) -> reference() | no_more_result
Asynchronously fetch the next page of result from cassandra for a given continuation.
A success or error message will be sent in response some time later (seesend_query/2
for details) unless the
connection is dropped.
get_client() -> {ok, client()} | {error, term()}
get_global_opts() -> any()
get_protocol_version() -> integer()
handle_call(Msg, From, State) -> any()
handle_cast(Msg, State) -> any()
handle_info(Msg, State) -> any()
has_more_pages(Continuation::#cql_result{}) -> true | false
Check to see if there are more result available
head(Cql_result) -> any()
Returns the first row of result, as a property list
head(Cql_result, Opts) -> any()
init(X1) -> any()
make_option_getter(Local, Global) -> any()
next(Cql_result) -> any()
Returns a tuple of {HeadRow, ResultTail}
.
empty_dataset
atom.
prepare_node_info(NodeInfo::any()) -> Node::inet()
put_protocol_version(Val::integer()) -> ok
run_query(ClientRef::client(), Query::binary() | string() | #cql_query{} | #cql_query_batch{}) -> {ok, void} | {ok, #cql_result{}} | {error, term()}
Send a query to cassandra for execution. The function will return with the result from Cassandra (synchronously).
The Query
parameter can be a string, a binary UTF8 string or a #cql_query{}
record
#cql_query{ statement :: binary(), reusable :: boolean(), consistency :: consistency_level(), named :: boolean(), bindings :: list(number() | boolean() | binary() | list() | inet() | ) | list(tuple()) }
Reusable is a boolean indicating whether the query should be reused. Reusing a query means sending it to Cassandra to be prepared, which allows
later executions of the same query to be performed faster. This parameter is true
by default when you provide bindings in the query (positional ?
parameters or named :var
parameters), and false
by default when you don't. You can override the defaults.
Consistency is represented as an atom and can be any of any
, one
,
two
, three
, quorum
, all
, local_quorum
, each_quorum
, serial
,
local_serial
or local_one
.
:var1
). Otherwise,
they are assumed to be positional (?
). In both cases, values is a property list (see proplists) or map, where keys match the
parameter names.
send_query(ClientRef::client(), Query::binary() | string() | #cql_query{} | #cql_query_batch{}) -> reference()
Send a query to be executed asynchronously. This method returns immediately with a unique tag.
When a successful response is received from cassandra, a {result, Tag, Result :: #cql_result{}}
message is sent to the calling process.
If there is an error with the query, a {error, Tag, Error :: #cql_error{}}
will be sent to the calling process.
new_client/0
for
how to handle this case).
size(Cql_result) -> any()
The number of rows in a result set
start_link() -> any()
tail(Cql_result) -> any()
Returns all rows of result, except the first one
terminate(Reason, State) -> any()
Generated by EDoc