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.

87 lines
1.8 KiB
Markdown

# rqlite
9 years ago
3 years ago
`rqlite` is a command line tool for connecting to a rqlited node. Consult the [SQLite query language documentation](https://www.sqlite.org/lang.html) for full details on the supported SQL syntax.
9 years ago
3 years ago
- [Usage](#usage)
- [Example](#example)
- [Build](#example)
9 years ago
## Usage
```sh
8 years ago
$> rqlite -h
9 years ago
Options:
-h, --help
3 years ago
display help information
-a, --alternatives
comma separated list of 'host:port' pairs to use as fallback
9 years ago
8 years ago
-s, --scheme[=http]
protocol scheme (http or https)
9 years ago
-H, --host[=127.0.0.1]
rqlited host address
-p, --port[=4001]
8 years ago
rqlited host port
-P, --prefix[=/]
rqlited HTTP URL prefix
3 years ago
-i, --insecure[=false]
8 years ago
do not verify rqlited HTTPS certificate
3 years ago
-c, --ca-cert
path to trusted X.509 root CA certificate
-u, --user
set basic auth credentials in form username:password
-v, --version
display CLI version
9 years ago
```
## Example
3 years ago
Connecting to a host running locally:
9 years ago
```sh
3 years ago
$ rqlite
127.0.0.1:4001> CREATE TABLE foo (id INTEGER NOT NULL PRIMARY KEY, name TEXT)
8 years ago
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")
8 years ago
1 row affected (0.000117 sec)
127.0.0.1:4001> SELECT * FROM foo
9 years ago
+----+-------+
| id | name |
+----+-------+
| 1 | fiona |
+----+-------+
127.0.0.1:4001> quit
bye~
```
3 years ago
Connecting to a host running somewhere else on the network:
```
$ rqlite -H localhost -p 8493
locahost:8493>
```
## Build
```sh
go build -o rqlite
```