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

Work around database/sql not being able to write large uint64 values #24

Closed
wants to merge 1 commit into from

Conversation

roblillack
Copy link

Go's sql package has this extremely weird restriction of not allowing to store uint64 with the highest bit set:

I needed a quick solution for a project, so I worked around this using the applied patch. It is tested with SQLite only.

Please decide if this is the right way to work around the issue and how to proceed from here.

@roblillack
Copy link
Author

The possibility of this code working is highly dependent of the used column type, as SQLite does not really support uint64 INTEGER columns. Therefore, more work is needed if you want to use uint64 values with Go, modl, and SQLite.

My proposed solution is to create a private type deriving from int64 and use this in your models.

Please disregard this patch.

@roblillack roblillack closed this Oct 1, 2014
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.

None yet

1 participant