Skip to content

Commit f72f30b

Browse files
committed
More cleanup to README.md
1 parent 4491f55 commit f72f30b

File tree

2 files changed

+35
-36
lines changed

2 files changed

+35
-36
lines changed

README.md

+34-35
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ $ go install -tags all github.com/xo/usql@master
182182
`usql` works with all Go standard library compatible SQL drivers supported by
183183
[`github.com/xo/dburl`][dburl].
184184

185-
The list of drivers that `usql` was built with can be displayed using the
185+
The list of drivers that `usql` was built with can be displayed with the
186186
[`\drivers` command][commands]:
187187

188188
```sh
@@ -338,7 +338,7 @@ associated database, scheme / build tag, and scheme aliases:
338338
</i>
339339
</p>
340340

341-
Any of the protocol schemes/aliases shown above can be used in conjunction when
341+
Any of the protocol schemes/aliases above can be used in conjunction when
342342
connecting to a database via the command-line or with the [`\connect` and
343343
`\copy` commands][commands]:
344344

@@ -422,7 +422,7 @@ connection strings (aka "data source name" or DSNs) have the same parsing rules
422422
as URLs, and can be passed to `usql` via command-line, or to the [`\connect`,
423423
`\c`, and `\copy` commands][commands].
424424

425-
Database connections can be named/defined via [the `\cset` command][connection-vars]
425+
Database connections can be defined with [the `\cset` command][connection-vars]
426426
or in [the `config.yaml` configuration file][config].
427427

428428
#### Database Connection Strings
@@ -487,10 +487,10 @@ If a URL does not have a `driver:` scheme, `usql` will check if it is a path on
487487
disk. If the path exists, `usql` will attempt to use an appropriate database
488488
driver to open the path.
489489

490-
When the path is a Unix Domain Socket, `usql` will attempt to open it using the
490+
When the path is a Unix Domain Socket, `usql` will attempt to open it with the
491491
MySQL driver. When the path is a directory, `usql` will attempt to open it
492492
using the PostgreSQL driver. And, lastly, when the path is a regular file,
493-
`usql` will attempt to open the file using the SQLite3 driver.
493+
`usql` will attempt to open the file using the SQLite3 or DuckDB drivers.
494494

495495
#### Driver Defaults
496496

@@ -549,8 +549,8 @@ $ usql ca://
549549
# connect to a sqlite database that exists on disk
550550
$ usql dbname.sqlite3
551551

552-
# Note: when connecting to a SQLite database, if the "<driver>://" or
553-
# "<driver>:" scheme/alias is omitted, the file must already exist on disk.
552+
# Note: when connecting to a SQLite database, if the "driver://" or
553+
# "driver:" scheme/alias is omitted, the file must already exist on disk.
554554
#
555555
# if the file does not yet exist, the URL must incorporate file:, sq:, sqlite3:,
556556
# or any other recognized sqlite3 driver alias to force usql to create a new,
@@ -585,7 +585,7 @@ Debug=0
585585
CommLog=1
586586
UsageCount=1
587587

588-
# connect to db2, postgres databases using above odbc config
588+
# connect to db2, postgres databases using odbc config above
589589
$ usql odbc+DB2://user:pass@localhost/dbname
590590
$ usql odbc+PostgreSQL+ANSI://user:pass@localhost/dbname?TraceFile=/path/to/trace.log
591591
```
@@ -742,7 +742,7 @@ Operating System
742742
\timing [on|off] toggle timing of commands
743743
744744
Variables
745-
\prompt [-TYPE] <VAR> [PROMPT] prompt user to set variable
745+
\prompt [-TYPE] VAR [PROMPT] prompt user to set variable
746746
\set [NAME [VALUE]] set internal variable, or list all if no parameters
747747
\unset NAME unset (delete) internal variable
748748
```
@@ -793,8 +793,8 @@ connections:
793793
database: free
794794
```
795795

796-
Defined `connections:` can be used on the command-line with with `\connect`,
797-
`\c`, `\copy`, and [other commands][commands]:
796+
Defined `connections:` can be used on the command-line with `\connect`, `\c`,
797+
`\copy`, and [other commands][commands]:
798798

799799
```sh
800800
$ usql my_godror_conn
@@ -814,17 +814,15 @@ init: |
814814
\set SYNTAX_HL_STYLE paraiso-dark
815815
```
816816

817-
The `init:` string is read at startup and will executed prior to any `-c` /
817+
The `init:` script is commonly used to set [environment variables][variables]
818+
or other configuration, and can be disabled on the command-line using the
819+
`--no-init` / `-X` flag. The script will be executed prior to any `-c` /
818820
`--command` / `-f` / `--file` flag and before starting the interactive
819821
interpreter.
820822

821-
The initialization script is commonly used to set startup environment variables
822-
and settings. The execution of the init script can be disabled on the
823-
command-line using the `--no-init` / `-X` flag.
823+
##### Other Options
824824

825-
##### Other Config Options
826-
827-
Please see [`contrib/config.yaml`](contrib/config.yaml) for examples of other
825+
Please see [`contrib/config.yaml`](contrib/config.yaml) for an overview of
828826
available configuration options.
829827

830828
#### Variables
@@ -835,15 +833,14 @@ available configuration options.
835833

836834
##### Runtime Variables
837835

838-
Client-side runtime variables are managed with the `\set` and `\unset`
839-
[commands][commands]:
836+
Runtime variables are managed with the `\set` and `\unset` [commands][commands]:
840837

841838
```sh
842839
(not connected)=> \unset FOO
843840
(not connected)=> \set FOO bar
844841
```
845842

846-
Runtime variables can be shown with `\set`:
843+
Runtime variables can be displayed with `\set`:
847844

848845
```sh
849846
(not connected)=> \set
@@ -875,7 +872,7 @@ pg:booktest@localhost=> select * from :TBLNAME where :"COLNAME" = :'FOO'
875872
```
876873
877874
The query buffer and interpolated values can be displayed with `\p` and
878-
`\print`, or the raw query buffer can be shown with `\raw`:
875+
`\print`, or the raw query buffer can be displayed with `\raw`:
879876
880877
```sh
881878
pg:booktest@localhost-> \p
@@ -919,7 +916,7 @@ pg:postgres@localhost=>
919916
Connection variables are not interpolated into queries. See the [configuration
920917
section for information on defining persistent connection variables][config].
921918
922-
Connection variables can be shown through `\cset`:
919+
Connection variables can be displayed with `\cset`:
923920
924921
```sh
925922
(not connected)=> \cset
@@ -928,8 +925,8 @@ my_conn = 'postgres://user:pass@localhost'
928925
929926
##### Display Formatting (Print) Variables
930927
931-
Client-side display formatting variables can be set using `\pset` and [via
932-
other commands][commands]:
928+
Display formatting variables can be set using `\pset` and [other
929+
commands][commands]:
933930
934931
```sh
935932
(not connected)=> \pset time Kitchen
@@ -938,7 +935,7 @@ Time display is "Kitchen" ("3:04PM").
938935
Output format is unaligned.
939936
```
940937
941-
Display formatting variables and settings can be shown through `\pset`:
938+
Display formatting variables can be displayed with `\pset`:
942939
943940
```sh
944941
(not connected)=> \pset
@@ -947,11 +944,12 @@ time Kitchen
947944
948945
##### Other Variables
949946
950-
Runtime behavior can be modified through special variables, such as
951-
[enabling/disabling syntax highlighting][highlighting].
947+
Runtime behavior, such as [enabling or disabling syntax
948+
highlighting][highlighting] can be modified through special variables like
949+
[`SYNTAX_HL`][highlighting].
952950
953-
Additional information on setting/using variables and the recognized special
954-
variables can be shown with `\? variables`:
951+
Use the `\? variables` [command][commands] to display variable help information
952+
and to list special variables recognized by `usql`:
955953
956954
```sh
957955
(not connected)=> \? variables
@@ -991,7 +989,8 @@ and writes to a destination database DSN:
991989
```
992990
993991
As demonstrated above, the `\copy` command does not require being connected to
994-
a database, and will not impact or alter the current open database connection.
992+
a database, and will not modify or change the current open database connection
993+
or state.
995994
996995
Any valid URL or DSN name maybe used for the source and destination database:
997996
@@ -1222,7 +1221,7 @@ Command completion can be canceled with `<Control-C>`.
12221221
12231222
Some databases support time/date columns that [support formatting][go-time]. By
12241223
default, `usql` formats time/date columns as [RFC3339Nano][go-time], and can be
1225-
set using `\pset time <FORMAT>`:
1224+
set using `\pset time FORMAT`:
12261225
12271226
```sh
12281227
$ usql pg://
@@ -1457,9 +1456,9 @@ additional [SQLite3 build tags (see: `build.sh`)](build.sh).
14571456
14581457
### macOS
14591458
1460-
The recommended installation method on macOS is [via `brew` (see above)][via Homebrew]
1461-
due to the way library dependencies for the `sqlite3` driver are done on macOS.
1462-
If the following (or similar) error is encountered when attempting to run `usql`:
1459+
The recommended installation method on macOS is [via `brew`][via Homebrew] due
1460+
to the way library dependencies for the `sqlite3` driver are done on macOS. If
1461+
the following (or similar) error is encountered when attempting to run `usql`:
14631462
14641463
```sh
14651464
$ usql

metacmd/cmds.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ func init() {
676676
Prompt: {
677677
Section: SectionVariables,
678678
Name: "prompt",
679-
Desc: Desc{"prompt user to set variable", "[-TYPE] <VAR> [PROMPT]"},
679+
Desc: Desc{"prompt user to set variable", "[-TYPE] VAR [PROMPT]"},
680680
Process: func(p *Params) error {
681681
typ := "string"
682682
ok, n, err := p.GetOptional(true)

0 commit comments

Comments
 (0)