CQLdriver.cqlbatchwriteMethod
function cqlbatchwrite(session, table, data; retries, update, counter)

Write a set of rows to a table as a prepared batch

Arguments

  • session::Ptr{CassSession}: pointer to the active session
  • table::String: the name of the table you want to write to
  • data::DataFrame: a DataFrame with named columns
  • retries::Int=5: number of retries per batch insert
  • update::DataFrame: the arguments for WHERE during an UPDATE
  • counter::Bool: for updating the counter datatype

Return

  • err::UInt16: status of the batch insert
CQLdriver.cqlcloseMethod

function cqlclose(session, cluster) Decommission a connection and free its resources

Arguments

  • session::Ptr{CassSession}: the current active session
  • cluster::Ptr{CassCluster}: the cluster associated with the active session

Return

  • Void:
CQLdriver.cqlexecMethod
function cqlexec(session, statement)

Execute arbitrary command to the CQL database

Arguments

  • session::Ptr{CassSession}: pointer to the active session
  • statement::String: a valid CQL command

Return

  • err::UInt16: status of the command
CQLdriver.cqlfuturecheckFunction
function cql_future_check(future, caller)

Check if a future contains any errors

Arguments

  • future::Ptr{CassFuture}: a pointer to a future
  • caller::String: a string to help identify where this function is called from

Return

  • err::UInt: a 16 bit integer with an error code. No error returns 0
CQLdriver.cqlgetvalueMethod
function cqlgetvalue(val, t, strlen)

retrieve value using the correct type

Arguments

  • val::Ptr{CassValue}: a returned value from a query
  • t::DataType: the type of the value being extracted
  • strlen::Int: for string values specify max-length of output

Return

  • out: the return value, can by of any type
CQLdriver.cqlinitMethod
function cqlinit(hosts; username, password, threads, connections, queuesize, bytelimit, requestlimit)

Change the performance characteristics of your CQL driver

Arguments

  • hosts::String: a string with ipv4 addreses of hosts
  • username::String: provide username for authenticated connections
  • password::String: provide password for authenticated connections
  • threads::Int64: set number of IO threads that handle query requests (default 1)
  • connections::Int64: set number of connections per thread (default 2)
  • queuesize::Int64: set queuesize that stores pending requests (default 4096)
  • bytelimit::Int64: set max number of bytes pending on connection (default 65536 - 64KB)
  • requestlimit::Int64: set max number of requests pending on connection (default 128 * connections)
  • whitelist::String: set whiteslist of hosts - will only connect to these hosts and all other connections will be ignored

Return

  • session::Ptr{CassSession}: a pointer to the active session
  • cluster::Ptr{CassCluster}: a pointer to the cluster
  • err::UInt: a 16 bit integer with an error code. No error returns 0
CQLdriver.cqlreadMethod
function cqlread(session, query; pgsize, retries, strlen)
function cqlread(session, queries, concurrency; strlen)

Query the server for the contents of a table

  • session::Ptr{CassSession}: pointer to the active session
  • query::String: a valid SELECT query
  • queries::Array{String}: an array of valid queries
  • concurrency::Int=500: how many queries to execute
  • pgsize::Int=10000: how many lines to pull at a time
  • retries::Int=5: number of times to retry pulling a page of data
  • timeout::Int=10000: time to wait for response in milliseconds
  • strlen::Int=128: the maximum number of characters in a string

Return

  • err::UInt16: status of the query
  • output::DataFrame: a dataframe with named columns
  • outputs::Array{DataFrame}: an array of dataframe results
CQLdriver.cqlstatementbindMethod
function cqlstatementbind(statement, pos, typ, data)

Bind data to a column in a statement for use with batch inserts

Arguments

  • statement::Ptr{CassStatement}: pointer to a statement
  • pos::Int: what column to put data into
  • typ::DataType, data): the datatype of the data

Return

  • Void:
CQLdriver.cqlstrprepMethod
function cqlstrprep(table, data)

create a prepared query string for use with batch inserts

Arguments

  • table::String: name of the table on the server
  • columns::Array{String}: name of the columns on the server
  • data::Array{Any,1}: an array of data to be inserted

Return

  • out::String: a valid INSERT or UPDATE query
CQLdriver.cqlvaltypeMethod
cql_val_type(result, idx)

Takes a CassResult and returns the type in a given column

Arguments

  • result::Ptr{CassResult}: a valid result from a query
  • idx::Int64: the column to check

Return

  • typ: the type of the value in the specified column
CQLdriver.cqlwriteMethod
function cqlwrite(session, table, data; batchsize, retries, update, counter)

Write to a table

Arguments

  • session::Ptr{CassSession}: pointer to the active session
  • table::String: the name of the table you want to write to
  • data::DataFrame: a DataFrame with named columns
  • retries::Int=5: number of retries per batch insert
  • batchsize::Int=1000: number of rows to write per batch
  • update::DataFrame: the arguments for WHERE during an UPDATE
  • counter::Bool: for updating the counter datatype

Return

  • err::UInt16: status of the insert