From f49e620b41da8ece699a3be63041abcd71d1e044 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Sun, 12 Feb 2017 18:22:33 -0800 Subject: [PATCH] Update CLI.md --- doc/CLI.md | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/doc/CLI.md b/doc/CLI.md index 8be25bf8..2dc01c53 100644 --- a/doc/CLI.md +++ b/doc/CLI.md @@ -2,17 +2,31 @@ rqlite comes with a CLI, which can make it easier to interact with cluster. It is installed in the same directory as the cluster binary `rqlited`. An example session is shown below. -```bash -$ rqlite -127.0.0.1:4001> CREATE TABLE foo (id integer not null primary key, name text) -0 row affected (0.000668 sec) +```sh +$ ./rqlite +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) | ++---------------------------------------------------------------+ 127.0.0.1:4001> INSERT INTO foo(name) VALUES("fiona") -1 row affected (0.000080 sec) +1 row affected (0.000117 sec) 127.0.0.1:4001> SELECT * FROM foo +----+-------+ | id | name | +----+-------+ | 1 | fiona | +----+-------+ +127.0.0.1:4001> quit +bye~ ``` You can connect the CLI to any node in the cluster, and it will automatically forward its requests to the leader. Pass `-h` to `rqlite` to learn more.