<commit_before># Index

* [Client](#client)
* [Query](#query)
* [Prepared](#prepared)
* [Batch](#batch)
* [Types](#types)
* [Logging](#logging)

# <a name="client"></a> Client

## new Client(options)

Creates a new instantiation of the driver to connect to a given cluster. This is the primary entry point into the system.

Options exposes a number of configuration options used to tune the connection to the cluster. Detailed descriptions for the various values can be found in the C++ driver documentation:

* num_threads_io
* queue_size_io
* queue_size_event
* queue_size_log
* core_connections_per_host
* max_connections_per_host
* reconnect_wait_time
* max_concurrent_creation
* max_concurrent_requests_threshold
* max_requests_per_flush
* write_bytes_high_water_mark
* write_bytes_low_water_mark
* pending_requests_high_water_mark
* pending_requests_low_water_mark
* connect_timeout
* request_timeout
* tcp_keepalive -- if 0 this disables keepalives. if non-zero it sets the keepalive time to the given value
* tcp_nodelay -- enabled if 1, disabled if 0

## connect(options, cb)

Connect to the cluster specified by the given options and call the given callback when completed.

* address: (required) comma separated list of one or more addresses to connect to
* port: port on which to make the connection

## execute(query, params, options, callback)

Execute the specified query.

* query: (required) CQL query string
* params: (optional) data to bind to the query
* options: (optional) options for the query
* callback: (required) callback function

Supported options include:

* hints: Type hints to indicate how to convert the params. See [Types](#types).
* fetchSize: Maximum number of rows to return in a single query
* pageState: State from a prior invocation to indicate where to continue processing results.
* autoPage: Flag to indicate whether the library should page through all the results before triggering the callback.

On completion, will execute `callback(err, results)`. If there is no error, then `results.rows` contains an array with the resulting data. If an error occurred, then `err` contains the error and `results` is undefined.

If `fetchSize` was specified and the results were truncated, then `results.pageState` contains a handle that can be passed as an option to a subsequent invocation to have it continue processing results.

## eachRow(query, params, options, rowCallback, callback)

Execute the specified query.

* query: (required) CQL query string
* params: (optional) data to bind to the query
* options: (optional) options for the query
* callback: (required) callback function

Supported options include:

* hints: Type hints to indicate how to convert the params. See [Types](#types).
* fetchSize: Maximum number of rows to return in a single query
* pageState: State from a prior invocation to indicate where to continue processing results.
* autoPage: Flag to indicate whether the library should page through all the results before triggering the callback.

On completion, will execute `callback(err, results)`. If there is no error, then `results.rows` contains the requested data. If `fetchSize` was specified and the results may have been truncated, then `results.pageState` contains a handle that can be passed as an option to a subsequent invocation to have it continue processing results.

## new_query()

Low level API to create a query object.

Returns an instance of a [Query](#query) object.

## prepare(query, callback)

Prepare the query for more efficient execution.

* query: (required) CQL query string
* callback: (required) callback function

On completion, calls `callback(err, prepared)`, returning an instance of a [Prepared](#prepared) query.

## new_batch(type)

Create a new batch query.<commit_msg>doc: suggested copy edits<commit_after># Index

* [Client](#client)
* [Query](#query)
* [Prepared](#prepared)
* [Batch](#batch)
* [Types](#types)
* [Logging](#logging)

# <a name="client"></a> Client

## new Client(options)

Creates a new instantiation of the driver to connect to a given cluster. This is the primary entry point into the system.

Options exposes a number of configuration options used to tune the connection to the cluster. Detailed descriptions for the various values can be found in the C++ driver documentation:

* num_threads_io
* queue_size_io
* queue_size_event
* queue_size_log
* core_connections_per_host
* max_connections_per_host
* reconnect_wait_time
* max_concurrent_creation
* max_concurrent_requests_threshold
* max_requests_per_flush
* write_bytes_high_water_mark
* write_bytes_low_water_mark
* pending_requests_high_water_mark
* pending_requests_low_water_mark
* connect_timeout
* request_timeout
* tcp_keepalive -- if 0 this disables keepalives. if non-zero it sets the keepalive time to the given value
* tcp_nodelay -- enabled if 1, disabled if 0

## connect(options, cb)

Connect to the cluster specified by the given options and call the given callback when completed.

* address: (required) comma separated list of one or more addresses to connect to
* port: port on which to make the connection

## execute(query, params, options, callback)

Execute the specified query.

* query: (required) CQL query string
* params: (optional) data to bind to the query
* options: (optional) options for the query
* callback: (required) callback function

Supported options include:

* hints: Type hints to indicate how to convert the params. See [Types](#types).
* fetchSize: Maximum number of rows to return in a single query
* pageState: State from a prior invocation to indicate where to continue processing results.
* autoPage: Flag to indicate whether the library should page through all the results before triggering the callback.

On completion, will execute `callback(err, results)`. If there is no error, then `results.rows` contains an array with the resulting data. If an error occurred, then `err` contains the error and `results` is undefined.

If `fetchSize` was specified and the results were truncated, then `results.pageState` contains a handle that can be passed as an option to a subsequent invocation to have it continue processing results.

## eachRow(query, params, options, rowCallback, callback)

Execute the specified query.

* query: (required) CQL query string
* params: (optional) data to bind to the query
* options: (optional) options for the query
* callback: (required) callback function

Supported options include:

* hints: Type hints to indicate how to convert the params. See [Types](#types).
* fetchSize: Maximum number of rows to return in a single query
* pageState: State from a prior invocation to indicate where to continue processing results.
* autoPage: Flag to indicate whether the library should page through all the results before triggering the callback.

On completion, will execute `callback(err, results)`. If there is no error, then `results.rows` contains the requested data. If `fetchSize` was specified and the results may have been truncated, then `results.pageState` contains a handle that can be passed as an option to a subsequent invocation to have it continue processing results.

## new_query()

Low level API to create a query object.

Returns an instance of a [Query](#query) object.

## prepare(query, callback)

Prepare the query for more efficient execution.

* query: (required) CQL query string
* callback: (required) callback function

On completion, calls `callback(err, prepared)`. If there is no error then prepared contains an instance of a [Prepared](#prepared) query, otherwise `err` indicates the error.

## new_batch(type)

Create a new batch query.
{'fraction_non_alphanumeric': 0.07080110135046545, 'fraction_numerical': 0.0007866789038940606, 'mean_word_length': 5.21678891605542, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1290472', 'n_tokens_mistral': 2016, 'n_tokens_neox': 1945, 'n_words': 982}