Skip to content
This repository was archived by the owner on Nov 19, 2023. It is now read-only.

Commit a61aaa8

Browse files
author
Tobias Brandt
authored
Merge pull request #30 from eitsupi/prql-version
feat: show PRQL version in about (in `--help` option)
2 parents 230f09e + c9c042d commit a61aaa8

File tree

5 files changed

+176
-31
lines changed

5 files changed

+176
-31
lines changed

Cargo.lock

Lines changed: 169 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ atty = "0.2"
2121
camino = "1.1.1"
2222
cfg-if = "1.0.0"
2323
chrono = "0.4"
24-
clap = { version = "3.2.3", features = ["derive", "env"] }
24+
clap = { version = "4.1.4", features = ["derive", "env", "string"] }
2525
datafusion = { version = "12.0.0", optional = true, features = ["default", "avro"]}
2626
dotenvy = "0.15.3"
2727
duckdb = { version = "0.5.1", features = ["bundled", "modern-full"], optional = true }

src/backends/datafusion.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ fn write_record_batches_to_json(rbs: &[RecordBatch], dest: &mut dyn Write) -> Re
102102
{
103103
// let mut writer = json::ArrayWriter::new(&mut buf);
104104
let mut writer = json::LineDelimitedWriter::new(dest);
105-
writer.write_batches(&rbs)?;
105+
writer.write_batches(rbs)?;
106106
writer.finish()?;
107107
}
108108
Ok(())

src/backends/duckdb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ pub fn query(
3535
} else if source.ends_with(".parquet") {
3636
format!("read_parquet('{source}')")
3737
} else if database.starts_with("postgres") {
38-
let mut parts: Vec<&str> = source.split(".").collect();
38+
let mut parts: Vec<&str> = source.split('.').collect();
3939
if parts.len() == 1 {
4040
parts.insert(0, "public");
4141
}

src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ use std::io::prelude::*;
1212
use std::{fs, io};
1313

1414
use clap::{Parser, ValueEnum};
15-
use prql_compiler::compile;
15+
use prql_compiler::{compile, PRQL_VERSION};
1616

1717
cfg_if::cfg_if! {
1818
if #[cfg(feature = "datafusion")] {
@@ -33,7 +33,7 @@ type SourcesType = Vec<(String, String)>;
3333
#[clap(
3434
name = env!("CARGO_PKG_NAME"),
3535
version = env!("CARGO_PKG_VERSION"),
36-
about = env!("CARGO_PKG_DESCRIPTION")
36+
about = format!("{} version {} (https://prql-lang.org)", env!("CARGO_PKG_DESCRIPTION"), PRQL_VERSION.to_string())
3737
)]
3838
struct Cli {
3939
/// The file(s) to read data FROM if given
@@ -57,14 +57,14 @@ struct Cli {
5757
no_exec: bool,
5858

5959
/// The format to use for the output
60-
#[clap(long, arg_enum, value_parser, env = "PQ_FORMAT")]
60+
#[clap(long, value_enum, value_parser, env = "PQ_FORMAT")]
6161
format: Option<OutputFormat>,
6262

6363
/// The Writer to use for writing the output
6464
#[clap(
6565
short,
6666
long,
67-
arg_enum,
67+
value_enum,
6868
value_parser,
6969
default_value = "arrow",
7070
env = "PQ_WRITER"

0 commit comments

Comments
 (0)