Skip to content

Commit

Permalink
fix: remove sqlformat (#3545)
Browse files Browse the repository at this point in the history
* removed sqlformat from sql-core/src/logger.rs causing ref error to FormatOptions

* removed sqlformat from sql-core/src/logger.rs causing ref error to FormatOptions

---------

Co-authored-by: tbarnes <tbarnes@tbserver.tbarnes-server.local>
  • Loading branch information
tbar4 and tbarnes authored Oct 5, 2024
1 parent 19f40d8 commit cadf152
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 32 deletions.
19 changes: 1 addition & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion sqlx-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ regex = { version = "1.5.5", optional = true }
serde = { version = "1.0.132", features = ["derive", "rc"], optional = true }
serde_json = { version = "1.0.73", features = ["raw_value"], optional = true }
sha2 = { version = "0.10.0", default-features = false, optional = true }
sqlformat = "0.2.0"
#sqlformat = "0.2.0"
thiserror = "1.0.30"
tokio-stream = { version = "0.1.8", features = ["fs"], optional = true }
tracing = { version = "0.1.37", features = ["log"] }
Expand Down
13 changes: 6 additions & 7 deletions sqlx-core/src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ pub(crate) fn private_level_filter_to_trace_level(
private_level_filter_to_levels(filter).map(|(level, _)| level)
}

pub use sqlformat;

pub struct QueryLogger<'q> {
sql: &'q str,
rows_returned: u64,
Expand Down Expand Up @@ -112,11 +110,12 @@ impl<'q> QueryLogger<'q> {
summary.push_str(" …");
format!(
"\n\n{}\n",
sqlformat::format(
self.sql,
&sqlformat::QueryParams::None,
sqlformat::FormatOptions::default()
)
self.sql /*
sqlformat::format(
self.sql,
&sqlformat::QueryParams::None,
sqlformat::FormatOptions::default()
)*/
)
} else {
String::new()
Expand Down
12 changes: 7 additions & 5 deletions sqlx-sqlite/src/logger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -416,11 +416,13 @@ impl<'q, R: Debug, S: Debug + DebugDiff, P: Debug> QueryPlanLogger<'q, R, S, P>
summary.push_str(" …");
format!(
"\n\n{}\n",
sqlformat::format(
self.sql,
&sqlformat::QueryParams::None,
sqlformat::FormatOptions::default()
)
self.sql /*
sqlformat::format(
self.sql,
&sqlformat::QueryParams::None,
sqlformat::FormatOptions::default()
)
*/
)
} else {
String::new()
Expand Down
2 changes: 1 addition & 1 deletion src/ty_match.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ pub fn dupe_value<T>(_t: &T) -> T {

#[test]
fn test_dupe_value() {
let ref val = (String::new(),);
let val = &(String::new(),);

if false {
let _: i32 = dupe_value(&0i32);
Expand Down

0 comments on commit cadf152

Please sign in to comment.