This project utilizes Liquibase to manage database schema changes for the Yandex Database (YDB), ensuring a consistent and version-controlled approach to database schema evolution. Liquibase is an open-source, database-independent library for tracking, managing, and applying database schema changes.
- Generate SQL (YQL) from .xml .json .yaml changelog files
- Apply migration via YDB JDBC Driver
To use this YDB Liquibase Dialect, you'll need:
- Java 8 or above
- YDB JDBC Driver
- Access to a YDB Database instance
For Maven, add the following dependency to your pom.xml:
<!-- Set an actual versions -->
<dependency>
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>${liquibase.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>liquibase-ydb-dialect</artifactId>
<version>${liquibase.ydb.dialect.version}</version>
</dependency>
For Gradle, add the following to your build.gradle (or build.gradle.kts):
dependencies {
// Set actual versions
implementation "org.liquibase:liquibase-core:$liquibaseCoreVersion"
implementation "tech.ydb.dialects:liquibase-ydb-dialect:$liquibaseYdbDialecVersion"
implementation "tech.ydb.jdbc:ydb-jdbc-driver:$ydbJdbcVersion"
}
Mac OS:
# install liquibase
cp liquibase-ydb-dialect-${version-dialect}.jar /usr/local/opt/liquibase/internal/lib
cp ydb-jdbc-driver-shaded-${version-jdbc}.jar /usr/local/opt/liquibase/internal/lib
Use this custom dialect just like any other Liquibase dialect.
spring.datasource.url=jdbc:ydb:grpc://localhost:2136/local
spring.liquibase.change-log=classpath:changelog.yaml
An example of a simple Spring Boot Liquibase can be found at the following link.
To understand what SQL constructs YDB can perform, see the documentation for the query language.
See connect to YDB.
For support, you can open issues in the repository issue tracker with tag liquibase
.