@@ -376,42 +376,39 @@ $ usql pg://localhost/ -f script.sql
376
376
Supported command-line options:
377
377
378
378
``` sh
379
- $ usql --help
380
- usql, the universal command-line interface for SQL databases
381
-
382
379
Usage:
383
- usql [OPTIONS ]... [DSN]
380
+ usql [flags ]... [DSN]
384
381
385
382
Arguments:
386
- DSN database url
387
-
388
- Options :
389
- -c, --command= COMMAND ... run only single command (SQL or internal) and exit
390
- -f, --file= FILE ... execute commands from file and exit
391
- -w, --no-password never prompt for password
392
- -X, --no-rc do not read start up file
393
- -o, --out=OUT output file
394
- -W, --password force password prompt (should happen automatically)
395
- -1, --single-transaction execute as a single transaction (if non-interactive)
396
- -v, --set=, -- variable= NAME= VALUE ...
397
- set variable NAME to VALUE
398
- -P, --pset= VAR[ = ARG] ... set printing option VAR to ARG (see \p set command)
399
- -F, --field-separator= FIELD-SEPARATOR ...
400
- field separator for unaligned output (default, " | " )
401
- -R , --record-separator=RECORD-SEPARATOR ...
402
- record separator for unaligned output (default, \n )
403
- -T , --table-attr=TABLE-ATTR ...
404
- set HTML table tag attributes (e.g., width, border)
405
- -A , --no-align unaligned table output mode
406
- -H , --html HTML table output mode
407
- -t , --tuples-only print rows only
408
- -x , --expanded turn on expanded table output
409
- -z , --field-separator-zero set field separator for unaligned output to zero byte
410
- -0 , --record-separator-zero set record separator for unaligned output to zero byte
411
- -J , --json JSON output mode
412
- -C, --csv CSV output mode
413
- -G , --vertical vertical output mode
414
- -V , --version display version and exit
383
+ DSN database url or connection name
384
+
385
+ Flags :
386
+ -c, --command COMMAND run only single command (SQL or internal) and exit
387
+ -f, --file FILE execute commands from file and exit
388
+ -w, --no-password never prompt for password
389
+ -X, --no-rc do not read start up file (aliases: --no-psqlrc --no-usqlrc)
390
+ -o, --out FILE output file
391
+ -W, --password force password prompt (should happen automatically)
392
+ -1, --single-transaction execute as a single transaction (if non-interactive)
393
+ -v, --set NAME=VALUE set variable NAME to VALUE (see \s et command, aliases: --var --variable)
394
+ -N, --cset NAME=DSN set named connection NAME to DSN (see \c set command)
395
+ -P, --pset VAR=ARG set printing option VAR to ARG (see \p set command)
396
+ -F, --field-separator FIELD-SEPARATOR field separator for unaligned and CSV output (default " | " and " , " )
397
+ -R, --record-separator RECORD-SEPARATOR record separator for unaligned and CSV output (default \n )
398
+ -T , --table-attr TABLE-ATTR set HTML table tag attributes (e.g., width, border)
399
+ -A, --no-align unaligned table output mode
400
+ -H , --html HTML table output mode
401
+ -t, --tuples-only print rows only
402
+ -x , --expanded turn on expanded table output
403
+ -z , --field-separator-zero set field separator for unaligned and CSV output to zero byte
404
+ -0 , --record-separator-zero set record separator for unaligned and CSV output to zero byte
405
+ -J , --json JSON output mode
406
+ -C , --csv CSV output mode
407
+ -G , --vertical vertical output mode
408
+ -q , --quiet run quietly (no messages, only query output)
409
+ --config string config file
410
+ -V , --version output version information, then exit
411
+ -? , --help show this help, then exit
415
412
```
416
413
417
414
### Connecting to Databases
@@ -638,14 +635,14 @@ General
638
635
\drivers display information about available database drivers
639
636
640
637
Query Execute
641
- \bind [PARAM]... set query parameters
642
638
\g [(OPTIONS)] [FILE] or ; execute query (and send results to file or |pipe)
643
639
\crosstabview [(OPTIONS)] [COLUMNS] execute query and display results in crosstab
644
640
\G [(OPTIONS)] [FILE] as \g, but forces vertical output mode
645
641
\gexec execute query and execute each value of the result
646
642
\gset [PREFIX] execute query and store results in usql variables
647
643
\gx [(OPTIONS)] [FILE] as \g, but forces expanded output mode
648
644
\watch [(OPTIONS)] [DURATION] execute query every specified interval
645
+ \bind [PARAM]... set query parameters
649
646
650
647
Query Buffer
651
648
\e [FILE] [LINE] edit the query buffer (or file) with external editor
@@ -702,14 +699,16 @@ Transaction
702
699
Connection
703
700
\c DSN connect to database url
704
701
\c DRIVER PARAMS... connect to database with driver and parameters
702
+ \cset [NAME [DSN]] set named connection, or list all if no parameters
703
+ \cset NAME DRIVER PARAMS... define named connection for database driver
705
704
\Z close database connection
706
705
\password [USERNAME] change the password for a user
707
706
\conninfo display information about the current database connection
708
707
709
708
Operating System
710
709
\cd [DIR] change the current working directory
711
- \setenv NAME [VALUE] set or unset environment variable
712
710
\getenv VARNAME ENVVAR fetch environment variable
711
+ \setenv NAME [VALUE] set or unset environment variable
713
712
\! [COMMAND] execute command in shell or start interactive shell
714
713
\timing [on|off] toggle timing of commands
715
714
0 commit comments