Skip to content

added json unmarshaler for castTo #1825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

flymedllva
Copy link

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

-

What is the new behavior?

query.Row.ScanStruct supports json.Marshaller, but it does not work in the reverse direction (when receiving data from the database), for this purpose I add json.Unmarshaler for convenient work with QueryClient.

Other information

-

@codecov-commenter
Copy link

codecov-commenter commented Jun 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.74%. Comparing base (0d167dd) to head (c842b9d).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1825      +/-   ##
==========================================
- Coverage   70.81%   70.74%   -0.07%     
==========================================
  Files         386      386              
  Lines       40234    40252      +18     
==========================================
- Hits        28492    28477      -15     
- Misses      10575    10596      +21     
- Partials     1167     1179      +12     
Flag Coverage Δ
experiment 70.29% <100.00%> (-0.17%) ⬇️
go-1.21.x 68.41% <100.00%> (-0.05%) ⬇️
go-1.24.x 70.71% <100.00%> (-0.10%) ⬇️
integration 53.46% <0.00%> (-0.47%) ⬇️
macOS 40.47% <100.00%> (+0.04%) ⬆️
ubuntu 70.74% <100.00%> (-0.08%) ⬇️
unit 40.48% <100.00%> (+0.06%) ⬆️
windows 40.46% <100.00%> (+0.04%) ⬆️
ydb-24.4 52.52% <0.00%> (-0.63%) ⬇️
ydb-25.1 53.36% <0.00%> (-0.52%) ⬇️
ydb-latest 52.80% <0.00%> (-0.70%) ⬇️
ydb-nightly 70.29% <100.00%> (-0.17%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@@ -1369,6 +1370,16 @@ func (v jsonValue) castTo(dst any) error {
case *[]byte:
*vv = xstring.ToBytes(string(v))

return nil
case json.Unmarshaler:
Copy link
Member

Choose a reason for hiding this comment

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

Не хватает тестов на эти типы - хотя бы для того, чтобы в будущем не сломать эту функциональность

Copy link
Member

Choose a reason for hiding this comment

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

Не хватает строчки в CHANGELOG.md

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants