Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Shutdown

It is not possible to explicitly close connection to the database. A connection is closed when the client variable associated with this connection is collected by the garbage collector.
Even though removal of references to the object is explicit, the actual GC run that frees objects that have no active references to is implicit.

In the DataStax NodeJS driver, it is possible to explicitly close the connection to the database. In contrast, the ScyllaDB Rust driver, which this driver relies upon, shuts down the connection when the value representing given session is dropped.

client.shutdown()

To maintain compatibility with the DataStax driver API, it’s possible to call shutdown on a given client. This endpoint is marked as deprecated and may be removed in the future. Currently the only functionality it provides is preventing execution of any new queries with the given client. It does not close connection to the database nor deallocate any structures related to that connection nor stop any queries being currently executed.

Migration guide

Query options

The following options’ remain unchanged:

  • autoPage
  • consistency
  • fetchSize
  • hints
  • prepare
  • serialConsistency
  • timestamp

The following option is no longer supported:

  • graphOptions: those options configure DSx specific features, that are not supported in this driver

Client options

The following options remain unchanged:

  • contactPoints
  • keyspace
  • credentials
  • credentials.username
  • credentials.password
  • applicationName
  • applicationVersion
  • encoding.map
  • encoding.set
  • encoding.copyBuffer
  • encoding.useUndefinedAsUnset
  • maxPrepared

The following option implementation has changed significantly, but the meaning of those option remains unchanged:

  • id: Now accepts both uuid and string types. When uuid is provided, it will be passed to the database in standard string representation.

The following options’ default values have changes:

  • encoding.useBigIntAsLong: New default - true (previously - false),
  • encoding.useBigIntAsVarint: New default - true (previously - false)

With the update of encoding options, we encourage usage of the builtin types. The ability to use the driver with types is kept as a legacy option, and may be removed in the future.

Summary