Skip to content
This repository was archived by the owner on Apr 25, 2023. It is now read-only.

Commit a79eb9f

Browse files
author
Julius de Bruijn
committed
SQLx 0.5
1 parent 7c70755 commit a79eb9f

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ indoc = "0.3"
100100
names = "0.11"
101101

102102
[dependencies.sqlx]
103-
git = "https://github.com/pimeys/sqlx"
103+
path = "../sqlx"
104104
branch = "work-branch"
105105
default_features = false
106106
features = ["decimal", "json", "chrono", "ipnetwork", "bit-vec"]

src/connector/postgres/conversion.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ use rust_decimal::{
1010
#[cfg(feature = "chrono-0_4")]
1111
use sqlx::postgres::types::PgTimeTz;
1212
use sqlx::{
13-
postgres::{
14-
types::{PgAny, PgMoney},
15-
PgArguments, PgRow, PgTypeInfo,
16-
},
13+
postgres::{types::PgMoney, PgArguments, PgRow, PgTypeInfo},
1714
query::Query,
1815
types::Json,
1916
Column, Postgres, Row, TypeInfo,
@@ -95,10 +92,10 @@ impl<'a> Bind<'a, Postgres> for Query<'a, Postgres, PgArguments> {
9592
None => self.bind(Option::<sqlx::types::ipnetwork::IpNetwork>::None),
9693
},
9794
(Value::Text(c), _) if type_info.map(|ti| ti.is_enum()).unwrap_or(false) => {
98-
self.bind(c.map(|c| PgAny(c.into_owned())))
95+
self.bind(c.map(|c| c.into_owned()))
9996
}
10097
(Value::Text(c), _) => self.bind(c.map(|c| c.into_owned())),
101-
(Value::Enum(c), _) => self.bind(c.map(|c| PgAny(c.into_owned()))),
98+
(Value::Enum(c), _) => self.bind(c.map(|c| c.into_owned())),
10299

103100
(Value::Bytes(c), _) => self.bind(c.map(|c| c.into_owned())),
104101
(Value::Boolean(b), _) => self.bind(b),
@@ -659,7 +656,7 @@ impl<'a> Bind<'a, Postgres> for Query<'a, Postgres, PgArguments> {
659656
for val in ary.into_iter().map(|v| v.into_string()) {
660657
match val {
661658
Some(val) => {
662-
vals.push(PgAny(val));
659+
vals.push(val);
663660
}
664661
None => {
665662
let msg = "Non-string parameter when storing a string array";
@@ -670,7 +667,7 @@ impl<'a> Bind<'a, Postgres> for Query<'a, Postgres, PgArguments> {
670667
}
671668
}
672669

673-
self.bind(PgAny(vals))
670+
self.bind(vals)
674671
}
675672
None => self.bind(Option::<Vec<String>>::None),
676673
},

0 commit comments

Comments
 (0)