Skip to content

Latest commit

 

History

History

flyway-dialect

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

License Maven metadata URL CI

YDB Flyway Dialect

This project allows for automated database migration to YDB, using the Flyway migration tool.

Flyway simplifies database migrations and provides version control for database schema changes, which is incredibly useful in team-based development environments.

Features

  • Support main Flyway commands: migrate, info, repair, validate, and clean
  • Safe when used in parallel

Getting Started

To use this YDB Flyway Dialect, you'll need:

  • Java 17 or above
  • YDB JDBC Driver
  • Access to a YDB Database instance
  • Flyway 10 or above

Installation in Java application.

For Maven, add the following dependency to your pom.xml:

<!-- Set an actual versions -->

<dependency>
    <groupId>org.flywaydb</groupId>
    <artifactId>flyway-core</artifactId>
    <version>${flyway.core.version}</version>
</dependency>

<dependency>
    <groupId>tech.ydb.jdbc</groupId>
    <artifactId>ydb-jdbc-driver</artifactId>
    <version>${ydb.jdbc.version}</version>
</dependency>

<dependency>
    <groupId>tech.ydb.dialects</groupId>
    <artifactId>flyway-ydb-dialect</artifactId>
    <version>${flyway.ydb.dialect.version}</version>
</dependency>

For Gradle, add the following to your build.gradle (or build.gradle.kts):

dependencies {
    // Set an actual versions
    implementation "org.flywaydb:flyway-core:$flywayCoreVersion"
    implementation "tech.ydb.dialects:flyway-ydb-dialect:$flywayYdbDialecVersion"
    implementation "tech.ydb.jdbc:ydb-jdbc-driver:$ydbJdbcVersion"
}

Installation in Flyway CLI

Mac OS:

# install flyway
# $(which flyway)

cp flyway-ydb-dialect-${version-dialect}.jar ./libexec/lib
cp ydb-jdbc-driver-shaded-${version-jdbc}.jar ./libexec/drivers

Usage

Use this custom dialect just like any other Flyway dialect.

Integration with Spring Boot

spring.datasource.url=jdbc:ydb:grpc://localhost:2136/local

An example of a simple Spring Boot Flyway can be found at the following link.

Limitations

To understand what SQL constructs YDB can perform, see the documentation for the query language.

Authorization

See connect to YDB.

Support and Contact

For support, you can open issues in the repository issue tracker with tag flyway.