Skip to content

Commit 1b9c40b

Browse files
authored
fix serde_json usage in macros (#1842)
1 parent a110e75 commit 1b9c40b

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

sqlx-core/src/types/json.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use std::ops::{Deref, DerefMut};
22

33
use serde::{Deserialize, Serialize};
4-
use serde_json::value::RawValue as JsonRawValue;
5-
use serde_json::Value as JsonValue;
4+
pub use serde_json::value::RawValue as JsonRawValue;
5+
pub use serde_json::Value as JsonValue;
66

77
use crate::database::{Database, HasArguments, HasValueRef};
88
use crate::decode::Decode;

sqlx-core/src/types/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub mod mac_address {
8383
}
8484

8585
#[cfg(feature = "json")]
86-
pub use json::Json;
86+
pub use json::{Json, JsonRawValue, JsonValue};
8787

8888
/// Indicates that a SQL type is supported for a database.
8989
///

sqlx-macros/src/database/mysql.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ impl_database_ext! {
5151
sqlx::types::Decimal,
5252

5353
#[cfg(feature = "json")]
54-
serde_json::Value,
54+
sqlx::types::JsonValue,
5555
},
5656
ParamChecking::Weak,
5757
feature-types: info => info.__type_feature_gate(),

sqlx-macros/src/database/postgres.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ impl_database_ext! {
6969
sqlx::types::mac_address::MacAddress,
7070

7171
#[cfg(feature = "json")]
72-
serde_json::Value,
72+
sqlx::types::JsonValue,
7373

7474
#[cfg(feature = "bit-vec")]
7575
sqlx::types::BitVec,
@@ -128,7 +128,7 @@ impl_database_ext! {
128128
Vec<sqlx::types::mac_address::MacAddress> | &[sqlx::types::mac_address::MacAddress],
129129

130130
#[cfg(feature = "json")]
131-
Vec<serde_json::Value> | &[serde_json::Value],
131+
Vec<sqlx::types::JsonValue> | &[sqlx::types::JsonValue],
132132

133133
// Ranges
134134

0 commit comments

Comments
 (0)