GithubHelp home page GithubHelp logo

ydb-platform / ydb-java-dialects Goto Github PK

View Code? Open in Web Editor NEW
70.0 3.0 4.0 393 KB

The official YDB Dialects for Java ORM frameworks and migration tools.

Home Page: https://ydb.tech

License: Apache License 2.0

Java 99.11% Go 0.75% Shell 0.14%
hibernate jooq kotlin-exposed liquebase spring-data flyway

ydb-java-dialects's Introduction

License Telegram WebSite

YDB Dialects for Java ORM frameworks and migration tools

This repository contains dialects required for using Java-based Object-Relational Mapper (ORM) frameworks and popular migration tools for Yandex Database (YDB). It allows Java applications to interact with YDB using popular ORM libraries such as Hibernate, Spring Data, and JOOQ, as well as migration tools like Flyway and Liquibase.

Supports ORM Frameworks

  • Hibernate 5: Hibernate Dialect for YDB, for earlier versions (5.*). Designed to use YDB features while providing a familiar experience for Hibernate users. For more information, please visit the appropriate module.
  • Hibernate 6+: Hibernate Dialect for YDB is designed to leverage features of YDB while providing a familiar experience to Hibernate users. For more information, please visit the appropriate module.
  • JOOQ: Small JOOQ dialect is designed to be used for code generation For more information, please visit the appropriate module.

Supports migration tools

  • Liquibase: For more information, please visit the module.
  • Flyway: For more information, please visit the module.

Each module is developed independently, and the release process is separate from the others.

Each module has its own README.md file, which describes the integration process and various limitations, as well as CHANGELOG.md, which describes the releases.

Connect to YDB

  • Local or remote Docker (anonymous authentication):
    jdbc:ydb:grpc://localhost:2136/local
  • Self-hosted cluster:
    jdbc:ydb:grpcs://<host>:2135/Root/testdb?secureConnectionCertificate=file:~/myca.cer
  • Connect with token to the cloud instance:
    jdbc:ydb:grpcs://<host>:2135/path/to/database?token=file:~/my_token
  • Connect with service account to the cloud instance:
    jdbc:ydb:grpcs://<host>:2135/path/to/database?saFile=file:~/sa_key.json

Contributing

We welcome contributions from the community. Please see our contributing guidelines before making a pull request.

License

This repository is licensed under the Apache 2.0 License.

Support

For any questions or issues with the ORM Java Dialects for YDB, please open an issue on the GitHub issue tracker.

Enjoy using ORM Java Dialects with YDB!

ydb-java-dialects's People

Contributors

alex268 avatar ikriushenkov avatar kirillkurdyukov avatar snrise avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ydb-java-dialects's Issues

feat: Kotlin Exposed YDB Dialect

Useful links:

  1. JetBrains ORM Framework Exposed
  2. YDB JDBC Driver using 2.0.5
  3. YDB Types - https://ydb.tech/docs/en/yql/reference/types

Preparation:

brew docker install
brew install colima

sudo ln -sf  ~/.colima/docker.sock /var/run/docker.sock

Roadmap:

  1. Fork this repository
  2. module name is kotlin-exposed-dialect, artifactId is kotlin-exposed-ydb-dialect, groupId tech.ydb.dialects
  3. Example Database dialect - https://github.com/JetBrains/Exposed/blob/main/exposed-core/src/main/kotlin/org/jetbrains/exposed/sql/vendors/OracleDialect.kt
  4. package maybe create tech.ydb.exposed.sql.
  5. Register dialect TransactionManager.registerDialect("mydialect")
  6. override org.jetbrains.exposed.sql.vendors.DataTypeProvider.kt
  7. Full integration tests.
  8. README.md
  9. Integration test example - hibernate-dialect.

feat: support hibernate dialect v6

  1. Create a new Java class that will implement YDB Hibernate dialect. Extend org.hibernate.dialect.Dialect for YQL
  2. Override methods - change the usage of SQL functions, phrases, data types, and other YDB details.
  3. Test the custom dialect
  4. Usage example, README.md

feat: Liquibase Dialect

https://contribute.liquibase.com/code/

  • Initial module liquibase + started develop (create YdbDatabase.java + CreateIndexGeneratorYdb.java) #32
  • CreateTable sql generator #33
  • Support StandardLockService (may be use coordination service in future) #36
  • Support YDB Types (e.g CHAR change to Text, integer change to Int32) #34
  • SqlGenerators (for all SqlStatements from liquibase-core) to be implemented: #37
  1. YDB doesn't support AddAutoIncrementStatement. - SOLVED [AddAutoIncrementGenerator - database.supportsAutoIncrement() return false]
  2. YDB doesn't support AddCheckConstraintStatement. - SOLVED [supports(AddCheckConstraintStatement var1, Database var2) return false]
  3. YDB supports AddColumnStatement. - AddColumnGeneratorYdb.class with custom validation - SOLVED
  4. YDB doesn't support AddDefaultValueStatement. SOLVED [throw validationError]
  5. YDB doesn't support AddForeignKeyConstraintStatement. SOLVED [throw validationError]
  6. YDB doesn't support AddPrimaryKeyStatement. SOLVED [throw validationError]
  7. YDB doesn't support AddUniqueConstraintStatement. SOLVED [throw validationError]
  8. YDB doesn't support AlterSequenceStatement. SOLVED [ydbDatabase.supportsSequences() == false <--> ok]
  9. Dummy SQL generator for BatchDmlExecutablePreparedStatement provided by liquibase-core. OK
  10. ClearDatabaseChangeLogTableStatement. - OK [DELETE FROM TABLE - valid YQL]
  11. CommentStatement. - OK [-- comment - valid YQL]
  12. CopyRowsStatement - OK [INSERT INTO TABLE(A, B) SELECT A, B FROM A - valid YQL]
  13. CreateIndexGenerator - SOLVED (create YdbDatabase.java + CreateIndexGeneratorYdb.java) #32
  14. CreateSequenceStatement - OK [ydbDatabase.supportsSequences() == false <--> ok]
  15. YDB doesn't support CreateProcedureStatement - SOLVED [throw validationError]
  16. DeleteStatement - OK [DELET FROM TABLE WHERE A = 1 - valid YQL]
  17. DropIndexStatement - SOLVED [DropIndexGeneratorYdb]
  18. RenameTableStatement - SOLVED [RenameTableGeneratorYdb]
  19. YDB doesn't support RenameColumnStatement brrrr. - SOLVED [throw validationError]
  20. YDB doesn't support DropPrimaryKeyStatement. - [throw validationError]
  21. YDB doesn't support GetViewDefinitionStatement. - [throw validationError]

feat: support hibernate dialect v5

  1. Create a new Java class that will implement YDB Hibernate dialect. Extend org.hibernate.dialect.Dialect for YQL
  2. Override methods - change the usage of SQL functions, phrases, data types, and other YDB details.
  3. Test the custom dialect
  4. Usage example, README.md

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.