Members
(constant) Integer
- Deprecated:
- Integer is deprecated. See `./types/integer.js`
- Source:
(constant) allocBuffer :function
Forward-compatible allocation of buffer, filled with zeros.
Type:
- function
(constant) allocBufferFromArray :function
Forward-compatible allocation of buffer from an array of bytes
Type:
- function
(constant) allocBufferFromString :function
Forward-compatible allocation of buffer to contain a string.
Type:
- function
(constant) allocBufferUnsafe :function
Forward-compatible unsafe allocation of buffer.
Type:
- function
(constant) coreConnectionsPerHostV2
Core connections per host for protocol versions 1 and 2
- Source:
(constant) coreConnectionsPerHostV3
Core connections per host for protocol version 3 and above
- Source:
(constant) emptyArray
(constant) emptyObject
(constant) maxInt :number
Max int that can be accurately represented with 64-bit Number (2^53)
Type:
- number
(constant) maxRequestsPerConnectionV2
Default maxRequestsPerConnection value for protocol v1 and v2
- Source:
(constant) maxRequestsPerConnectionV3
Default maxRequestsPerConnection value for protocol v3+
- Source:
Methods
adaptNamedParamsPrepared(params, columns) → {Array}
Adapts the parameters based on the prepared metadata. If the params are passed as an associative array (Object), it adapts the object into an array with the same order as columns
Parameters:
Name | Type | Description |
---|---|---|
params |
Array | Object | |
columns |
Array |
Throws:
-
In case a parameter with a specific name is not defined
- Type
- Error
Returns:
Returns an array of parameters.
- Type
- Array
adaptNamedParamsWithHints(params, execOptions) → {Object}
Adapts the associative-array of parameters and hints for simple statements into Arrays based on the (arbitrary) position of the keys.
Parameters:
Name | Type | Description |
---|---|---|
params |
Array | Object | |
execOptions |
ExecutionOptions |
Returns:
Returns an array of parameters and the keys as an associative array.
- Type
- Object
arbitraryValueToBigInt(value)
Ensure the value is one of the accepted numeric types, and convert them to BigInt
Parameters:
Name | Type | Description |
---|---|---|
value |
string | number | Long | BigInt |
- Source:
arrayIterator(arr) → {Iterator}
Uses the iterator protocol to go through the items of the Array
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array |
Returns:
- Type
- Iterator
bigintToLong(from) → {Long}
Converts from bigint provided by napi into Long type used by the datastax library BigInt is the way napi handles values too big for js Number type, while Long is the way datastax code handles 64-bit integers.
Parameters:
Name | Type | Description |
---|---|---|
from |
bigint |
- Source:
Returns:
- Type
- Long
binarySearch(arr, key, compareFunc) → {number}
Searches the specified Array for the provided key using the binary search algorithm. The Array must be sorted.
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array | |
key |
||
compareFunc |
function |
Returns:
The position of the key in the Array, if it is found. If it is not found, it returns a negative number which is the bitwise complement of the index of the first element that is larger than key.
- Type
- number
callbackOnce(callback) → {function}
Parameters:
Name | Type | Description |
---|---|---|
callback |
function |
Returns:
Returns a wrapper function that invokes the underlying callback only once.
- Type
- function
convertHints(hints) → {Array.<(rust.ComplexType|null)>}
Convert the hints from the formats allowed by the driver, to internal type representation
Parameters:
Name | Type | Description |
---|---|---|
hints |
Array.<(string|number|object|null)> |
- Source:
Returns:
- Type
- Array.<(rust.ComplexType|null)>
copyBuffer()
Creates a copy of a buffer
deepExtend(target) → {Object}
Extends the target by the most inner props of sources
Parameters:
Name | Type | Description |
---|---|---|
target |
Object |
Returns:
- Type
- Object
defaultOptions() → {ClientOptions}
- Source:
Returns:
- Type
- ClientOptions
defaultPromiseFactory(handler) → {Promise}
Parameters:
Name | Type | Description |
---|---|---|
handler |
function |
Returns:
- Type
- Promise
delay(ms) → {Promise.<void>}
Creates a non-clearable timer that resolves the promise once elapses.
Parameters:
Name | Type | Description |
---|---|---|
ms |
number |
- Source:
Returns:
- Type
- Promise.<void>
each(arr, fn, callbackopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arr |
Array | ||
fn |
function | ||
callback |
function |
<optional> |
eachSeries(arr, fn, callbackopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arr |
Array | ||
fn |
function | ||
callback |
function |
<optional> |
encodeListLike(values, subtype) → {Array.<(rust.ComplexType|Array.<any>)>}
Wraps each of the elements into given subtype
Parameters:
Name | Type | Description |
---|---|---|
values |
Array | |
subtype |
rust.ComplexType |
- Source:
Returns:
Returns tuple: [rust.ComplexType, any[]]
- Type
- Array.<(rust.ComplexType|Array.<any>)>
encodeMap(value, parentType) → {Array.<(rust.ComplexType|Array.<Array.<any>>)>}
Parameters:
Name | Type | Description |
---|---|---|
value |
* | |
parentType |
rust.ComplexType |
- Source:
Returns:
Returns tuple: [rust.ComplexType, any[][]]
- Type
- Array.<(rust.ComplexType|Array.<Array.<any>>)>
encodeTuple(value, type) → {Array.<(rust.ComplexType|Array.<any>)>}
Wraps tuple into format recognized by ParameterWrapper
Parameters:
Name | Type | Description |
---|---|---|
value |
types.Tuple | |
type |
rust.ComplexType |
- Source:
Returns:
Returns tuple: [rust.ComplexType, Array
- Type
- Array.<(rust.ComplexType|Array.<any>)>
encodeVector(value, params)
Parameters:
Name | Type | Description |
---|---|---|
value |
CqlVector | |
params |
Object |
- Source:
ensureNumber(value)
Ensures the provided value is non NaN. If it is, throws an error
Parameters:
Name | Type | Description |
---|---|---|
value |
any |
- Source:
ensureValue(message)
Ensures the value isn't one of many ways to express null value
Parameters:
Name | Type | Description |
---|---|---|
message |
string | Error message if value is "null" |
- Source:
Throws:
-
Throws an error if the value is "null"
- Type
- TypeError
extend(baseOptionsopt, userOptions) → {Object}
Extends and validates the user options
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
baseOptions |
Object |
<optional> |
The source object instance that will be overridden |
userOptions |
Object |
- Source:
Returns:
- Type
- Object
extend()
Merge the contents of two or more objects together into the first object. Similar to jQuery.extend / Object.assign.
The main difference between this method is that declared properties with an undefined
value are not set
to the target.
fixStack()
Appends the original stack trace to the error after a tick of the event loop
forEachOf(arr, fn, callbackopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arr |
Array | ||
fn |
function | ||
callback |
function |
<optional> |
fromCallback(fn) → {Promise}
Creates a Promise from a callback based function.
Parameters:
Name | Type | Description |
---|---|---|
fn |
function |
- Source:
Returns:
- Type
- Promise
fromEvent(emitter, eventName) → {Promise}
Creates a Promise that gets resolved or rejected based on an event.
Parameters:
Name | Type | Description |
---|---|---|
emitter |
object | |
eventName |
string |
- Source:
Returns:
- Type
- Promise
getCallback(resolve, reject) → {function}
Gets a function that has the signature of a callback that invokes the appropriate promise handler parameters.
Parameters:
Name | Type | Description |
---|---|---|
resolve |
function | |
reject |
function |
- Source:
Returns:
- Type
- function
getColumnsMetadata(result) → {Array.<{name, type}>}
Parameters:
Name | Type | Description |
---|---|---|
result |
rust.QueryResultWrapper |
- Source:
Returns:
- Type
- Array.<{name, type}>
getCqlObject(field) → {any}
Maps the value returned from the Rust driver into expected JS object.
This function accepts the following kinds of arguments:
Value
-> When can correctly handle the value based on the type;[Type, Value]
-> In case of ambiguity, rust side provides tuple of (CqlType, Value). Specifically, array based types will always be returned in this form.
See rust.CqlValueWrapper, for more information
Parameters:
Name | Type | Description |
---|---|---|
field |
rust.CqlValueWrapper |
- Source:
Returns:
- Type
- any
getRowsFromResultsWrapper(result) → {Array.<Row>|undefined}
Simple way of getting results from rust driver. Call the driver O(columns * rows) times
Parameters:
Name | Type | Description |
---|---|---|
result |
rust.QueryResultWrapper |
- Source:
Returns:
Returns array of rows if ResultWrapper has any, and undefined otherwise
- Type
- Array.<Row> | undefined
getWrapped(type, value) → {Array.<(rust.ComplexType|any)>}
Wraps value into format recognized by ParameterWrapper, based on the provided type
Parameters:
Name | Type | Description |
---|---|---|
type |
rust.ComplexType | |
value |
* |
- Source:
Returns:
Returns tuple: [rust.ComplexType, any] or []
- Type
- Array.<(rust.ComplexType|any)>
guessTypeChecked(value) → {rust.ComplexType}
Guess the type, and if the type cannot be guessed, throw an error.
Parameters:
Name | Type | Description |
---|---|---|
value |
any |
- Source:
Returns:
type guess, converted to ComplexType
object
- Type
- rust.ComplexType
ifUndefined()
Returns the first not undefined param
ifUndefined3()
Returns the first not undefined param
insertSorted(arr, item, compareFunc)
Inserts the value in the position determined by its natural order determined by the compare func
Parameters:
Name | Type | Description |
---|---|---|
arr |
Array | |
item |
||
compareFunc |
function |
iteratorToArray(iterator) → {Array}
Convert the iterator values into an array
Parameters:
Name | Type | Description |
---|---|---|
iterator |
Returns:
- Type
- Array
log(type, info, furtherInfoopt)
Uses the logEmitter to emit log events
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
type |
String | ||
info |
String | ||
furtherInfo |
<optional> |
longToBigint(from) → {bigint}
Converts from Long type used by the datastax library into bigint used by napi
Parameters:
Name | Type | Description |
---|---|---|
from |
Long |
- Source:
Returns:
- Type
- bigint
map(arr, fn, callbackopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arr |
Array | ||
fn |
function | ||
callback |
function |
<optional> |
mapSeries(arr, fn, callbackopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arr |
Array | ||
fn |
function | ||
callback |
function |
<optional> |
napiErrorHandler(fn) → {function}
A wrapper function to map napi errors to Node.js errors or custom errors. Because NAPI-RS does not support throwing errors different that Error, for example TypeError, RangeError, etc. or custom, driver-specific errors, this function is used to catch the original error and throw a new one with the appropriate type. This should be used to wrap all NAPI-RS functions that may throw errors.
Parameters:
Name | Type | Description |
---|---|---|
fn |
function | The original function to be wrapped. |
- Source:
Returns:
A wrapped function with error handling logic.
- Type
- function
newQueryPlan(lbp, keyspace, executionOptions) → {Promise.<Iterator>}
Invokes the new query plan of the load balancing policy and returns a Promise.
Parameters:
Name | Type | Description |
---|---|---|
lbp |
LoadBalancingPolicy | The load balancing policy. |
keyspace |
String | Name of currently logged keyspace at |
executionOptions |
ExecutionOptions | null | The information related to the execution of the request. |
- Source:
Returns:
- Type
- Promise.<Iterator>
objectValues(obj) → {Array}
Returns an array containing the values of the Object, similar to Object.values(). If obj is null or undefined, it will return an empty array.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object |
Returns:
- Type
- Array
optionalCallback(promise, callbacknullable) → {Promise|undefined}
Method that handles optional callbacks (dual promise and callback support). When callback is undefined it returns the promise. When using a callback, it will use it as handlers of the continuation of the promise.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
promise |
Promise | ||
callback |
function |
<nullable> |
- Source:
Returns:
- Type
- Promise | undefined
parallel(arr, callbackopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arr |
Array.<function()> | ||
callback |
function |
<optional> |
parseParams(expectedTypes, params, allowGuessingopt) → {Array.<(rust.ComplexType|any)>}
Parses array of params into expected format according to preparedStatement expected types
If allowGuessing
is true, then for each missing field of expectedTypes
, this function will try to guess a type.
If the type cannot be guessed, error will be thrown.
Field is missing if it is null, undefined or if the expectedTypes
list is too short.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
expectedTypes |
Array.<(rust.ComplexType|null)> | List of expected types. |
|
params |
Array.<any> | ||
allowGuessing |
boolean |
<optional> |
- Source:
Throws:
ResponseError when received different amount of parameters than expected
Returns:
Returns: [] for null values, [undefined] for unset values and [rust.ComplexType, any] for all other values.
- Type
- Array.<(rust.ComplexType|any)>
parseVectorTypeArgs(typeName, stringToExclude, subtypeResolveFn) → {Object}
Extract the (typed) arguments from a vector type
Parameters:
Name | Type | Description |
---|---|---|
typeName |
String | |
stringToExclude |
String | Leading string indicating this is a vector type (to be excluded when eval'ing args) |
subtypeResolveFn |
function | Function used to resolve subtype type; varies depending on type naming convention |
- Source:
Returns:
- Type
- Object
promiseWrapper(options, originalCallback, handler) → {Promise|undefined}
Wraps the callback-based method. When no originalCallback is not defined, it returns a Promise.
Parameters:
Name | Type | Description |
---|---|---|
options |
ClientOptions | |
originalCallback |
function | |
handler |
function |
Returns:
- Type
- Promise | undefined
(package) queryOptionsIntoWrapper(options) → {rust.QueryOptionsWrapper}
Parses js query options into rust query options wrapper
Parameters:
Name | Type | Description |
---|---|---|
options |
_execOptions.ExecutionOptions |
- Source:
Returns:
- Type
- rust.QueryOptionsWrapper
rustConvertHint(object) → {rust.ComplexType|null}
Parameters:
Name | Type | Description |
---|---|---|
object |
null | object | Array.<object> |
- Source:
Returns:
- Type
- rust.ComplexType | null
series(arr, callbackopt)
Similar to async.series(), but instead accumulating the result in an Array, it callbacks with the result of the last function in the array.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
arr |
Array.<function()> | ||
callback |
function |
<optional> |
setMetadataDependent(client)
Sets the default options that depend on the protocol version and other metadata.
Parameters:
Name | Type | Description |
---|---|---|
client |
Client |
- Source:
stringRepeat(val, times) → {String}
Returns a string with a value repeated n times
Parameters:
Name | Type | Description |
---|---|---|
val |
String | |
times |
Number |
Returns:
- Type
- String
throwNotSupported(entity, name)
Parameters:
Name | Type | Description |
---|---|---|
entity |
String | |
name |
String |
- Source:
times(count, limit, fn) → {Promise}
Invokes the provided function multiple times, considering the concurrency level limit.
Parameters:
Name | Type | Description |
---|---|---|
count |
Number | |
limit |
Number | |
fn |
function |
- Source:
Returns:
- Type
- Promise
times(count, iteratorFunc, callbackopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
count |
Number | ||
iteratorFunc |
function | ||
callback |
function |
<optional> |
timesLimit(count, limit, iteratorFunc, callbackopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
count |
Number | ||
limit |
Number | ||
iteratorFunc |
function | ||
callback |
function |
<optional> |
timesSeries(count, iteratorFunction, callback)
Parameters:
Name | Type | Description |
---|---|---|
count |
Number | |
iteratorFunction |
function | |
callback |
function |
toBackground(promise) → {undefined}
Deals with unexpected rejections in order to avoid the unhandled promise rejection warning or failure.
Parameters:
Name | Type | Description |
---|---|---|
promise |
Promise |
- Source:
Returns:
- Type
- undefined
toCallback(promise, callbacknullable) → {undefined}
Invokes the callback once outside the promise chain the promise is resolved or rejected.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
promise |
Promise | ||
callback |
function |
<nullable> |
- Source:
Returns:
- Type
- undefined
toLowerCaseProperties()
Returns a new object with the property names set to lowercase.
totalLength()
Gets the sum of the length of the items of an array
validateFn(fn, nameopt) → {function}
Validates the provided parameter is of type function.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
fn |
function | The instance to validate. |
|
name |
String |
<optional> |
Name of the function to use in the error message. Defaults to 'callback'. |
Returns:
- Type
- function
whilst(condition, fn, callback)
Parameters:
Name | Type | Description |
---|---|---|
condition |
function | |
fn |
function | |
callback |
function |
wrapValueBasedOnType(type, value) → {Array.<(rust.ComplexType|any)>}
Wrap value, which is not Unset, into type and value pair, ensuring value is converted into expected form
Parameters:
Name | Type | Description |
---|---|---|
type |
rust.ComplexType | |
value |
* |
- Source:
Returns:
Returns tuple: [rust.ComplexType, any]
- Type
- Array.<(rust.ComplexType|any)>
Type Definitions
ClientOptions
Client options.
While the driver provides lots of extensibility points and configurability, few client options are required.
Default values for all settings are designed to be suitable for the majority of use cases, you should avoid fine tuning it when not needed.
See Client constructor documentation for recommended options.
Type:
- Object
Properties:
Name | Type | Attributes | 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. |
|||||||||||||||||||||||||||||||||
localDataCenter |
String |
<optional> |
The local data center to use. If using DCAwareRoundRobinPolicy (default), this option is required and only hosts from this data center are connected to and used in query plans. [TODO: Add support for this field] |
||||||||||||||||||||||||||||||||
keyspace |
String |
<optional> |
The logged keyspace for all the connections created within the Client instance. |
||||||||||||||||||||||||||||||||
credentials |
Object |
<optional> |
An object containing the username and password for plain-text authentication. It configures the authentication provider to be used against Apache Cassandra's PasswordAuthenticator or DSE's DseAuthenticator, when default auth scheme is plain-text. Note that you should configure either Properties
|
||||||||||||||||||||||||||||||||
id |
Uuid |
<optional> |
A unique identifier assigned to a Client object, that will be communicated to the server (DSE 6.0+) to identify the client instance created with this options. When not defined, the driver will generate a random identifier. [TODO: Add support for this field] |
||||||||||||||||||||||||||||||||
applicationName |
String |
<optional> |
An optional setting identifying the name of the application using the Client instance. This value is passed to DSE and is useful as metadata for describing a client connection on the server side. [TODO: Add support for this field] |
||||||||||||||||||||||||||||||||
applicationVersion |
String |
<optional> |
An optional setting identifying the version of the application using the Client instance. This value is passed to DSE and is useful as metadata for describing a client connection on the server side. [TODO: Add support for this field] |
||||||||||||||||||||||||||||||||
monitorReporting |
Object |
<optional> |
Options for reporting mechanism from the client to the DSE server, for versions that support it. [TODO: Add support for this field] Properties
|
||||||||||||||||||||||||||||||||
cloud |
Object |
<optional> |
The options to connect to a cloud instance. [TODO: Add support for this field Remove?] Properties
|
||||||||||||||||||||||||||||||||
refreshSchemaDelay |
Number |
<optional> |
The default window size in milliseconds used to debounce node list and schema refresh metadata requests. Default: 1000. [TODO: Add support for this field] |
||||||||||||||||||||||||||||||||
isMetadataSyncEnabled |
Boolean |
<optional> |
Determines whether client-side schema metadata retrieval and update is enabled. Setting this value to Default: |
||||||||||||||||||||||||||||||||
prepareOnAllHosts |
Boolean |
<optional> |
Determines if the driver should prepare queries on all hosts in the cluster.
Default: |
||||||||||||||||||||||||||||||||
rePrepareOnUp |
Boolean |
<optional> |
Determines if the driver should re-prepare all cached prepared queries on a
host when it marks it back up.
Default: |
||||||||||||||||||||||||||||||||
maxPrepared |
Number |
<optional> |
Determines the maximum amount of different prepared queries before evicting items
from the internal cache. Reaching a high threshold hints that the queries are not being reused, like when
hard-coding parameter values inside the queries.
Default: |
||||||||||||||||||||||||||||||||
policies |
Object |
<optional> |
[TODO: Add support for this field] Properties
|
||||||||||||||||||||||||||||||||
queryOptions |
QueryOptions |
<optional> |
Default options for all queries. [TODO: Add support for this field] |
||||||||||||||||||||||||||||||||
pooling |
Object |
<optional> |
Pooling options. [TODO: Add support for this field] Properties
|
||||||||||||||||||||||||||||||||
protocolOptions |
Object |
<optional> |
[TODO: Add support for this field] Properties
|
||||||||||||||||||||||||||||||||
socketOptions |
Object |
<optional> |
[TODO: Add support for this field] Properties
|
||||||||||||||||||||||||||||||||
authProvider |
AuthProvider |
<optional> |
Provider to be used to authenticate to an auth-enabled cluster. [TODO: Add support for this field] |
||||||||||||||||||||||||||||||||
requestTracker |
RequestTracker |
<optional> |
The instance of RequestTracker used to monitor or log requests executed with this instance. [TODO: Add support for this field] |
||||||||||||||||||||||||||||||||
sslOptions |
Object |
<optional> |
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 It uses the same default values as Node.js [TODO: Add support for this field] |
||||||||||||||||||||||||||||||||
encoding |
Object |
<optional> |
Encoding options. [TODO: Add support for this field] Properties
|
||||||||||||||||||||||||||||||||
profiles |
Array.<ExecutionProfile> |
<optional> |
The array of execution profiles. [TODO: Add support for this field] |
||||||||||||||||||||||||||||||||
promiseFactory |
function |
<optional> |
Function to be used to create a Promise libraries often provide different methods to create a promise. For example, you can use Bluebird's
By default, the driver will use the Promise constructor. [TODO: Add support for this field] |
- Source:
QueryOptions
Query options
Type:
- Object
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
autoPage |
boolean |
<optional> |
Determines if the driver must retrieve the following result pages automatically. This setting is only considered by the Client#eachRow() method. For more information, check the paging results documentation. |
captureStackTrace |
boolean |
<optional> |
Determines if the stack trace before the query execution should be maintained. Useful for debugging purposes, it should be set to Default: false. [TODO: Add support for this field] |
consistency |
number |
<optional> |
Defaults to [TODO: Test this field] |
customPayload |
Object |
<optional> |
Key-value payload to be passed to the server. On the Cassandra side, implementations of QueryHandler can use this data. [TODO: Add support for this field] |
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. [TODO: Add support for this field] |
fetchSize |
number |
<optional> |
Amount of rows to retrieve per page. Only valid if query is paged. |
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. |
host |
Host |
<optional> |
The host that should handle the query. Use of this option is heavily discouraged and should only be used in the following cases:
Configuring a specific host causes the configured LoadBalancingPolicy to be completely bypassed. However, if the load balancing policy dictates that the host is at a distance of ignored or there is no active connectivity to the host, the request will fail with a NoHostAvailableError. |
idempotent |
boolean |
<optional> |
Defines whether the query can be applied multiple times without changing the result beyond the initial application. The query execution idempotence can be used at RetryPolicy level to determine if an statement can be retried in case of request error or write timeout. Default: [TODO: Add support for this field] |
keyspace |
string |
<optional> |
Specifies the keyspace for the query. It is used for the following:
[TODO: Add support for this field] |
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. [TODO: Add support for this field] |
counter |
boolean |
<optional> |
Determines if its a counter batch. Only valid for Client#batch(), it will be ignored by other methods. Default: false. [TODO: Add support for this field] |
paged |
boolean |
<optional> |
Determines if the query should be paged. 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. [TODO: Add support for this field] |
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
( Suitable for statements for which the coordinator may allow a longer server-side timeout, for example aggregation queries. A value of [TODO: Add support for this field] |
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. [TODO: Add support for this field] |
routingIndexes |
Array |
<optional> |
Index of the parameters that are part of the partition key to determine the routing. [TODO: Add support for this field] |
routingKey |
Buffer | Array |
<optional> |
Partition key(s) to determine which coordinator should be used for the query. [TODO: Add support for this field] |
routingNames |
Array |
<optional> |
Array of the parameters names that are part of the partition key to determine the routing. Only valid for non-prepared requests, it's recommended that you use the prepare flag instead. [TODO: Add support for this field] |
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. [TODO: Add support for this field] |
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. |
- Source:
ResultCallback(err, resultopt)
Callback used by execution methods.
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. |