Redgate Flyway

Cassandra Database - Native Connectors

Supported Versions and Support Levels

Driver

Item Details
URL format cassandra://host:port/keyspace?localdatacenter=datacenter1
Ships with Flyway Command-line Yes
Maven Central coordinates org.apache.cassandra:java-driver-core
Default port 9042

Using Flyway with Cassandra Native Connectors

Flyway's Native Connector support for Cassandra requires setting the environment variable FLYWAY_NATIVE_CONNECTORS=true.

Unlike the JDBC connector, the Native Connector communicates directly with Cassandra using the Java driver API rather than going through a JDBC wrapper. The legacy jdbc:cassandra:// prefix is also accepted but deprecated.

Good to know

CQL file extensions

Cassandra migrations typically have a .cql migration suffix, we recommend configuring flyway to pick these up using the sqlMigrationSuffixes Parameter.

You would specify this in your TOML configuration like this:

[flyway]
sqlMigrationSuffixes = [".cql"]

Default schema/keyspace

Flyway maps it's concept of schema onto a keyspace in Cassandra. If a keyspace is specified in the URL, it will be used as the default schema. You can also configure it explicitly using:

Limitations

  • You can't currently do a Dry-run on operations with Cassandra.

Didn't find what you were looking for?