ScyllaDB University Live | Free Virtual Training Event
Learn more
ScyllaDB Documentation Logo Documentation
  • Deployments
    • Cloud
    • Server
  • Tools
    • ScyllaDB Manager
    • ScyllaDB Monitoring Stack
    • ScyllaDB Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
    • Supported Driver Versions
  • Resources
    • ScyllaDB University
    • Community Forum
    • Tutorials
Install
Search Ask AI
ScyllaDB Docs ScyllaDB Node.js Driver API Reference Global Functions and Constants
For AI agents: a documentation index is available at https://nodejs-rs-driver.docs.scylladb.com/v0.7.1/llms.txt. A Markdown version of this page is at https://nodejs-rs-driver.docs.scylladb.com/v0.7.1/api/globals.md.

Global Functions and Constants¶

Members¶

(constant) INITIAL_FRAME_SIZE

The buffer size of a new FrameWriter.

Source

frame-writer.ts, line 12

(constant) Integer

Source

encoder.ts, line 10

Deprecated

Integer is deprecated. See `./types/integer.ts`

(constant) MAX_FRAME_VALUES

Largest value count that the [short] count of a frame can hold.

Source

frame-writer.ts, line 8

(constant) MAX_RETAINED_FRAME_SIZE

A FrameWriter keeps its buffer between frames up to this size. After a larger frame, it starts again with a small buffer.

Source

frame-writer.ts, line 17

(constant) VIntCoding

Contains the methods for reading and writing vints into binary format. Exposes only 2 internal methods, the rest are hidden.

Source

utils.ts, line 941

(constant) _maxValue

Highest value of the ring, and its inclusive end.

Source

token.ts, line 19

(constant) _minToken

The token the ring starts at, exclusively, and ends at, inclusively: the range ]minToken, minToken] covers the whole ring.

Source

token.ts, line 80

(constant) _minValue

Lowest value of the ring: not a valid token, but the exclusive start of the ring.

Source

token.ts, line 15

(constant) _ringLength

Number of values the ring spans, used to wrap around its end.

Source

token.ts, line 23

(constant) coreConnectionsPerHostV2

Core connections per host for protocol versions 1 and 2

Source

client-options.ts, line 644

(constant) coreConnectionsPerHostV3

Core connections per host for protocol version 3 and above

Source

client-options.ts, line 651

(constant) loggingFinalizationRegistry

FinalizationRegistry that ensures the Rust logging callback is unregistered when a Client instance is garbage-collected without being explicitly shut down.

While in general FinalizationRegistry usage is discouraged, we use it here to avoid blocking the client from being cleaned up, once it's no longer used by the user, and also clean up all the resources in the process. This justifies using finalization registry, despite heavy warnings against it in the documentation.

To understand more, check the JS documentation. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/FinalizationRegistry

Source

client.ts, line 66

(constant) maxInt

Max int that can be accurately represented with 64-bit Number (2^53)

Source

utils.ts, line 27

(constant) maxRequestsPerConnectionV2

Default maxRequestsPerConnection value for protocol v1 and v2

Source

client-options.ts, line 658

(constant) maxRequestsPerConnectionV3

Default maxRequestsPerConnection value for protocol v3+

Source

client-options.ts, line 661

Methods¶

_split(start, end, numberOfSplits)

Splits the range ]start, end] into numberOfSplits parts of equal "size" (referring to the number of tokens, not the actual amount of data), returning the tokens the parts are split at.

Parameters:
Name Type Description
start

Starting token.

end

End token.

numberOfSplits

Number of splits to make.

Source

token.ts, line 91

Returns:

The numberOfSplits - 1 points the range is split at.

adaptNamedParamsPrepared()

Adapts the parameters based on the prepared metadata. This function assumes params are passed as an associative array (Object), and it adapts the object into an array with the same order as bound parameters in the prepared statement.

Source

utils.ts, line 321

Throws:

In case a parameter with a specific name is not defined.

Type
Error
Returns:

Returns an array of parameters.

adaptNamedParamsWithHints()

Adapts the associative-array of parameters and hints for simple statements into Arrays based on the (arbitrary) position of the keys.

Source

utils.ts, line 344

Returns:

Returns an array of parameters and the keys as an associative array.

arbitraryValueToBigInt()

Ensure the value is one of the accepted numeric types, and convert them to BigInt.

Source

new-utils.ts, line 43

arrayIterator()

Uses the iterator protocol to go through the items of the Array

Source

utils.ts, line 231

asDouble()

Source

datastax/graph/wrappers.js, line 15

Deprecated

Not supported by the driver. Usage will throw an error.

asFloat()

Source

datastax/graph/wrappers.js, line 22

Deprecated

Not supported by the driver. Usage will throw an error.

asInt()

Source

datastax/graph/wrappers.js, line 8

Deprecated

Not supported by the driver. Usage will throw an error.

asTimestamp()

Source

datastax/graph/wrappers.js, line 29

Deprecated

Not supported by the driver. Usage will throw an error.

asUdt()

Source

datastax/graph/wrappers.js, line 36

Deprecated

Not supported by the driver. Usage will throw an error.

bigintToLong()

Converts from bigint provided by napi into Long type. BigInt is the way napi handles values too big for js Number type, while Long is the legacy way the code handles 64-bit integers.

Source

new-utils.ts, line 29

binarySearch(key)

Searches the specified Array for the provided key using the binary search algorithm. The Array must be sorted.

Parameters:
Name Type Description
key

Source

utils.ts, line 256

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.

callbackOnce()

Source

utils.ts, line 48

Returns:

Returns a wrapper function that invokes the underlying callback only once.

convertComplexType()

Convert rust ComplexType into type representation used in the driver encoder

Source

types/cql-utils.ts, line 87

convertTlsVersion()

According to the TS type definition, SecureVersion (the value we are handling here), can be one of the following: type SecureVersion = "TLSv1.3" | "TLSv1.2" | "TLSv1.1" | "TLSv1";

Source

client-options.ts, line 1112

copyBuffer()

Creates a copy of a buffer

Source

utils.ts, line 60

deepExtend()

Extends the target by the most inner props of sources

Source

utils.ts, line 170

delay()

Creates a non-clearable timer that resolves the promise once elapses.

Source

promise-utils.ts, line 18

ensure32SignedInteger(number, name)

Checks whether the number is a 32 bit signed integer. Throws an error, when a value that cannot be represented as i32 is passed.

Parameters:
Name Type Description
number
name

used in the thrown error

Source

new-utils.ts, line 102

Throws:
TypeError

ensure64SignedInteger(number, name)

Checks whether the number is a 64 bit signed integer. Throws an error, when a value that cannot be represented as i64 is passed.

Parameters:
Name Type Description
number
name

used in the thrown error

Source

new-utils.ts, line 130

Throws:
TypeError

extend(baseOptions)

Extends and validates the user options

Parameters:
Name Type Description
baseOptions

The source object instance that will be overridden

Source

client-options.ts, line 724

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.

Source

utils.ts, line 134

fixStack()

Appends the original stack trace to the error after a tick of the event loop

Source

utils.ts, line 69

fromCallback()

Creates a Promise from a callback based function.

Source

promise-utils.ts, line 43

fromEvent()

Creates a Promise that gets resolved or rejected based on an event.

Source

promise-utils.ts, line 25

getCallback()

Gets a function that has the signature of a callback that invokes the appropriate promise handler parameters.

Source

promise-utils.ts, line 60

getRowsFromResultsWrapper(columnsCache)

Simple way of getting results from rust driver. Calls the driver, decoding the whole page at once.

Parameters:
Name Type Description
columnsCache

Converted columns of the prepared handle that produced the result, when available.

Source

types/results-wrapper.ts, line 128

Returns:

Returns array of rows if the result is of the RowsResult kind, and undefined otherwise

hostIdToString()

Derives the hex string representation of a host id from a host id's raw bytes.

Source

host.ts, line 24

ifUndefined()

Returns the first not undefined param

Source

utils.ts, line 453

ifUndefined3()

Returns the first not undefined param

Source

utils.ts, line 460

insertSorted(item)

Inserts the value in the position determined by its natural order determined by the compare func

Parameters:
Name Type Description
item

Source

utils.ts, line 285

isNamedParameters()

Returns true when params is a named (object) parameter set rather than an array.

Source

new-utils.ts, line 172

Throws:

In case params are of unexpected type

Type
ArgumentError

iteratorToArray(iterator)

Convert the iterator values into an array

Parameters:
Name Type Description
iterator

Source

utils.ts, line 239

log(furtherInfoopt)

Uses the logEmitter to emit log events. Respects the logLevel option — events below the configured severity are suppressed.

Parameters:
Name Type Attributes Description
furtherInfo <optional>

Source

utils.ts, line 83

newQueryPlan(lbp, keyspace, executionOptions)

Invokes the new query plan of the load balancing policy and returns a Promise.

Parameters:
Name Type Description
lbp

The load balancing policy.

keyspace

Name of currently logged keyspace at Client level.

executionOptions

The information related to the execution of the request.

Source

promise-utils.ts, line 90

normalizeKey(name)

Normalizes a key that can be either a string or a buffer into a string.

Parameters:
Name Type Description
name

Name of the option being normalized, used for error messages

Source

client-options.ts, line 1095

normalizePagingState()

This function normalizes the type, and combines all possible page state sources.

Page state can come from two sources:

  • pageState variable: when we execute the following page of the query
  • execOptions: when the user start a new query from requested state

PageState has a priority over execOptions, as execOptions.pageState will not be cleared for the following pages of the execution.

Source

client.ts, line 1110

normalizeSslOptions()

Normalizes SSL options to be passed to the Rust layer. The SslOptions class can have values as multiple types, while the Rust code expects a specific format. We could do this at the napi layer by trying all accepted types until we successfully convert it, but we can also convert it here.

Source

client-options.ts, line 1139

objectValues()

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.

Source

utils.ts, line 402

optionalCallback()

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.

Source

promise-utils.ts, line 111

promiseWrapper()

Wraps the callback-based method. When no originalCallback is not defined, it returns a Promise.

Source

utils.ts, line 419

rejectUnsupportedReadTimeout()

Rejects legacy timeout settings that would otherwise be silently ignored. Only socketOptions.readTimeout may retain its built-in 12000 ms default; query and execution-profile settings have no such default.

Source

new-utils.ts, line 83

series()

Similar to async.series(), but instead accumulating the result in an Array, it callbacks with the result of the last function in the array.

Source

utils.ts, line 759

setMetadataDependent()

Sets the default options that depend on the protocol version and other metadata.

Source

client-options.ts, line 1211

socketAddressToString()

Returns the string representation of a given socket address.

Source

host.ts, line 15

stringRepeat()

Returns a string with a value repeated n times

Source

utils.ts, line 383

throwNotSupported(name)

Internal utility for marking not supported endpoints.

Parameters:
Name Type Description
name

Source

new-utils.ts, line 16

Throws:
ReferenceError

times()

Invokes the provided function multiple times, considering the concurrency level limit.

Source

promise-utils.ts, line 125

toBackground()

Deals with unexpected rejections in order to avoid the unhandled promise rejection warning or failure.

Source

promise-utils.ts, line 150

toCallback()

Invokes the callback once outside the promise chain the promise is resolved or rejected.

Source

promise-utils.ts, line 157

toLowerCaseProperties()

Returns a new object with the property names set to lowercase.

Source

utils.ts, line 155

totalLength()

Gets the sum of the length of the items of an array

Source

utils.ts, line 116

validateFn(fn, name)

Validates the provided parameter is of type function.

Parameters:
Name Type Description
fn

The instance to validate.

name

Name of the function to use in the error message. Defaults to 'callback'.

Source

utils.ts, line 305

validateRequestTimeout()

Validates a request timeout before it crosses the N-API boundary as an i32. undefined means that the caller should use the next value in the option precedence chain.

Source

new-utils.ts, line 62

Was this page helpful?

PREVIOUS
Events
  • Create an issue
  • Edit this page

On this page

  • Global Functions and Constants
    • Members
    • Methods
ScyllaDB Node.js Driver
Search Ask AI
  • v0.7.1
    • main
    • v0.7.1
    • v0.6.1
  • Getting Started
  • Statements
    • Executing CQL Statements - Best Practices
    • Unprepared Statements
    • Batch Statements
    • Parameterized queries
  • Fetching Large Result Sets
  • Schema Metadata
  • Topology
  • Replicas
  • Query Tracing
  • Logging
  • Policies
    • Load Balancing
    • Retry Policies
  • Authentication
  • Client Routes (Private Networking)
  • Shutdown
  • Migration Guide
  • API Reference
    • Modules
      • auth
        • AuthProvider
        • Authenticator
        • PlainTextAuthProvider
      • datastax
        • graph
        • search
      • errors
        • ArgumentError
        • AuthenticationError
        • BusyConnectionError
        • DriverInternalError
        • NoHostAvailableError
        • NotSupportedError
        • OperationTimedOutError
        • ResponseError
      • geometry
      • mapping
        • DefaultTableMappings
        • Mapper
        • ModelBatchItem
        • ModelMapper
        • Result
        • UnderscoreCqlToCamelCaseMappings
        • TableMappings
      • metrics
        • DefaultMetrics
        • ClientMetrics
      • policies
        • addressResolution
          • AddressTranslator
          • EC2MultiRegionTranslator
          • MappingAddressTranslator
        • loadBalancing
          • AllowListPolicy
          • DCAwareRoundRobinPolicy
          • DefaultLoadBalancingPolicy
          • LegacyDefaultLoadBalancingPolicy
          • LoadBalancingConfig
          • LoadBalancingPolicy
          • RoundRobinPolicy
          • TokenAwarePolicy
        • reconnection
          • ConstantReconnectionPolicy
          • ExponentialReconnectionPolicy
          • ReconnectionPolicy
        • retry
          • FallthroughRetryPolicy
          • RetryPolicy
        • timestampGeneration
          • MonotonicTimestampGenerator
          • TimestampGenerator
      • tracker
        • RequestLogger
        • RequestTracker
      • types
        • BigDecimal
        • Duration
        • InetAddress
        • Integer
        • LocalDate
        • ResultStream
        • Row
        • TimeUuid
        • Tuple
        • Uuid
    • Classes
      • Client
      • ColumnInfo
      • ConstantSpeculativeExecutionPolicy
      • DateRange
      • DateRangeBound
      • DseGssapiAuthProvider
      • DsePlainTextAuthProvider
      • Edge
      • Element
      • Encoder
      • EncoderMembers
      • ExecutionOptions
      • ExecutionProfile
      • FrameReader
      • FrameWriter
      • GraphResultSet
      • HashSet
      • LineString
      • NoSpeculativeExecutionPolicy
      • Path
      • Point
      • Polygon
      • PreparedInfo
      • Property
      • ResultColumnsCache
      • ResultSet
      • RustResult
      • RustSession
      • SpeculativeExecutionPolicy
      • SslOptions
      • Token
      • TokenRange
      • Vertex
      • VertexProperty
      • module-metadata-LocalStrategy
    • Interfaces
    • Events
    • Global Functions and Constants
Docs Tutorials University Contact Us About Us
© 2026 ScyllaDB | Terms of Service | Privacy Policy | ScyllaDB, and ScyllaDB Cloud, are registered trademarks of ScyllaDB, Inc.
Last updated on 23 Oct 2026.
Powered by Sphinx 9.1.0 & ScyllaDB Theme 1.9.3