All null integers, regardless of their type length, were decoded as u8. This causes quaint to read null bigint as Int32(None) instead of Int64(None).
Same goes for floats. Not sure it's causing any issue atm since we're not differentiating f32 vs f64 in the rest of the "Prisma stack", but I did it anyway for good measure.
There were existing tests reading nullable integers, but those tests were only trying to convert the ColumnData to a rust primitive type and assert that primitive type. However, because of those FromSql implementations 👇 which enable converting a ColumnData::U8 and ColumnData::I32 to an Option<i64>, tests were passing.
I left those FromSql implementations since I'm not sure what they're used for atm.
Overview
Related to https://github.com/prisma/prisma/issues/12796 and https://github.com/prisma/prisma/issues/12798
u8
. This causesquaint
to read nullbigint
asInt32(None)
instead ofInt64(None)
.f32
vsf64
in the rest of the "Prisma stack", but I did it anyway for good measure.There were existing tests reading nullable integers, but those tests were only trying to convert the
ColumnData
to a rust primitive type and assert that primitive type. However, because of thoseFromSql
implementations 👇 which enable converting aColumnData::U8
andColumnData::I32
to anOption<i64>
, tests were passing.I left those
FromSql
implementations since I'm not sure what they're used for atm.https://github.com/prisma/tiberius/blob/e88859099fc38e61dd01990567a928872efb08ad/src/from_sql.rs#L64
Tests now also ensure that all integers + floats are decoded as the proper
ColumnData
in the case of null values.