mirror of
https://github.com/launchbadge/sqlx.git
synced 2025-12-29 21:00:54 +00:00
* Fix type info access in `Any` database driver * Implement custom receiver methods * Revert "Fix type info access in `Any` database driver" This reverts commit a2845c74c5e545351f3f0f2fa6851e7f23a60621. * Refactor * Update sqlx-core/src/any/row.rs Co-authored-by: Yota Toyama <raviqqe@gmail.com> Co-authored-by: Austin Bonander <austin.bonander@gmail.com>
17 lines
413 B
Rust
17 lines
413 B
Rust
use std::any::type_name;
|
|
|
|
use crate::any::type_info::AnyTypeInfo;
|
|
use crate::any::Any;
|
|
use crate::error::BoxDynError;
|
|
use crate::type_info::TypeInfo;
|
|
use crate::types::Type;
|
|
|
|
pub(super) fn mismatched_types<T: Type<Any>>(ty: &AnyTypeInfo) -> BoxDynError {
|
|
format!(
|
|
"mismatched types; Rust type `{}` is not compatible with SQL type `{}`",
|
|
type_name::<T>(),
|
|
ty.name()
|
|
)
|
|
.into()
|
|
}
|