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

Pass allow unknown flag to row scanner. #5

Merged
merged 3 commits into from
Jul 18, 2023

Conversation

popescu-af
Copy link
Contributor

@popescu-af popescu-af commented Jul 18, 2023

  • Pass the flag to row scanner
  • Add test
  • Extra: initialize row scanner targets array with valid pointers,
    because it is not guaranteed that all drivers support scanning into nil
    (golang's database/sql does not for example).

@stephenafamo
Copy link
Owner

I would rather not add the extra initialization every time. This would add extra allocations even when they are not needed.

Instead, it would be better to only initialize if the column is skipped, i.e. if allowUnknown is true and there is no scanDestination.

exec_test.go Outdated Show resolved Hide resolved
Co-authored-by: Stephen Afam-Osemene <me@stephenafamo.com>
@stephenafamo stephenafamo merged commit 1c204ee into stephenafamo:main Jul 18, 2023
2 checks passed
@popescu-af popescu-af deleted the 4/pass_allow_unknown_flag branch July 18, 2023 12:22
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