Skip to content

Commit

Permalink
fix: render empty strings (#47)
Browse files Browse the repository at this point in the history
* render empty strings

Signed-off-by: Noel Kwan <[email protected]>

* Update changelog + package version

Signed-off-by: Noel Kwan <[email protected]>
  • Loading branch information
kwannoel authored Jun 9, 2022
1 parent f41a7bf commit 8077294
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

## [0.5.0] - 2022-06-09

### Added

- Print empty strings as "(empty)"

## [0.4.0] - 2022-06-07

### Added
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sqllogictest"
version = "0.4.0"
version = "0.5.0"
edition = "2021"
description = "Sqllogictest parser and runner."
license = "MIT OR Apache-2.0"
Expand Down
8 changes: 7 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,13 @@ impl sqllogictest::AsyncDB for Postgres {
write!(output, " ").unwrap();
}
match row.get(i) {
Some(v) => write!(output, "{}", v).unwrap(),
Some(v) => {
if v.is_empty() {
write!(output, "(empty)").unwrap()
} else {
write!(output, "{}", v).unwrap()
}
}
None => write!(output, "NULL").unwrap(),
}
}
Expand Down

0 comments on commit 8077294

Please sign in to comment.