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

Fixes for empty SQL sub-objects #519

Merged
merged 1 commit into from
Nov 24, 2023
Merged

Fixes for empty SQL sub-objects #519

merged 1 commit into from
Nov 24, 2023

Conversation

milessabin
Copy link
Member

The handling of empty SQL subobjects (previously represented by a context-free singleton EmptySqlQuery) was incorrect in several scenarios.

This showed up in particular in mixed mappings where non-SQL fields were nested in SQL objects. This manifested itself as unexpectedly empty arrays of subobjects, or possibly hit previously unimplemented methods of EmptySqlQuery. Both are fixed by ensuring that SQL ids are included when we, in effect, "join" a SQL with a non-SQL object. EmptySqlQuery is now a non-singleton and has a context and the unimplemented methods have been either implemented or removed.

@milessabin milessabin added the bug Something isn't working label Nov 24, 2023
@milessabin milessabin requested a review from tpolecat November 24, 2023 12:30
@milessabin milessabin self-assigned this Nov 24, 2023
@codecov-commenter
Copy link

Codecov Report

Attention: 16 lines in your changes are missing coverage. Please review.

Comparison is base (b5b703c) 72.39% compared to head (63f8368) 72.48%.
Report is 2 commits behind head on main.

Files Patch % Lines
modules/sql/shared/src/main/scala/SqlMapping.scala 84.15% 16 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #519      +/-   ##
==========================================
+ Coverage   72.39%   72.48%   +0.08%     
==========================================
  Files          32       32              
  Lines        4340     4332       -8     
  Branches      927      951      +24     
==========================================
- Hits         3142     3140       -2     
+ Misses       1198     1192       -6     

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

@milessabin milessabin requested a review from swalker2m November 24, 2023 14:36
Copy link
Collaborator

@swalker2m swalker2m left a comment

Choose a reason for hiding this comment

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

Thanks for working on this. I tested it with my code that had been failing and it worked great. 👍

@milessabin milessabin merged commit a085aca into main Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants