Skip to content

Commit 6ef26c7

Browse files
committed
mssql numeric compat
1 parent 1dc8628 commit 6ef26c7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

sqlx-core/src/mssql/types/uint.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,17 @@ impl Decode<'_, Mssql> for u32 {
8383

8484
impl Type<Mssql> for u64 {
8585
fn type_info() -> MssqlTypeInfo {
86-
MssqlTypeInfo(TypeInfo::new(DataType::Numeric, 0))
86+
MssqlTypeInfo(TypeInfo::new(DataType::NumericN, 17))
8787
}
8888

8989
fn compatible(ty: &MssqlTypeInfo) -> bool {
90-
matches!(ty.0.ty, DataType::Numeric | DataType::Decimal)
90+
matches!(
91+
ty.0.ty,
92+
DataType::Numeric
93+
| DataType::NumericN
94+
| DataType::Decimal
95+
| DataType::DecimalN
96+
) && (ty.0.size == 0 || ty.0.size == 17)
9197
}
9298
}
9399

0 commit comments

Comments
 (0)