@@ -20,50 +20,59 @@ Databend Native Command Line Tool
2020Usage: bendsql [OPTIONS]
2121
2222Options:
23- --help Print help information
24- --flight Using flight sql protocol
25- --tls Enable TLS
26- -h, --host <HOST> Databend Server host, Default: 127.0.0.1
27- -P, --port <PORT> Databend Server port, Default: 8000
28- -u, --user <USER> Default: root
29- -p, --password <PASSWORD> [env: BENDSQL_PASSWORD=]
30- -D, --database <DATABASE> Database name
31- --set <SET> Settings
32- --dsn <DSN> Data source name [env: BENDSQL_DSN=]
33- -n, --non-interactive Force non-interactive mode
34- -q, --query <QUERY> Query to execute
35- -d, --data <DATA> Data to load, @file or @- for stdin
36- -f, --format <FORMAT> Data format to load [default: csv]
37- -o, --output <OUTPUT> Output format [default: table]
38- --progress Show progress for data loading in stderr
39- -V, --version Print version
23+ --help Print help information
24+ --flight Using flight sql protocol, ignored when --dsn is set
25+ --tls <TLS> Enable TLS, ignored when --dsn is set [possible values: true, false]
26+ -h, --host <HOST> Databend Server host, Default: 127.0.0.1, ignored when --dsn is set
27+ -P, --port <PORT> Databend Server port, Default: 8000, ignored when --dsn is set
28+ -u, --user <USER> Default: root, overrides username in DSN
29+ -p, --password <PASSWORD> Password, overrides password in DSN [env: BENDSQL_PASSWORD]
30+ -r, --role <ROLE> Downgrade role name, overrides role in DSN
31+ -D, --database <DATABASE> Database name, overrides database in DSN
32+ --set <SET> Settings, overrides settings in DSN
33+ --dsn <DSN> Data source name [env: BENDSQL_DSN]
34+ -n, --non-interactive Force non-interactive mode
35+ -A, --no-auto-complete Disable loading tables and fields for auto-completion, which offers a quicker start
36+ --check Check for server status and exit
37+ --query=<QUERY> Query to execute
38+ -d, --data <DATA> Data to load, @file or @- for stdin
39+ -f, --format <FORMAT> Data format to load [default: csv] [possible values: csv, tsv, ndjson, parquet, xml]
40+ --format-opt <FORMAT_OPT> Data format options
41+ -o, --output <OUTPUT> Output format [possible values: table, csv, tsv, null]
42+ --quote-style <QUOTE_STYLE> Output quote style, applies to `csv` and `tsv` output formats [possible values: always, necessary, non-numeric, never]
43+ --progress Show progress for query execution in stderr, only works with output format `table` and `null`.
44+ --stats Show stats after query execution in stderr, only works with non-interactive mode.
45+ --time[=<TIME>] Only show execution time without results, will implicitly set output format to `null`. [possible values: local, server]
46+ -l, --log-level <LOG_LEVEL> [default: info]
47+ -V, --version Print version
4048```
4149
4250### REPL
51+
4352``` sql
4453❯ bendsql
4554Welcome to BendSQL.
4655Connecting to localhost:8000 as user root.
56+ Connected to Databend Query
4757
4858bendsql> select avg (number ) from numbers(10 );
4959
50- SELECT
60+ select
5161 avg (number )
52- FROM
53- numbers(10 );
54-
55- ┌───────────────────┐
56- │ avg (number ) │
57- │ Nullable(Float64) │
58- ├───────────────────┤
59- │ 4 .5 │
60- └───────────────────┘
62+ from
63+ numbers(10 )
6164
62- 1 row in 0 .259 sec. Processed 10 rows, 10B (38 .59 rows/ s, 308B/ s)
65+ ╭───────────────────────────────────────────────────────╮
66+ │ sum (number ) / if(count (number ) = 0 , 1 , count (number )) │
67+ │ Nullable(Float64) │
68+ ├───────────────────────────────────────────────────────┤
69+ │ 4 .5 │
70+ ╰───────────────────────────────────────────────────────╯
71+ 1 row read in 0 .032 sec. Processed 10 row, 80 B (312 .5 rows/ s, 2 .44 KiB/ s)
6372
6473bendsql> show tables like ' d%' ;
6574
66- SHOW TABLES LIKE ' d%' ;
75+ show tables like ' d%'
6776
6877┌───────────────────┐
6978│ tables_in_default │
@@ -78,7 +87,7 @@ SHOW TABLES LIKE 'd%';
78874 rows in 0 .106 sec. Processed 0 rows, 0B (0 rows/ s, 0B/ s)
7988
8089bendsql> exit
81- Bye
90+ Bye~
8291```
8392
8493### StdIn Pipe
0 commit comments