1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
1.1 KiB
Markdown

8 years ago
# Command Line Interface
7 years ago
rqlite comes with a CLI, which makes it easier to interact with a rqlite system. It is installed in the same directory as the node binary `rqlited`.
8 years ago
An example session is shown below.
8 years ago
```sh
4 years ago
$ rqlite
8 years ago
127.0.0.1:4001> CREATE TABLE foo (id INTEGER NOT NULL PRIMARY KEY, name TEXT)
0 row affected (0.000362 sec)
127.0.0.1:4001> .tables
+------+
| name |
+------+
| foo |
+------+
127.0.0.1:4001> .schema
+---------------------------------------------------------------+
| sql |
+---------------------------------------------------------------+
| CREATE TABLE foo (id INTEGER NOT NULL PRIMARY KEY, name TEXT) |
+---------------------------------------------------------------+
8 years ago
127.0.0.1:4001> INSERT INTO foo(name) VALUES("fiona")
8 years ago
1 row affected (0.000117 sec)
8 years ago
127.0.0.1:4001> SELECT * FROM foo
+----+-------+
| id | name |
+----+-------+
| 1 | fiona |
+----+-------+
8 years ago
127.0.0.1:4001> quit
bye~
8 years ago
```
7 years ago
You can connect the CLI to any node in a cluster, and it will automatically forward its requests to the leader. Pass `-h` to `rqlite` to learn more.