Skip to content

Commit

Permalink
feat: apply limit on non-schema queries
Browse files Browse the repository at this point in the history
  • Loading branch information
timvw committed Mar 26, 2024
1 parent c71df6c commit 8382ca4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub struct Args {

/// When provided the schema is shown
#[clap(short, long, group = "sql")]
schema: bool,
pub schema: bool,

/// Rows to return
#[clap(short, long, default_value_t = 10)]
Expand Down
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ async fn main() -> Result<()> {

let query = &args.get_query();
let df = ctx.sql(query).await?;
df.show_limit(10).await?;
if args.schema {
df.show().await?;
} else {
df.show_limit(args.limit).await?;
}

Ok(())
}
Expand Down

0 comments on commit 8382ca4

Please sign in to comment.