Skip to content

Commit

Permalink
fix: remove no value dashes
Browse files Browse the repository at this point in the history
  • Loading branch information
frectonz committed Jun 24, 2024
1 parent 6fc6493 commit 4e076ec
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ mod sqlite {
})?;

let table_size = if more_than_five {
"---".to_owned()
"> 5GB".to_owned()
} else {
let table_size = conn.query_row(
"SELECT SUM(pgsize) FROM dbstat WHERE name = ?1",
Expand Down Expand Up @@ -653,7 +653,22 @@ mod libsql {
.ok_or_eyre("no row returned from db")?
.get::<String>(0)?;

let file_size = "---".to_owned();
let page_count = conn
.query("PRAGMA page_count;", ())
.await?
.next()
.await?
.ok_or_eyre("could not get page count")?
.get::<u64>(0)?;
let page_size = conn
.query("PRAGMA page_size;", ())
.await?
.next()
.await?
.ok_or_eyre("could not get page size")?
.get::<u64>(0)?;

let file_size = helpers::format_size((page_count * page_size) as f64);
let modified = None;
let created = None;

Expand Down

0 comments on commit 4e076ec

Please sign in to comment.