-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9d6df9
commit 04389d3
Showing
3 changed files
with
106 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
[](https://github.com/ydb-platform/ydb-java-dialects/blob/main/LICENSE.md) | ||
[](https://mvnrepository.com/artifact/tech.ydb.dialects/flyway-ydb-dialect) | ||
[](https://github.com/ydb-platform/ydb-java-dialects/actions/workflows/ci-flyway-dialect.yaml) | ||
|
||
# YDB Flyway Dialect | ||
|
||
This project allows for automated database migration to [YDB](https://ydb.tech/docs/en/), | ||
using the [Flyway](https://documentation.red-gate.com/fd/) 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](https://github.com/ydb-platform/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: | ||
|
||
```xml | ||
<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> | ||
<!-- Set an actual version --> | ||
<version>${flyway.ydb.dialect.version}</version> | ||
</dependency> | ||
``` | ||
|
||
For Gradle, add the following to your build.gradle (or build.gradle.kts): | ||
|
||
```groovy | ||
dependencies { | ||
implementation "org.flywaydb:flyway-core:$flywayCoreVersion" // Set actual version | ||
implementation "tech.ydb.dialects:flyway-ydb-dialect:$flywayYdbDialecVersion" // Set actual version | ||
implementation "tech.ydb.jdbc:ydb-jdbc-driver:${ydbJdbcVersion}" // Set actual version | ||
} | ||
``` | ||
|
||
### Installation in Flyway CLI | ||
|
||
Mac OS: | ||
|
||
```bash | ||
# 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 | ||
|
||
```properties | ||
spring.datasource.url=jdbc:ydb:grpc://localhost:2136/local | ||
``` | ||
|
||
An example of a simple Spring Boot Flyway can be found at the following | ||
[link](https://github.com/ydb-platform/ydb-java-examples/tree/master/jdbc/spring-flyway-app). | ||
|
||
## Limitations | ||
|
||
To understand what SQL constructs YDB can perform, | ||
see the [documentation](https://ydb.tech/docs/en/yql/reference/) for the query language. | ||
|
||
## Authorization | ||
|
||
See [connect to YDB](../README.md/#connect-to-ydb). | ||
|
||
## Support and Contact | ||
|
||
For support, you can open issues in the repository issue tracker with tag `flyway`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters