Couchbase
Published 04 September 2025
- Status: Preview
- Verified Versions: V7.6.6-N1QL
- Maintainer: Redgate
Supported Versions and Support Levels
- For information regarding the supported version and support levels available, please see Supported Databases for Flyway
- For information regarding the Flyway features available, please see Flyway feature summary
Driver
Item | Details |
---|---|
URL format | couchbases://cb.<cluster-id>.cloud.couchbase.com |
SSL support | No |
Ships with Flyway Command-line | Yes |
Maven Central coordinates | n/a |
Supported versions | 7 |
Default Java class | com.couchbase.client |
Terminology
We have to map Flyway concepts and language rooted in the relational database world to Couchbase - this is how Flyway sees the mapping:
Couchbase Concept | Flyway Concept |
---|---|
bucket + scope | schema |
collection | table |
document | row |
Using Flyway with Couchbase
Configuring Flyway
Since Couchbase has no default schema, you must define at least one schema, using either the defaultSchema
parameter or the schemas parameter.
The schema can be specified in two ways:
-
As {String}, Flyway interprets this string as the
bucket
name. In this case, Flyway uses_default
as the defaultscope
. -
As {String.String}, Flyway splits the value at the
.
character, treating the first part as thebucket
name and the second part as thescope
name.
Couchbase does not support embedding credentials (username and password) in the connection URL. Credentials must instead be provided separately through parameters in the Flyway Environment namespace.
[environments.sample]
url = "couchbases://cb.<cluster-id>.cloud.couchbase.com"
user = "user"
password = "password"
[flyway]
environment = "sample"
defaultSchema = "bucket.scope"
Limitations
- You can't currently do a Dry-run operation with Couchbase.
- Currently, Flyway allows only one statement per migration. Using multiple statements within a single migration file is not supported
- Schema creation and drop. Flyway currently supports creating and dropping
scope
, but does not support creating or droppingbucket
.
Considerations
- Transactions are supported; however, not all statements in Couchbase can be executed within a transaction. Flyway does not attempt to automatically group migrations. When the group parameter is enabled, it is the user’s responsibility to ensure that all statements are transaction-compatible.
- Currently, when connecting via the Flyway command line, a warning message related to
SLF4J binding
may appear. This is a known issue and is under investigation. - Couchbase is supported only in
Native Connectors
mode. If the environment variableFLYWAY_NATIVE_CONNECTORS
is set tofalse
then Flyway will be unable to operate and will output an error "No Flyway database plugin found to handle ...". - Foundational support is currently in preview and has been verified only in cloud deployments. If you encounter any issues when using it with on-premise deployments, please report them through any convenient channel.