Skip to content

Add type BitBool Scanner/Valuer for MySQL type BIT #254

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

Merged
merged 1 commit into from
Oct 29, 2016
Merged

Add type BitBool Scanner/Valuer for MySQL type BIT #254

merged 1 commit into from
Oct 29, 2016

Conversation

RayfenWindspear
Copy link
Contributor

Allows Go to read and write MySQL BIT(1) type as a bool. This allows you to use 1 bit for a MySQL boolean instead of 1 byte for the standard TINYINT. BitBool type itself is simply an alias for bool, so it can be used easily in Go code.

Allows Go to read and write MySQL BIT(1) type as a bool. This allows you to use 1 bit for a MySQL boolean instead of 1 byte for the standard TINYINT.
@RayfenWindspear
Copy link
Contributor Author

I've only tested this with MySQL, but it should work with any database types that get pulled in as a []byte. Pretty sure it would at least also work with PostgreSQL.

@jmoiron jmoiron merged commit 0f13de5 into jmoiron:master Oct 29, 2016
jmoiron added a commit that referenced this pull request Oct 29, 2016
@jmoiron
Copy link
Owner

jmoiron commented Oct 29, 2016

Thanks!

@RayfenWindspear RayfenWindspear deleted the mysql-bitbool branch October 29, 2016 04:25
gm42 pushed a commit to bookerzzz/sqlx that referenced this pull request Apr 27, 2017
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