Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix serde_json usage in macros #1842

Merged
merged 1 commit into from
May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sqlx-core/src/types/json.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use std::ops::{Deref, DerefMut};

use serde::{Deserialize, Serialize};
use serde_json::value::RawValue as JsonRawValue;
use serde_json::Value as JsonValue;
pub use serde_json::value::RawValue as JsonRawValue;
pub use serde_json::Value as JsonValue;

use crate::database::{Database, HasArguments, HasValueRef};
use crate::decode::Decode;
Expand Down
2 changes: 1 addition & 1 deletion sqlx-core/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub mod mac_address {
}

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

/// Indicates that a SQL type is supported for a database.
///
Expand Down
2 changes: 1 addition & 1 deletion sqlx-macros/src/database/mysql.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ impl_database_ext! {
sqlx::types::Decimal,

#[cfg(feature = "json")]
serde_json::Value,
sqlx::types::JsonValue,
},
ParamChecking::Weak,
feature-types: info => info.__type_feature_gate(),
Expand Down
4 changes: 2 additions & 2 deletions sqlx-macros/src/database/postgres.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ impl_database_ext! {
sqlx::types::mac_address::MacAddress,

#[cfg(feature = "json")]
serde_json::Value,
sqlx::types::JsonValue,

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

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

// Ranges

Expand Down