We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
According to Microsofts definition a TinyInt is a value between 0..255 so it must be a u8. Current implementation uses i8 for this. https://docs.microsoft.com/de-de/sql/t-sql/data-types/int-bigint-smallint-and-tinyint-transact-sql?view=sql-server-ver15
u8
i8
Does not Work because 133 does not fit into an i8
133
#[derive(sqlx::Type)] #[repr(i8)] pub enum Quality { Good = 0, Bad = 1, Doubtful = 16, InitialValue = 133, }
Must be:
#[derive(sqlx::Type)] #[repr(u8)] pub enum Quality { Good = 0, Bad = 1, Doubtful = 16, InitialValue = 133, }
But Produces:
the trait bound `u8: sqlx::Decode<'_, _>` is not satisfied the following other types implement trait `sqlx::Decode<'r, DB>`: f32 f64 i16 i32 i64 i8
rustc --version
The text was updated successfully, but these errors were encountered:
Yeah, simple mixup. MySQL's TINYINT type is signed and all the rest of MSSQL's integer types are signed, so it's an easy mistake to make.
TINYINT
Sorry, something went wrong.
Closed by #2074
No branches or pull requests
Bug Description
According to Microsofts definition a TinyInt is a value between 0..255 so it must be a
u8
. Current implementation usesi8
for this.https://docs.microsoft.com/de-de/sql/t-sql/data-types/int-bigint-smallint-and-tinyint-transact-sql?view=sql-server-ver15
Minimal Reproduction
Does not Work because
133
does not fit into ani8
Must be:
But Produces:
Info
rustc --version
: rustc 1.63.0 (4b91a6ea7 2022-08-08)The text was updated successfully, but these errors were encountered: