Skip to content

Поддержка YDB в Kotlin Exposed#214

Merged
KirillKurdyukov merged 41 commits into
ydb-platform:mainfrom
fotonchicc:exposed-ydb-dialect
May 20, 2026
Merged

Поддержка YDB в Kotlin Exposed#214
KirillKurdyukov merged 41 commits into
ydb-platform:mainfrom
fotonchicc:exposed-ydb-dialect

Conversation

@fotonchicc
Copy link
Copy Markdown
Contributor

No description provided.

@KirillKurdyukov KirillKurdyukov self-requested a review April 23, 2026 10:10
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a Kotlin Exposed dialect module for YDB, including YDB-specific SQL/DDL generation, type mappings, and supporting utilities, plus comprehensive unit/integration tests, documentation, and a runnable example.

Changes:

  • Implemented YDB dialect components: data type provider, function provider (UPSERT/LIMIT/OFFSET), table/ID/index/TTL helpers, retrying transactions, keyset pagination, optimistic locking, and JDBC metadata support.
  • Added unit + integration test suites covering core behavior (types, UPSERT, TTL, indexes, DAO/DSL flows, retry, pagination, joins/subqueries).
  • Added build/CI wiring (Maven config, Docker Compose for local YDB, GitHub Actions workflow) and end-user docs/example app.

Reviewed changes

Copilot reviewed 71 out of 71 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/types/YdbUuidColumnTypeTest.kt Unit tests for native UUID column type mapping.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/types/YdbUuidAsUtf8ColumnTypeTest.kt Unit tests for UUID-as-Utf8 mapping.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/types/YdbUuidAsStringColumnTypeTest.kt Unit tests for UUID-as-bytes/String mapping.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/types/YdbUintColumnTest.kt Unit tests for Uint64 column type validation/conversion.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/types/YdbJsonStringColumnTypeTest.kt Unit tests for Json string quoting/escaping behavior.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/types/YdbIntervalColumnTypeTest.kt Unit tests for Interval/Duration mapping.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/types/YdbDecimalColumnTypeTest.kt Unit tests for Decimal precision/scale constraints and formatting.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/types/YdbDataTypeProviderTest.kt Unit tests for YDB scalar type name mappings.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/types/Uint64TypesTest.kt (Misplaced) DB round-trip test for Uint64.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/ttl/YdbTtlColumnModeTest.kt Unit tests for TTL mode SQL suffix mapping.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/transaction/YdbRetryClassifierTest.kt Unit tests for retry classification/backoff behavior.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/functions/FunctionTest.kt Tests for UPSERT/LIMIT/OFFSET/MERGE behavior in function provider.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/basic/YdbUniqueIndexUnsupportedTest.kt Ensures UNIQUE secondary index rendering is rejected.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/basic/YdbTableTest.kt Tests YdbTable DDL generation (PK + TTL validation).
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/basic/YdbIndexSqlTest.kt Tests standard + YDB-specific secondary index SQL/DDL rendering.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/basic/YdbGeneratedIdsTest.kt Unit tests for UUID/ULID generators.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/unit/basic/YdbDialectTtlSqlTest.kt Tests ALTER TABLE SET/RESET TTL SQL generation.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/upsert/UpsertIT.kt Integration tests for UPSERT (raw SQL + DSL).
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/types/UuidTypesIT.kt Integration tests for UUID mappings round-trip + DDL.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/types/Uint64TypesIT.kt Integration tests for Uint64 round-trip + DDL.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/types/TypesIT.kt Integration tests for basic scalar types + DDL.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/types/TemporalTypesIT.kt Integration tests for Date/Datetime/Timestamp round-trip.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/types/JsonTypesIT.kt Integration tests for Json type round-trip + DDL.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/types/IntervalTypesIT.kt Integration tests for Interval type round-trip + DDL.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/types/DecimalUpdateIT.kt Integration tests for updating Decimal via a literal expression.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/types/DecimalTypesIT.kt Integration tests for Decimal round-trip + DDL.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/types/BinaryTypesIT.kt Integration tests for binary column mapping + DDL.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/ttl/TtlTypesIT.kt Integration tests for TTL clause on CREATE TABLE.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/ttl/TtlAlterSqlIT.kt Integration tests for ALTER TABLE TTL SQL generation.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/ttl/NumericTtlTypesIT.kt Integration tests for numeric TTL mode DDL.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/transaction/YdbRetryingTransactionsIT.kt Integration tests for retrying transaction helpers usage.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/scenario/UniversityScenarioIT.kt End-to-end multi-table join scenario integration test.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/query/SubqueryIT.kt Integration test for aliased subquery support.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/query/ManyToManyIT.kt Integration test for many-to-many joins via link table.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/query/JoinIT.kt Integration tests for joins + filtering.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/pagination/KeysetPaginationIT.kt Integration tests for keyset pagination helpers.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/locking/OptimisticLockingIT.kt Integration tests for optimistic locking helper semantics.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/ddl/IndexIT.kt Integration tests for indexes + JDBC metadata discovery.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/dao/GeneratedIdsIT.kt Integration tests for DAO tables with generated UUID/ULID ids.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/dao/DaoSmokeIT.kt Integration smoke test for Exposed DAO CRUD.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/crud/CrudIT.kt Integration test for basic DSL CRUD operations.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/batch/BatchOperationsIT.kt Integration tests for batch insert/upsert operations.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/base/ConnectionIT.kt Integration test ensuring YDB connection works.
kotlin-exposed-dialect/src/test/kotlin/tech/ydb/exposed/dialect/integration/base/BaseYdbTest.kt Shared integration test base (connect/schema lifecycle/tx helper).
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/types/YdbDecimalExpressions.kt Adds Decimal literal expression helper for update expressions.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/types/YdbDataTypeProvider.kt Implements YDB-specific Exposed DataTypeProvider mappings.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/types/YdbCustomColumnTypes.kt Adds custom ColumnTypes + Table extensions for YDB types.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/transaction/YdbRetryingTransaction.kt Retryable transaction helper with backoff/jitter.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/transaction/YdbRetryDecision.kt Retry decision/backoff kind data model.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/transaction/YdbRetryClassifier.kt Error-text-based retry classification + backoff policy.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/pagination/KeysetPagination.kt Keyset pagination query extensions.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/locking/YdbOptimisticLocking.kt Optimistic locking helper based on version column.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/functions/YdbFunctionProvider.kt UPSERT/LIMIT/OFFSET implementation and MERGE rejection.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/basic/YdbTtl.kt TTL settings and TTL column mode mapping.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/basic/YdbTable.kt YDB Table helper with DDL generation (PK/index/TTL).
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/basic/YdbStringIdTable.kt String-id IdTable specialization.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/basic/YdbSecondaryIndex.kt YDB secondary index spec + renderer for DDL/ALTER.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/basic/YdbIdTable.kt IdTable variant with YDB DDL and TTL/index helpers.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/basic/YdbGeneratedIds.kt UUID/ULID generators + ID table base classes.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/basic/YdbExposedBootstrap.kt Registers JDBC driver and dialect metadata with Exposed.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/basic/YdbDialectProvider.kt Connect helper wiring explicit dialect + config defaults.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/basic/YdbDialectMetadata.kt JDBC metadata implementation for existing index discovery.
kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/basic/YdbDialect.kt VendorDialect implementation (indexes + TTL + helpers).
kotlin-exposed-dialect/pom.xml Maven module definition, deps, and unit/integration test plugins.
kotlin-exposed-dialect/example/src/main/kotlin/tech/ydb/exposed/dialect/example/DemoTables.kt Example table definitions demonstrating indexes/decimals.
kotlin-exposed-dialect/example/src/main/kotlin/tech/ydb/exposed/dialect/example/DemoApp.kt Runnable demo app showing CRUD/UPSERT/pagination usage.
kotlin-exposed-dialect/example/pom.xml Maven config for example app module.
kotlin-exposed-dialect/docker-compose.yml Local YDB container for integration tests and demo app.
kotlin-exposed-dialect/README.md End-user documentation for features, setup, and usage examples.
kotlin-exposed-dialect/CHANGELOG.md Initial release changelog for 0.1.0.
.github/workflows/ci-exposed-ydb-dialect.yaml CI workflow running Maven build with YDB via Docker Compose.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/ci-exposed-ydb-dialect.yaml Outdated
@KirillKurdyukov KirillKurdyukov linked an issue May 12, 2026 that may be closed by this pull request
@pnv1 pnv1 requested a review from Copilot May 13, 2026 07:50
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 66 out of 66 changed files in this pull request and generated 5 comments.

Comment thread kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/YdbDialect.kt Outdated
Comment thread kotlin-exposed-dialect/README.md Outdated
Comment thread kotlin-exposed-dialect/CHANGELOG.md Outdated
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 77 out of 77 changed files in this pull request and generated 2 comments.

Comment thread kotlin-exposed-dialect/example/pom.xml
Comment thread kotlin-exposed-dialect/src/main/kotlin/tech/ydb/exposed/dialect/YdbColumnTypes.kt Outdated
@KirillKurdyukov KirillKurdyukov enabled auto-merge (squash) May 20, 2026 13:00
@KirillKurdyukov KirillKurdyukov disabled auto-merge May 20, 2026 13:00
@KirillKurdyukov KirillKurdyukov merged commit 631ab89 into ydb-platform:main May 20, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: Kotlin Exposed YDB Dialect

3 participants