Upgrading from the DSE Driver

This guide is intended for users of the DSE driver that plan to migrate to the cassandra-driver.

The cassandra-driver now supports all DataStax products and features, such as Unified Authentication, Kerberos, geo types and graph traversal executions, allowing you to use a single driver for Apache Cassandra, DSE or other DataStax products.

Upgrading from dse-driver to cassandra-driver can be as simple as changing the import statement to point to the dse package:

const { Client } = require('dse-driver');

const client = new Client({
  contactPoints: ['host1', 'host2'],
  localDataCenter: 'datacenter1' 
});

Becomes:

const { Client } = require('cassandra-driver');

const client = new Client({
  contactPoints: ['host1', 'host2'],
  localDataCenter: 'datacenter1' 
});

Submodules

Most of the child modules are in the same path.

const { auth, types, geometry, policies, mapping } = require('dse-driver');

Becomes:

const { auth, types, geometry, policies, mapping } = require('cassandra-driver');

The only notable module path distinctions are Graph and Search types that are under datastax module.

const { graph, search } = require('dse-driver');

Becomes:

const { datastax } = require('cassandra-driver');
const { graph, search } = datastax;

Load balancing policy

The default load balancing policy on the dse-driver was DseLoadBalancingPolicy. In the cassandra-driver, a policy with the same behaviour is called DefaultLoadBalancingPolicy, which is the default.