ydb course repository migrate to new v3 #12
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
Issue #12 Resolved — Merged
Root Cause
The
ydb_course_repository.goused deprecated ydb-go-sdk v2 patterns (manualREPLACE INTO ... FROM AS_TABLE, hand-builtTxControl, missing interface methods).Key Changes
ydb_course_repository.gousing ydb-go-sdk/v3 API:BulkUpsertfor batch inserts (replaces manual table expressions)DoTxfor write operations (DELETE, UPDATE)OnlineReadOnlyTxControl()for reads (replaces manual TxControl construction)ListStatisticsmethod (required byCourseRepositoryinterface)GetByExternalIDimplementationVerification
4fe6758Issue #12 Resolved — Merged
Root Cause
The YDB course repository implementation used deprecated ydb-go-sdk v1 API patterns (
REPLACE INTO ... FROM AS_TABLE, manualTxControlconstruction) that were incompatible with the current v3 SDK.Key Changes
ydb_course_repository.gousing modern ydb-go-sdk/v3 API patterns:BulkUpsertfor batch inserts (replaces manualREPLACE INTO ... FROM AS_TABLE)DoTxfor write operations (DELETE, UPDATE)OnlineReadOnlyTxControl()for reads (replaces manual TxControl construction)ListStatisticsmethod (required byCourseRepositoryinterface)GetByExternalIDimplementationservice.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)4fe6758