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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repository = "https://github.com/sundy-li/arrow_cli"
edition = "2024"
license = "Apache-2.0"
name = "arrow_cli"
version = "0.4.0"
version = "0.4.1"


[dependencies]
Expand Down
83 changes: 83 additions & 0 deletions SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
name: arrow-cli
description: Use `arrow_cli` to connect to a Flight SQL server and run SQL.
---

# arrow_cli

`arrow_cli` is a command-line client for connecting to a Flight SQL server and executing SQL queries.

## Install

```bash
cargo install arrow_cli
```

After installation, confirm that the binary is available:

```bash
arrow_cli --version
```

## Usage

### Execute one SQL statement and exit

```bash
arrow_cli --host localhost --port 8900 --user admin --password abc --command "select 1"
```

Output:

```text
+----------+
| Int64(1) |
+----------+
| 1 |
+----------+

1 rows in set (tickets received in 0.008 sec, rows received in 0.012 sec)
```

### Pipe SQL through standard input

```bash
echo "select 1" | arrow_cli --host localhost --port 8900 --user admin --password abc
```

Output:

```text
1
```

### Option: print the result schema

```bash
arrow_cli --host localhost --port 8900 --user admin --password abc --print-schema --command "select number from numbers(3);"
```

Output:

```text
+----------+
| Int64(1) |
+----------+
| 1 |
+----------+

Schema {
fields: [
Field {
name: "Int64(1)",
data_type: Int64,
},
],
metadata: {},
}

1 rows in set (tickets received in 0.008 sec, rows received in 0.010 sec)
```

## Other notes
- Run `arrow_cli --help` for more details
1 change: 1 addition & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use clap::Parser;
use tonic::transport::{ClientTlsConfig, Endpoint};

#[derive(Debug, Parser, PartialEq)]
#[command(version)]
struct Args {
#[clap(short = 'u', long, default_value = "root", help = "User name")]
user: String,
Expand Down
Loading