Skip to content
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

feat(string): added nullable String/Null for sql/json #47

Merged
merged 5 commits into from
Jun 12, 2024

Conversation

cnlangzi
Copy link
Member

@cnlangzi cnlangzi commented Jun 12, 2024

Changes

  • added String and Null for sql/json

Summary by Sourcery

This pull request introduces a new String type to handle nullable strings for SQL and JSON operations. It also refactors the Time struct to use a common null handling mechanism and adds comprehensive tests for the new String type.

  • New Features:
    • Introduced a new String type to handle nullable strings for SQL and JSON operations.
  • Enhancements:
    • Refactored the Time struct to use a common nullJsonBytes and nullJson for JSON null handling.
  • Tests:
    • Added comprehensive tests for the new String type, including SQL insertions and JSON marshaling/unmarshaling.

Copy link

sourcery-ai bot commented Jun 12, 2024

Reviewer's Guide by Sourcery

This pull request introduces a nullable String type for SQL and JSON handling. The implementation includes the addition of a new String struct, modifications to existing Time struct methods to use a common nullJson constant, and new test cases to validate the functionality of the String type in both SQL and JSON contexts.

File-Level Changes

Files Changes
time.go
string.go
Introduced a new String struct and updated Time struct methods to use a common nullJson constant for JSON handling.
string_test.go
bool_test.go
Added and updated test cases to validate the new String type and fixed a minor issue in bool_test.go.

Tips
  • Trigger a new Sourcery review by commenting @sourcery-ai review on the pull request.
  • You can change your review settings at any time by accessing your dashboard:
    • Enable or disable the Sourcery-generated pull request summary or reviewer's guide;
    • Change the review language;
  • You can always contact us if you have any questions or feedback.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @cnlangzi - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

Copy link

deepsource-io bot commented Jun 12, 2024

Here's the code health analysis summary for commits d72967c..d5853da. View details on DeepSource ↗.

Analysis Summary

AnalyzerStatusSummaryLink
DeepSource Go LogoGo✅ Success
❗ 1 occurence introduced
View Check ↗

💡 If you’re a repository administrator, you can configure the quality gates from the settings.

@cnlangzi cnlangzi changed the title feat(string): added nullable String for sql/json feat(string): added nullable String/Null for sql/json Jun 12, 2024
@cnlangzi
Copy link
Member Author

@sourcery-ai review

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We have skipped reviewing this pull request. It looks like we've already reviewed this pull request.

Copy link

codecov bot commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 91.66667% with 4 lines in your changes missing coverage. Please review.

Project coverage is 77.12%. Comparing base (d72967c) to head (d5853da).

Files Patch % Lines
null.go 91.30% 1 Missing and 1 partial ⚠️
string.go 91.30% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #47      +/-   ##
==========================================
+ Coverage   76.76%   77.12%   +0.35%     
==========================================
  Files          44       46       +2     
  Lines        1838     1884      +46     
==========================================
+ Hits         1411     1453      +42     
- Misses        304      306       +2     
- Partials      123      125       +2     
Flag Coverage Δ
Unit-Tests 77.12% <91.66%> (+0.35%) ⬆️

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.

@cnlangzi cnlangzi merged commit c243137 into main Jun 12, 2024
7 checks passed
@cnlangzi cnlangzi deleted the feat/nullstring branch June 12, 2024 01:50
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.

1 participant