Skip to content

Implement proper support for Bool type#552

Merged
slabko merged 1 commit intomasterfrom
bool-support
Feb 4, 2026
Merged

Implement proper support for Bool type#552
slabko merged 1 commit intomasterfrom
bool-support

Conversation

@slabko
Copy link
Copy Markdown
Contributor

@slabko slabko commented Feb 3, 2026

Bool is returned as a string by the ODBCDriver2 format, so the standard type parsers could not parse true and false into the expected integer. This fix resolves the issue by explicitly handling true and false values for Bool columns.

Fixes #486 Bool columns are represented as strings

Warning

This can be a breaking change for users of ODBC wrappers such as PyODBC. These wrappers extract type information automatically, and before this change the driver reported str as the expected type for inserting and reading data. With this change, it now expects bool, and attempting to insert or read a string will fail.
Similarly, from any ODBC client, attempting to read a Bool column as a string using SQLGetData, SQLBindCol, etc. will return 0 and 1 instead of true and false, as it did before this change. This makes the driver more consistent with other drivers.

@slabko slabko marked this pull request as ready for review February 4, 2026 11:59
@slabko slabko requested a review from mzitnik as a code owner February 4, 2026 11:59
Bool is returned as a string by the ODBCDriver2 format, so the standard
type parsers could not parse "true" and "false" into the expected
integer. This fix resolves the issue by explicitly handling "true" and
"false" values for Bool columns.
@slabko slabko merged commit cd851ad into master Feb 4, 2026
20 checks passed
@slabko slabko deleted the bool-support branch February 4, 2026 14:41
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.

Bool columns are represented as a string

1 participant