From 01e5b4936705b3f4facf2b7dd67848fbaf07c29d Mon Sep 17 00:00:00 2001 From: EthanYuan Date: Mon, 6 Jun 2022 11:09:57 +0800 Subject: [PATCH 1/2] Add i16 support for Any Type. --- sqlx-core/src/any/types.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sqlx-core/src/any/types.rs b/sqlx-core/src/any/types.rs index cf57119766..ace9e2bd4d 100644 --- a/sqlx-core/src/any/types.rs +++ b/sqlx-core/src/any/types.rs @@ -5,6 +5,7 @@ //! | Rust type | SQL type(s) | //! |---------------------------------------|------------------------------------------------------| //! | `bool` | BOOLEAN | +//! | `i16` | SMALLINT | //! | `i32` | INT | //! | `i64` | BIGINT | //! | `f32` | FLOAT | @@ -21,6 +22,7 @@ impl_any_type!(bool); +impl_any_type!(i16); impl_any_type!(i32); impl_any_type!(i64); @@ -34,6 +36,7 @@ impl_any_type!(String); impl_any_encode!(bool); +impl_any_encode!(i16); impl_any_encode!(i32); impl_any_encode!(i64); @@ -47,6 +50,7 @@ impl_any_encode!(String); impl_any_decode!(bool); +impl_any_decode!(i16); impl_any_decode!(i32); impl_any_decode!(i64); From f5f8b16aa71f0c0cf2e59711dad9723856226c24 Mon Sep 17 00:00:00 2001 From: EthanYuan Date: Wed, 8 Jun 2022 21:18:19 +0800 Subject: [PATCH 2/2] fix test. --- tests/postgres/postgres.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/postgres/postgres.rs b/tests/postgres/postgres.rs index 4c884b1744..4b1de22df5 100644 --- a/tests/postgres/postgres.rs +++ b/tests/postgres/postgres.rs @@ -1037,7 +1037,7 @@ CREATE TABLE heating_bills ( &self, buf: &mut sqlx::postgres::PgArgumentBuffer, ) -> sqlx::encode::IsNull { - self.0.encode(buf) + >::encode(self.0, buf) } }