The options of the command line of usql v0.19.13-0.20261129074835-be3acfadfc0c, as usql --help lists them. A command line has the options, then a URL or the name of a connection:
usql [OPTION]... [DSN]
An option that takes a value takes it after a space or after =, as-c 'select 1' or --command='select 1'.
General options
| Option | Description |
|---|
-c, --command=COMMAND | run only single command (SQL or internal) and exit |
-d, --dbname=DSN | database url or connection name to connect to |
-f, --file=FILE | execute commands from file, then exit |
-l, --list | list available databases, then exit |
-v, --set=NAME=VALUE | set script variable NAME to VALUE (see \set command) Also --variable. |
-O, --option=NAME=VALUE | set configuration option NAME (SECTION.NAME) to VALUE (see \config command) |
-U, --uset=NAME=VALUE | set setting NAME of usql to VALUE (see \uset command) |
-N, --cset=NAME=DSN | set named connection NAME to DSN (see \cset command) |
-D, --dump | write the database as a usql script to standard output or to the file of -o, then exit |
--config=FILE | config file |
-V, --version | output version information, then exit |
-X, --no-init | do not execute initialization scripts |
-1, --single-transaction | execute as a single transaction (if non-interactive) |
-?, --help[=options] | show this help, then exit--help=options--help=commands: list backslash commands, then exit--help=variables: list variables and settings, then exit
|
| Option | Description |
|---|
-A, --no-align | unaligned table output mode |
-C, --csv | CSV output mode |
-F, --field-separator=STRING | field separator for unaligned and CSV output (default "|" and ",") |
-G, --vertical | vertical output mode |
-H, --html | HTML table output mode |
-J, --json | JSON output mode |
-M, --markdown | markdown output mode |
-P, --pset=VAR=ARG | set printing option VAR to ARG (see \pset command) |
-R, --record-separator=STRING | record separator for unaligned and CSV output (default \n) |
-t, --tuples-only | print rows only |
-T, --table-attr=TEXT | set HTML table tag attributes (e.g., width, border) |
-x, --expanded | turn on expanded table output |
-z, --field-separator-zero | set field separator for unaligned and CSV output to zero byte |
-0, --record-separator-zero | set record separator for unaligned and CSV output to zero byte |
Connection options
Options of a dump
These options change what --dump writes. They are long options only, andusql --help does not list them. The meta command \dump takes the same options, as -schema-only.