ydb course repository migrate to new v3 #12

Closed
opened 2026-07-03 17:36:55 +00:00 by frx · 2 comments
Owner

Library is https://github.com/ydb-platform/ydb-go-sdk.git
Documents and FAQ: https://ydb.tech/docs/ru/dev/example-app/go/?version=v26.1

Read the documentation, remove old implementation and add a new one

Library is https://github.com/ydb-platform/ydb-go-sdk.git Documents and FAQ: https://ydb.tech/docs/ru/dev/example-app/go/?version=v26.1 Read the documentation, remove old implementation and add a new one
frx added the
enhancement
label 2026-07-03 17:36:55 +00:00
hermes was assigned by frx 2026-07-03 17:36:55 +00:00
Collaborator

Issue #12 Resolved — Merged

Root Cause

The ydb_course_repository.go used deprecated ydb-go-sdk v2 patterns (manual REPLACE INTO ... FROM AS_TABLE, hand-built TxControl, missing interface methods).

Key Changes

  • Rewrote ydb_course_repository.go using ydb-go-sdk/v3 API:
    • BulkUpsert for batch inserts (replaces manual table expressions)
    • DoTx for write operations (DELETE, UPDATE)
    • OnlineReadOnlyTxControl() for reads (replaces manual TxControl construction)
    • Added missing ListStatistics method (required by CourseRepository interface)
    • Added GetByExternalID implementation
    • Cleaner param building patterns
  • 2 files changed, +369/−581 (net reduction)

Verification

  • Build and tests passed before merge (automated OpenCode verification).

## Issue #12 Resolved — Merged ### Root Cause The `ydb_course_repository.go` used deprecated ydb-go-sdk v2 patterns (manual `REPLACE INTO ... FROM AS_TABLE`, hand-built `TxControl`, missing interface methods). ### Key Changes - Rewrote `ydb_course_repository.go` using ydb-go-sdk/v3 API: - **`BulkUpsert`** for batch inserts (replaces manual table expressions) - **`DoTx`** for write operations (DELETE, UPDATE) - **`OnlineReadOnlyTxControl()`** for reads (replaces manual TxControl construction) - Added missing **`ListStatistics`** method (required by `CourseRepository` interface) - Added **`GetByExternalID`** implementation - Cleaner param building patterns - 2 files changed, +369/−581 (net reduction) ### Verification - Build and tests passed before merge (automated OpenCode verification). --- - **PR:** #13 (merged by hermes at 2026-07-09T10:51:06Z) - **Merge commit:** `4fe6758` - **Changes:** 2 files (+369/−581) - **Issue:** #12
Collaborator

Issue #12 Resolved — Merged

Root Cause

The YDB course repository implementation used deprecated ydb-go-sdk v1 API patterns (REPLACE INTO ... FROM AS_TABLE, manual TxControl construction) that were incompatible with the current v3 SDK.

Key Changes

  • Rewrote ydb_course_repository.go using modern ydb-go-sdk/v3 API patterns:
    • BulkUpsert for batch inserts (replaces manual REPLACE INTO ... FROM AS_TABLE)
    • DoTx for write operations (DELETE, UPDATE)
    • OnlineReadOnlyTxControl() for reads (replaces manual TxControl construction)
    • Added missing ListStatistics method (required by CourseRepository interface)
    • Added GetByExternalID implementation
    • Cleaner param building with explicit DECLARE statements
  • Re-enabled YDB engine in service.go (was returning "ydb is no longer supported")

Review Feedback

PR approved by @frx — no changes requested.

Verification

  • go vet ./...
  • go build ./...
  • go test ./... (all existing tests pass)

## Issue #12 Resolved — Merged ### Root Cause The YDB course repository implementation used deprecated ydb-go-sdk v1 API patterns (`REPLACE INTO ... FROM AS_TABLE`, manual `TxControl` construction) that were incompatible with the current v3 SDK. ### Key Changes - **Rewrote `ydb_course_repository.go`** using modern ydb-go-sdk/v3 API patterns: - `BulkUpsert` for batch inserts (replaces manual `REPLACE INTO ... FROM AS_TABLE`) - `DoTx` for write operations (DELETE, UPDATE) - `OnlineReadOnlyTxControl()` for reads (replaces manual TxControl construction) - Added missing `ListStatistics` method (required by `CourseRepository` interface) - Added `GetByExternalID` implementation - Cleaner param building with explicit DECLARE statements - **Re-enabled YDB engine** in `service.go` (was returning "ydb is no longer supported") ### Review Feedback PR approved by @frx — no changes requested. ### Verification - `go vet ./...` ✅ - `go build ./...` ✅ - `go test ./...` ✅ (all existing tests pass) --- - PR: #13 (merged by @hermes at 2026-07-09T10:51:06Z) - Merge commit: `4fe6758` - Changes: 2 files (+369/−581) - Issue: #12
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: frx/kurious#12
No description provided.