mirror of
https://github.com/launchbadge/sqlx
synced 2024-09-20 14:21:57 +00:00
add array support for NonZeroI* in postgres (#3303)
* add array support for NonZeroI* in postgres * run rustfmt
This commit is contained in:
parent
3396ed015b
commit
905df7ef3a
1 changed files with 19 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
use byteorder::{BigEndian, ByteOrder};
|
use byteorder::{BigEndian, ByteOrder};
|
||||||
|
use std::num::{NonZeroI16, NonZeroI32, NonZeroI64};
|
||||||
|
|
||||||
use crate::decode::Decode;
|
use crate::decode::Decode;
|
||||||
use crate::encode::{Encode, IsNull};
|
use crate::encode::{Encode, IsNull};
|
||||||
|
@ -153,3 +154,21 @@ impl Decode<'_, Postgres> for i64 {
|
||||||
int_decode(value)
|
int_decode(value)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl PgHasArrayType for NonZeroI16 {
|
||||||
|
fn array_type_info() -> PgTypeInfo {
|
||||||
|
PgTypeInfo::INT2_ARRAY
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PgHasArrayType for NonZeroI32 {
|
||||||
|
fn array_type_info() -> PgTypeInfo {
|
||||||
|
PgTypeInfo::INT4_ARRAY
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl PgHasArrayType for NonZeroI64 {
|
||||||
|
fn array_type_info() -> PgTypeInfo {
|
||||||
|
PgTypeInfo::INT8_ARRAY
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue