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

Add special type for scanning of unused columns (V1) #132

Merged
merged 7 commits into from
Apr 7, 2024
Merged

Add special type for scanning of unused columns (V1) #132

merged 7 commits into from
Apr 7, 2024

Conversation

br3w0r
Copy link
Contributor

@br3w0r br3w0r commented Mar 27, 2024

The problem: at my job when we worked with custom enums there was a problem when a new custom enum wasn't yet added to a struct for scanning. It leaded to an error when SELECT * FROM ... was used:

scany: scan row into struct fields: can't scan into dest[<idx>]: unknown oid <oid> cannot be scanned into *interface {}

This problem occurs because the interface{} type obviously doesn't implement the sql.Scanner interface. So, I added a new type that does the job and replaced the interface{} that was used for scanning of columns which wouldn't be used.

@georgysavva
Copy link
Owner

Hi, thank you for this catch. Can I ask you to also add a test for this use case please?

Copy link

codecov bot commented Mar 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.63%. Comparing base (5c09502) to head (2b8f25c).

Additional details and impacted files
@@            Coverage Diff             @@
##               v1     #132      +/-   ##
==========================================
- Coverage   82.81%   82.63%   -0.18%     
==========================================
  Files           5        5              
  Lines         512      432      -80     
==========================================
- Hits          424      357      -67     
+ Misses         73       60      -13     
  Partials       15       15              
Flag Coverage Δ
unittests 82.63% <100.00%> (-0.18%) ⬇️

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.

@br3w0r
Copy link
Contributor Author

br3w0r commented Mar 31, 2024

@georgysavva done!

@georgysavva
Copy link
Owner

@br3w0r, thank you for your contribution. I will go ahead and release a new version with this fix.

@georgysavva georgysavva merged commit 7e6e67b into georgysavva:v1 Apr 7, 2024
10 checks passed
georgysavva added a commit that referenced this pull request Apr 7, 2024
* add noOpScanType

* remove Value method

* add test for scanning of unknown enum

* fix tests

* update db version

* fix codecov

* use token in codecov

---------

Co-authored-by: Georgy Savva <georgy.savva@gmail.com>
georgysavva added a commit that referenced this pull request Apr 7, 2024
* add noOpScanType

* remove Value method

* add test for scanning of unknown enum

* fix tests

* update db version

* fix codecov

* use token in codecov

---------

Co-authored-by: br3w0r <daniildirun123@gmail.com>
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.

2 participants