Commit 97ac805
committed
fix(mssql): map BIT to bool in compile-time type checking
The query! macros resolve a column's Rust type via
<Mssql as TypeChecking>::return_type_for_id, which only searches the type list
in impl_type_checking!. `bool` was missing from that list, so a BIT column had
no built-in mapping and failed to compile:
error: no built-in mapping found for type BIT of column ("deleted")
error[E0277]: the trait bound `(): sqlx::Decode<'_, Mssql>` is not satisfied
The runtime bool/BIT support already exists (types/bool.rs). Add `bool` to the
list, placed after the integer types: `bool::compatible` also matches
TINYINT/INT/SMALLINT/BIGINT, but the integer types (whose int_compatible does
NOT match BIT) claim those first, so only BIT falls through to bool. Fixes the
tests/mssql/macros.rs `test_query_simple` test.
Author: Pablo Carrera <pabloce@poscye.com>1 parent e80d798 commit 97ac805
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
| |||
0 commit comments