Type Definitions
ClientOptions
Type:
- Object
Properties:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
contactPoints |
Array.<string> | Array of addresses or host names of the nodes to add as contact points.
Contact points are addresses of Cassandra nodes that the driver uses to discover the cluster topology. Only one contact point is required (the driver will retrieve the address of the other nodes automatically), but it is usually a good idea to provide more than one contact point, because if that single contact point is unavailable, the driver will not be able to initialize correctly. |
||||||||||||||||||||||||
keyspace |
String | The logged keyspace for all the connections created within the Client instance. | ||||||||||||||||||||||||
refreshSchemaDelay |
Number | The default window size in milliseconds used to debounce node list and schema refresh metadata requests. Default: 1000. | ||||||||||||||||||||||||
isMetadataSyncEnabled |
Boolean | Determines whether client-side schema metadata retrieval and update is
enabled.
Setting this value to true . |
||||||||||||||||||||||||
policies |
Object |
Properties
|
||||||||||||||||||||||||
queryOptions |
QueryOptions | Default options for all queries. | ||||||||||||||||||||||||
pooling |
Object | Pooling options.
Properties
|
||||||||||||||||||||||||
protocolOptions |
Object |
Properties
|
||||||||||||||||||||||||
socketOptions |
Object |
Properties
|
||||||||||||||||||||||||
authProvider |
AuthProvider | Provider to be used to authenticate to an auth-enabled cluster. | ||||||||||||||||||||||||
sslOptions |
Object | Client-to-node ssl options, when set the driver will use the secure layer. You can specify cert, ca, ... options named after the Node.js tls.connect options. | ||||||||||||||||||||||||
encoding |
Object |
Properties
|
||||||||||||||||||||||||
profiles |
Array.<ExecutionProfile> | The array of execution profiles. |
QueryOptions
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
autoPage |
Boolean |
<optional> |
Determines if the driver must retrieve the following result pages automatically. |
captureStackTrace |
Boolean |
<optional> |
Determines if the stack trace before the query execution should be
maintained.
Useful for debugging purposes, it should be set to |
consistency |
Number |
<optional> |
Consistency level. Default: localOne. |
customPayload |
Object |
<optional> |
Key-value payload to be passed to the server. On the Cassandra side, implementations of QueryHandler can use this data. |
executionProfile |
String | ExecutionProfile |
<optional> |
Name or instance of the profile to be used for this execution. If not set, it will the use "default" execution profile. |
fetchSize |
Number |
<optional> |
Amount of rows to retrieve per page. |
hints |
Array | Array.<Array> |
<optional> |
Type hints for parameters given in the query, ordered as for the parameters.
For batch queries, an array of such arrays, ordered as with the queries in the batch. |
logged |
Boolean |
<optional> |
Determines if the batch should be written to the batchlog. Only valid for Client#batch(), it will be ignored by other methods. Default: true. |
pageState |
Buffer | String |
<optional> |
Buffer or string token representing the paging state.
Useful for manual paging, if provided, the query will be executed starting from a given paging state. |
prepare |
Boolean |
<optional> |
Determines if the query must be executed as a prepared statement. |
readTimeout |
Number |
<optional> |
When defined, it overrides the default read timeout
(socketOptions.readTimeout ) in milliseconds for this execution per coordinator.
Suitable for statements for which the coordinator may allow a longer server-side timeout, for example aggregation queries.
A value of |
retry |
RetryPolicy |
<optional> |
Retry policy for the query.
This property can be used to specify a different retry policy to the one specified in the ClientOptions.policies. |
retryOnTimeout |
Boolean |
<optional> |
Determines if the client should retry when it didn't hear back from a host
within socketOptions.readTimeout . Default: true. |
routingIndexes |
Array |
<optional> |
Index of the parameters that are part of the partition key to determine the routing. |
routingKey |
Buffer | Array |
<optional> |
Partition key(s) to determine which coordinator should be used for the query. |
routingNames |
Array |
<optional> |
Array of the parameters names that are part of the partition key to determine the routing. |
serialConsistency |
Number |
<optional> |
Serial consistency is the consistency level for the serial phase of conditional updates. This option will be ignored for anything else that a conditional update/insert. |
timestamp |
Number | Long |
<optional> |
The default timestamp for the query in microseconds from the unix epoch
(00:00:00, January 1st, 1970).
If provided, this will replace the server side assigned timestamp as default timestamp. Use generateTimestamp() utility method to generate a valid timestamp based on a Date and microseconds parts. |
traceQuery |
Boolean |
<optional> |
Enable query tracing for the execution. Use query tracing to diagnose performance
problems related to query executions. Default: false.
To retrieve trace, you can call Metadata.getTrace() method. |
ResultCallback(err, resultopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
err |
Error | Error occurred in the execution of the query. | |
result |
ResultSet |
<optional> |
Result of the execution of the query. |