![Repobeats analytics image Alt](https://camo.githubusercontent.com/2d895d8e8edaaa2afe5f3dba397e0e2a886fb7ee3a68fd57469e338e4f577670/68747470733a2f2f7265706f62656174732e6178696f6d2e636f2f6170692f656d6265642f383630353563663637666361616339653665393363363463396137613136333036383663656461312e737667)
docker run --name iotdb-cli -d ghcr.io/iotdb-lab/iotdb-cli
docker exec -it iotdb-cli iotdb
![Windows supported](https://camo.githubusercontent.com/c9f0b1ef1bfc32497f54ebfe00150bd797a3f76e49d20e581f6282fddf048109/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f57696e646f77732532307838365f5f36342d737570706f727465642532302545322539432539332d3232384232323f7374796c653d666c61742d737175617265266c6f676f3d77696e646f7773)
- Using
Cargo
cargo install -f iotdb-cli
cargo install -f --git https://github.com/iotdb-lab/iotdb-cli.git
- From binary
curl -s https://raw.githubusercontent.com/iotdb-lab/iotdb-cli/main/install.sh | bash
curl -s https://raw.githubusercontent.com/iotdb-lab/iotdb-cli/main/install.sh | bash -s -- x.x.x
wget -qO- https://raw.githubusercontent.com/iotdb-lab/iotdb-cli/main/install.sh | bash
wget -qO- https://raw.githubusercontent.com/iotdb-lab/iotdb-cli/main/install.sh | bash -s -- x.x.x
▀██▀ ▄▄█▀▀██ █▀▀██▀▀█ ▀██▀▀█▄ ▀██▀▀█▄
██ ▄█▀ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██▀▀▀█▄
██ ▀█▄ ██ ██ ██ ██ ██ ██
▄██▄ ▀▀█▄▄▄█▀ ▄██▄ ▄██▄▄▄█▀ ▄██▄▄▄█▀
Author: github.com/francis-du <me@francis.run>
Version: iotdb-cli 0.0.3-alpha
USAGE:
iotdb [FLAGS] [OPTIONS] [sql] [SUBCOMMAND]
FLAGS:
-d, --debug Enable debug mode
--dev Connect to dev server
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-e, --endpoint <endpoint> Set server endpoint, eg: `localhost:6667`
-f, --file <file> Execute batch form sql file, eg: `iotdb -f ddl.sql`
-H, --host <host> Set server hostname or ip address, eg: `127.0.0.1`
-p, --password <password> Set user password
-P, --port <port> Set server port
-t, --timezone <timezone> Set timezone, eg: `UTC+8`
-u, --user <user> Set user name
ARGS:
<sql> Execute single sql, eg: `iotdb "show storage group"`
SUBCOMMANDS:
csv Csv util(TODO)
file Execute batch form sql file, eg: `iotdb file ddl.sql`
help Prints this message or the help of the given subcommand(s)
load Load TsFile util (TODO)
update Self update(TODO)
usage Print usage
version Prints server version info
- Connect to IoTDB server
- Use default username and password
$ iotdb "SHOW STORAGE GROUP"
+---------------+
| storage group |
+---------------+
| root.ln |
| root.sg1 |
+---------------+
iotdb -u root -p root -e 127.0.0.1:6667 -t UTC+8
or
iotdb -u root -p root -H 127.0.0.1 -P 6667 -t UTC+8
- Execute single SQL interactively
$ iotdb -u root -p root --e 127.0.0.1:6667 -t UTC+8
▀██▀ ▄▄█▀▀██ █▀▀██▀▀█ ▀██▀▀█▄ ▀██▀▀█▄
██ ▄█▀ ██ ██ ██ ██ ██ ██
██ ██ ██ ██ ██ ██ ██▀▀▀█▄
██ ▀█▄ ██ ██ ██ ██ ██ ██
▄██▄ ▀▀█▄▄▄█▀ ▄██▄ ▄██▄▄▄█▀ ▄██▄▄▄█▀
Author: github.com/iotdb-lab <me@francis.run>
Version: iotdb-cli v0.0.2
Usage:
1. Print usage info: `?` or `help`
2. Exec system command on OS: `!ps`
3. Exit: `exit` or `quit` or `Ctrl-C` or `Ctrl-D`
IOTDB#(127.0.0.1:6667)> SHOW STORAGE GROUP
+---------------+
| storage group |
+---------------+
| root.ln |
| root.sg1 |
+---------------+
- Execute sql from the specified sql file
$ iotdb file tests/create_and_insert.sql
$ iotdb -file tests/create_and_insert.sql
$ iotdb -f tests/create_and_insert.sql
Statements: [
"DELETE STORAGE GROUP root.test;",
"CREATE TIMESERIES root.test.status WITH DATATYPE=BOOLEAN, ENCODING=PLAIN;",
"CREATE TIMESERIES root.test.temperature WITH DATATYPE=FLOAT, ENCODING=RLE;",
"INSERT INTO root.test(timestamp, status)\n values (1637960249484, true);",
"INSERT INTO root.test(timestamp, status, temperature)\n values (1637960256493, false, 20.71);",
"INSERT INTO root.test(timestamp, status, temperature)\n values (1637960261494, true, 32.43);",
"INSERT INTO root.test(timestamp, status, temperature)\n values (1637960272492, false, 28.66);",
"INSERT INTO root.test(timestamp, status, temperature)\n values (1637960272492, true, 22.61);",
"INSERT INTO root.test(timestamp, status, temperature)\n values (1637960296493, false, 28.66);",
]
23:00:23 [INFO] Execute batch statements successfully
- Print usage info
Apache License 2.0