Flyway migration using Yugabyte JDBC Smart Driver?

63 Views Asked by At

I googled a lot, but could not find the answer. Does Flyway support Yugabyte JDBC Smart Driver (jdbc-yugabytedb)? I am getting following error when start my Spring Boot app:

Caused by: org.flywaydb.core.api.FlywayException: No database found to handle jdbc:yugabytedb://127.0.0.1:5433/dw_disputes at org.flywaydb.core.internal.database.DatabaseTypeRegister.getDatabaseTypeForUrl(DatabaseTypeRegister.java:54)

Datasource:

spring.datasourceurl=jdbc:yugabytedb://127.0.0.1:5433/dw_disputes spring.datasource.driverClassName=com.yugabyte.Driver

I am using above same for flyway datasource.

Maven Dependencies:

    <dependency>
        <groupId>com.yugabyte</groupId>
        <artifactId>jdbc-yugabytedb</artifactId>
        <version>42.3.5-yb-4</version>
    </dependency>
    <dependency>
        <artifactId>flyway-core</artifactId>
        <groupId>org.flywaydb</groupId>
        <version>10.7.1</version>
    </dependency>
    <dependency>
        <groupId>org.flywaydb</groupId>
        <artifactId>flyway-database-yugabytedb</artifactId>
        <version>10.7.0</version>
    </dependency>

When I was debugging, found following: enter image description here

enter image description here

1

There are 1 best solutions below

0
dh YB On

Does Flyway support Yugabyte JDBC Smart Driver (jdbc-yugabytedb)?

Not yet, but it's in the works https://github.com/yugabyte/flyway/pull/2. Currently, you can use the normal pgJDBC driver though, like in Flyway docs or YugabyteDB docs.

Is there any reason you want to use the Yugabyte JDBC smart driver in this case? It's mainly used for client applications that need to support failover and query routing which isn't usually needed for DDL because the DDL happens on the yb-master service, and all yb-tserver cache the schema from there.

If the need is for failover, then you can use "multiple hostnames in the connection string", which is supported by both PostgreSQL & Yugabyte servers & drivers.