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

NULL treated as string "<nil>" #619

Open
orthogonous opened this issue Jul 22, 2024 · 2 comments
Open

NULL treated as string "<nil>" #619

orthogonous opened this issue Jul 22, 2024 · 2 comments
Labels
bug Something isn't working sqlite
Milestone

Comments

@orthogonous
Copy link

orthogonous commented Jul 22, 2024

When I run this against a table with NULL values, it ends up being a string in sqlite "<nil>"

If I comment this out it works fine, have not run any of the tests yet. just putting it here before I go down the rabbit hole in case this is desired behavior

from main.go

			// Rely on fmt.Sprintf to handle formatting, potential
			// conversion of data to string type before storing back
			// in our []interface{} for use by db.Exec
			// sqliteOutput[idx] = fmt.Sprintf("%v", sqliteOutput[idx])

Will experiment more tomorrow

@orthogonous
Copy link
Author

orthogonous commented Jul 25, 2024

Couldn't find any unit tests to check this so just compiled it and ran it in my environment, couldn't find any negative impact and it 100% fixed the NULL values being treated as string "<nil>"

I'll see if i can write some tests in the coming days to prove it, then ill put up a PR If interested

@atc0005 atc0005 added bug Something isn't working sqlite labels Jul 25, 2024
@atc0005 atc0005 added this to the Next Release milestone Jul 25, 2024
@atc0005
Copy link
Owner

atc0005 commented Jul 25, 2024

@orthogonous Thank you for filing this and for researching/testing the changes.

This code was originally written in a very tight timeframe and lacks a lot of the polish that I'd apply if writing it today.

Happy to review tests / PRs to improve this project, no matter how minor.

Thanks for your interest!

@atc0005 atc0005 pinned this issue Jul 25, 2024
@atc0005 atc0005 modified the milestones: v0.3.15, Future Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working sqlite
Projects
None yet
Development

No branches or pull requests

2 participants