Skip to content
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 ggsql-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ fn render_spec(spec: ResolvedSpec, args: &RenderArgs, writer: &WriterSpec) {
ResolvedSpec::Table(table) => {
if args.verbose {
eprintln!("\nQuery executed:");
eprintln!(" Rows: {}", table.body().height());
eprintln!(" Columns: {}", table.body().width());
eprintln!(" Rows: {}", table.nrow());
eprintln!(" Columns: {}", table.ncol());
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions ggsql-jupyter/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,14 +294,14 @@ impl QueryExecutor {
ResolvedSpec::Table(table) => {
tracing::info!(
"Query executed: {} rows, {} cols",
table.body().height(),
table.body().width()
table.nrow(),
table.ncol()
);
for warning in table.warnings() {
tracing::warn!("{}", warning.message);
}

let html = HtmlWriter::new().write_table(table.table(), table.body())?;
let html = HtmlWriter::new().write_table(table.cells())?;
tracing::debug!("Generated HTML table: {} chars", html.len());

Ok(ExecutionResult::Table { html })
Expand Down
6 changes: 3 additions & 3 deletions src/doc/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,9 @@ pub trait Writer {
/// Check whether a plot can be rendered by this writer, without rendering it
fn validate_plot(&self, spec: &Plot) -> Result<()>;

/// Render a resolved table and its body data. Defaults to an "unsupported"
/// error; only `HtmlWriter` overrides it as of this writing.
fn write_table(&self, table: &Table, body: &DataFrame) -> Result<Self::Output> { .. }
/// Render a resolved table's cells. Defaults to an "unsupported" error;
/// only `HtmlWriter` overrides it as of this writing.
fn write_table(&self, cells: &[TableCell]) -> Result<Self::Output> { .. }

/// Render a `ResolvedSpec` from `reader.execute()` — the usual entry point.
/// Dispatches to `write_plot`/`write_table` depending on the variant.
Expand Down
2 changes: 1 addition & 1 deletion src/execute/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ mod table;
pub use casting::TypeRequirement;
pub use cte::CteDefinition;
pub use schema::TypeInfo;
pub use table::resolve_table_with_reader;
pub use table::{resolve_table_with_reader, TableCell, TableCellKind};

use crate::naming;
use crate::parser;
Expand Down
Loading