Skip to content

Commit 29a2865

Browse files
committed
fix(macros): slightly improve unsupported type error message
1 parent 92c3845 commit 29a2865

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

sqlx-macros-core/src/query/args.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ pub fn quote_args<DB: DatabaseExt>(
6666
i + 1,
6767
)
6868
} else {
69-
format!("unsupported type {} for param #{}", param_ty, i + 1)
69+
format!(
70+
"no built in mapping found for type {} for param #{}; \
71+
a type override may be required, see documentation for details",
72+
param_ty,
73+
i + 1
74+
)
7075
}
7176
})?
7277
.parse::<TokenStream>()

sqlx-macros-core/src/query/output.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ fn get_column_type<DB: DatabaseExt>(i: usize, column: &DB::Column) -> TokenStrea
236236
let message =
237237
if let Some(feature_gate) = <DB as TypeChecking>::get_feature_gate(type_info) {
238238
format!(
239-
"optional sqlx feature `{feat}` required for type {ty} of {col}",
239+
"SQLx feature `{feat}` required for type {ty} of {col}",
240240
ty = &type_info,
241241
feat = feature_gate,
242242
col = DisplayColumn {
@@ -246,7 +246,8 @@ fn get_column_type<DB: DatabaseExt>(i: usize, column: &DB::Column) -> TokenStrea
246246
)
247247
} else {
248248
format!(
249-
"unsupported type {ty} of {col}",
249+
"no built in mapping found for type {ty} of {col}; \
250+
a type override may be required, see documentation for details",
250251
ty = type_info,
251252
col = DisplayColumn {
252253
idx: i,

0 commit comments

Comments
 (0)