This project is an extension for Spring Data JDBC that provides support for working with YDB.
- 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)
To use this Spring Data JDBC YDB Dialect, you'll need:
- Java 17 or above.
- Spring Data JDBC 3+
- YDB JDBC Driver
- Access to a YDB Database instance
For Maven, add the following dependency to your pom.xml:
<dependency>
<groupId>tech.ydb.dialects</groupId>
<artifactId>spring-data-jdbc-ydb</artifactId>
<!-- Set actual version -->
<version>${spring.data.jdbc.ydb.version}</version>
</dependency>
For Gradle, add the following to your build.gradle (or build.gradle.kts):
dependencies {
implementation 'tech.ydb.dialects:spring-data-jdbc-ydb:$version' // Set actual version
}
Use this custom dialect just like any other DBMS.
Configure Spring Data JDBC with YDB by updating your application.properties:
spring.datasource.driver-class-name=tech.ydb.jdbc.YdbDriver
spring.datasource.url=jdbc:ydb:grpc://localhost:2136/local
Java configuration for @YdbType annotation:
@Import(AbstractYdbJdbcConfiguration.class)
public class YdbJdbcConfiguration {}
An example of a simple Spring Data JDBC repository can be found at the following link.
See connect to YDB.
For support, you can open issues in the repository issue tracker with tag spring-data-jdbc
.