Correct Postgres' Length Limit for Bind Parameters (#1141)

* Bump limit for postgres' bind parameters

* Fix lingering fmt error
This commit is contained in:
crajcan 2021-03-29 21:39:27 -05:00 committed by GitHub
parent c83427f8fc
commit 469c4ac130
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -27,7 +27,7 @@ impl Encode<'_> for Parse<'_> {
buf.put_str_nul(self.query);
// TODO: Return an error here instead
assert!(self.param_types.len() <= (i16::MAX as usize));
assert!(self.param_types.len() <= (u16::MAX as usize));
buf.extend(&(self.param_types.len() as i16).to_be_bytes());

View file

@ -4,8 +4,8 @@ use sqlx_test::{new, test_type};
#[derive(Debug, PartialEq, sqlx::Type)]
#[repr(u32)]
enum Origin {
Foo = 1,
Bar = 2,
Foo = 1,
Bar = 2,
}
test_type!(origin_enum<Origin>(Sqlite,