diff --git a/.github/workflows/ci-spring-data-jdbc-ydb.yaml b/.github/workflows/ci-spring-data-jdbc-ydb.yaml index 334b496..d9042d4 100644 --- a/.github/workflows/ci-spring-data-jdbc-ydb.yaml +++ b/.github/workflows/ci-spring-data-jdbc-ydb.yaml @@ -46,16 +46,16 @@ jobs: working-directory: ./spring-data-jdbc-ydb run: mvn $MAVEN_ARGS install -# - uses: actions/checkout@v4 -# with: -# repository: ydb-platform/ydb-java-examples -# ref: master -# path: examples -# -# - name: Download dependencies -# working-directory: ./examples/jdbc/spring-data-jpa-v5 -# run: mvn $MAVEN_ARGS -Dspring.data.jdbc.ydb.dialect.version=$SPRING_DATA_JDBC_DIALECT_VERSION dependency:go-offline -# -# - name: Test examples with Maven -# working-directory: ./examples/jdbc/spring-data-jpa-v5 -# run: mvn $MAVEN_ARGS -Dspring.data.jdbc.ydb.dialect.version=$SPRING_DATA_JDBC_DIALECT_VERSION test + - uses: actions/checkout@v4 + with: + repository: ydb-platform/ydb-java-examples + ref: master + path: examples + + - name: Download dependencies + working-directory: ./examples/jdbc/spring-data-jdbc + run: mvn $MAVEN_ARGS -Dspring.data.jdbc.ydb.version=$SPRING_DATA_JDBC_DIALECT_VERSION dependency:go-offline + + - name: Test examples with Maven + working-directory: ./examples/jdbc/spring-data-jdbc + run: mvn $MAVEN_ARGS -Dspring.data.jdbc.ydb.version=$SPRING_DATA_JDBC_DIALECT_VERSION test diff --git a/hibernate-dialect/NOTES.md b/hibernate-dialect/NOTES.md deleted file mode 100644 index e69de29..0000000 diff --git a/hibernate-dialect/README.md b/hibernate-dialect/README.md index 7ebf072..51791ea 100644 --- a/hibernate-dialect/README.md +++ b/hibernate-dialect/README.md @@ -89,11 +89,6 @@ spring.datasource.url=jdbc:ydb:grpc://localhost:2136/local An example of a simple Spring Data JPA repository can be found at the following [link](https://github.com/ydb-platform/ydb-java-examples/tree/master/jdbc/spring-data-jpa). -## Known Limitations - -In the section [NOTES.md](./NOTES.md), we list all the current dialect limitations -and provide solutions to them. - ## Support and Contact For support, you can open issues in the repository issue tracker with tag `hibernate-v6`. diff --git a/spring-data-jdbc-ydb/CHANGELOG.md b/spring-data-jdbc-ydb/CHANGELOG.md new file mode 100644 index 0000000..1e85961 --- /dev/null +++ b/spring-data-jdbc-ydb/CHANGELOG.md @@ -0,0 +1,5 @@ +## 0.9.1 ## + +- Supported VIEW INDEX statement from @ViewIndex +- YdbDialect fully supports YQL +- Supported specific @YdbType \ No newline at end of file diff --git a/spring-data-jdbc-ydb/README.md b/spring-data-jdbc-ydb/README.md index cfd65b5..10640cf 100644 --- a/spring-data-jdbc-ydb/README.md +++ b/spring-data-jdbc-ydb/README.md @@ -1 +1,75 @@ # YDB Spring Data JDBC Dialect + +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/ydb-platform/ydb-java-dialects/blob/main/LICENSE.md) +[![Maven metadata URL](https://img.shields.io/maven-metadata/v?metadataUrl=https%3A%2F%2Frepo1.maven.org%2Fmaven2%2Ftech%2Fydb%2Fdialects%2Fspring-data-jdbc-ydb%2Fmaven-metadata.xml)](https://mvnrepository.com/artifact/tech.ydb.dialects/spring-data-jdbc-ydb) +[![CI](https://img.shields.io/github/actions/workflow/status/ydb-platform/ydb-java-dialects/ci-spring-data-jdbc-ydb.yaml?branch=main&label=CI)](https://github.com/ydb-platform/ydb-java-dialects/actions/workflows/ci-spring-data-jdbc-ydb.yaml) + +## Overview + +This project is an extension for Spring Data JDBC +that provides support for working with [YDB](https://ydb.tech). + +### Features + +- Full support for basic operations with Spring Data JDBC +- Supported VIEW INDEX statement from @ViewIndex annotation on method your Repository +- @YdbType explicitly specifies the YDB data type (Json example in String type) + +## Getting Started + +### Requirements + +To use this Spring Data JDBC YDB Dialect, you'll need: + +- Java 17 or above. +- Spring Data JDBC 3+ +- [YDB JDBC Driver](https://github.com/ydb-platform/ydb-jdbc-driver) +- Access to a YDB Database instance + +### Installation + +For Maven, add the following dependency to your pom.xml: + +```xml + + tech.ydb.dialects + spring-data-jdbc-ydb + + ${spring.data.jdbc.ydb.version} + +``` + +For Gradle, add the following to your build.gradle (or build.gradle.kts): + +```groovy +dependencies { + implementation 'tech.ydb.dialects:spring-data-jdbc-ydb:$version' // Set actual version +} +``` + +## Usage + +Use this custom dialect just like any other DBMS. + +## Configuration + +Configure Spring Data JDBC with YDB by updating your application.properties: + +```properties +spring.datasource.driver-class-name=tech.ydb.jdbc.YdbDriver +spring.datasource.url=jdbc:ydb:grpc://localhost:2136/local +``` + +Java configuration for @YdbType annotation: + +```java +@Import(AbstractYdbJdbcConfiguration.class) +public class YdbJdbcConfiguration {} +``` + +An example of a simple Spring Data JDBC repository can be found at the following +[link](https://github.com/ydb-platform/ydb-java-examples/tree/master/jdbc/spring-data-jdbc). + +## Support and Contact + +For support, you can open issues in the repository issue tracker with tag `spring-data-jdbc`. \ No newline at end of file diff --git a/spring-data-jdbc-ydb/src/test/java/tech/ydb/data/YdbJdbcConfiguration.java b/spring-data-jdbc-ydb/src/test/java/tech/ydb/data/YdbJdbcConfiguration.java index eb94106..87fc4ad 100644 --- a/spring-data-jdbc-ydb/src/test/java/tech/ydb/data/YdbJdbcConfiguration.java +++ b/spring-data-jdbc-ydb/src/test/java/tech/ydb/data/YdbJdbcConfiguration.java @@ -1,6 +1,7 @@ package tech.ydb.data; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; import org.springframework.data.jdbc.repository.config.EnableJdbcAuditing; import org.springframework.data.jdbc.repository.config.EnableJdbcRepositories; import tech.ydb.data.repository.config.AbstractYdbJdbcConfiguration; @@ -11,5 +12,5 @@ @Configuration @EnableJdbcRepositories @EnableJdbcAuditing -public class YdbJdbcConfiguration extends AbstractYdbJdbcConfiguration { -} +@Import(AbstractYdbJdbcConfiguration.class) +public class YdbJdbcConfiguration {} \ No newline at end of file