diff --git a/src/args.rs b/src/args.rs index 0e8421e..3626829 100644 --- a/src/args.rs +++ b/src/args.rs @@ -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)] diff --git a/src/main.rs b/src/main.rs index ff05cab..909783b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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(()) }