@@ -699,104 +699,124 @@ Type "help" for help.
699
699
700
700
(not connected)=> \?
701
701
General
702
- \q quit usql
703
- \copyright show usql usage and distribution terms
704
- \drivers display information about available database drivers
702
+ \q quit usql
703
+ \quit alias for \q
704
+ \copyright show usage and distribution terms for usql
705
+ \drivers show database drivers available to usql
705
706
706
- Query Execute
707
- \g [(OPTIONS)] [FILE] or ; execute query (and send results to file or |pipe)
708
- \go [(OPTIONS)] [FILE] alias for \g
709
- \G [(OPTIONS)] [FILE] as \g, but forces vertical output mode
710
- \ego [(OPTIONS)] [FILE] alias for \G
711
- \gx [(OPTIONS)] [FILE] as \g, but forces expanded output mode
712
- \gexec execute query and execute each value of the result
713
- \gset [PREFIX] execute query and store results in usql variables
714
- \crosstabview [(OPTIONS)] [COLUMNS] execute query and display results in crosstab
715
- \chart CHART [(OPTIONS)] execute query and display results as a chart
716
- \watch [(OPTIONS)] [DURATION] execute query every specified interval
717
- \bind [PARAM]... set query parameters
707
+ Help
708
+ \? [commands] show help on usql' s meta (backslash) commands
709
+ \? options show help on usql command-line options
710
+ \? variables show help on special usql variables
718
711
719
- Query Buffer
720
- \e [FILE] [LINE] edit the query buffer (or file) with external editor
721
- \edit [-exec] edit the query (or exec) buffer
722
- \p show the contents of the query buffer
723
- \raw show the raw (non-interpolated) contents of the query buffer
724
- \exec show the contents of the exec buffer
725
- \r reset (clear) the query buffer
726
- \w FILE write query buffer to file
712
+ Connection
713
+ \c DSN or \c NAME connect to dsn or named database connection
714
+ \c DRIVER PARAMS... connect to database with driver and parameters
715
+ \c onnect alias for \c
716
+ \Z close (disconnect) database connection
717
+ \d isconnect alias for \Z
718
+ \p assword [USER] change password for user
719
+ \p asswd alias for \p assword
720
+ \c onninfo display information about the current database connection
727
721
728
- Help
729
- \? [commands] show help on backslash commands
730
- \? options show help on usql command-line options
731
- \? variables show help on special usql variables
722
+ Query Execute
723
+ \g [(OPTIONS)] [FILE] or ; execute query (and send results to file or | pipe)
724
+ \g o alias for \g
725
+ \G [(OPTIONS)] [FILE] as \g , but forces vertical output mode
726
+ \e go alias for \G
727
+ \g x [(OPTIONS)] [FILE] as \g , but forces expanded output mode
728
+ \g exec execute query and execute each value of the result
729
+ \g set [PREFIX] execute query and store results in usql variables
730
+ \b ind [PARAM]... set query parameters
731
+ \t iming [on| off] toggle timing of commands
732
+
733
+ Query View
734
+ \c rosstab [(OPTIONS)] [COLUMNS] execute query and display results in crosstab
735
+ \c rosstabview alias for \c rosstab
736
+ \x tab alias for \c rosstab
737
+ \c hart CHART [(OPTIONS)] execute query and display results as a chart
738
+ \w atch [(OPTIONS)] [INTERVAL] execute query every specified interval
732
739
733
- Input/Output
734
- \copy SRC DST QUERY TABLE copy query from source url to table on destination url
735
- \copy SRC DST QUERY TABLE(A,...) copy query from source url to columns of table on destination url
736
- \echo [-n] [STRING] write string to standard output (-n for no newline)
737
- \qecho [-n] [STRING] write string to \o output stream (-n for no newline)
738
- \warn [-n] [STRING] write string to standard error (-n for no newline)
739
- \o [FILE] send all query results to file or |pipe
740
- \i FILE execute commands from file
741
- \ir FILE as \i, but relative to location of current script
742
-
743
- Conditional
744
- \if EXPR begin conditional block
745
- \elif EXPR alternative within current conditional block
746
- \else final alternative within current conditional block
747
- \endif end conditional block
740
+ Query Buffer
741
+ \e [-raw| -exec] [FILE] [LINE] edit the query buffer, raw (non-interpolated) buffer, the
742
+ exec buffer, or a file with external editor
743
+ \e dit alias for \e
744
+ \p [-raw| -exec] show the contents of the query buffer, the raw
745
+ (non-interpolated) buffer or the exec buffer
746
+ \p rint alias for \p
747
+ \r aw alias for \p
748
+ \e xec alias for \p
749
+ \w [-raw| -exec] FILE write the contents of the query buffer, raw
750
+ (non-interpolated) buffer, or exec buffer to file
751
+ \w rite alias for \w
752
+ \r reset (clear) the query buffer
753
+ \r eset alias for \r
748
754
749
755
Informational
750
- \d[S+] [NAME] list tables, views, and sequences or describe table, view, sequence, or index
751
- \da[S+] [PATTERN] list aggregates
752
- \df[S+] [PATTERN] list functions
753
- \di[S+] [PATTERN] list indexes
754
- \dm[S+] [PATTERN] list materialized views
755
- \dn[S+] [PATTERN] list schemas
756
- \dp[S] [PATTERN] list table, view, and sequence access privileges
757
- \ds[S+] [PATTERN] list sequences
758
- \dt[S+] [PATTERN] list tables
759
- \dv[S+] [PATTERN] list views
760
- \l[+] list databases
761
- \ss[+] [TABLE|QUERY] [k] show stats for a table or a query
762
-
763
- Formatting
764
- \pset [NAME [VALUE]] set table output option
765
- \a toggle between unaligned and aligned output mode
766
- \C [STRING] set table title, or unset if none
767
- \f [STRING] show or set field separator for unaligned query output
768
- \H toggle HTML output mode
769
- \T [STRING] set HTML <table> tag attributes, or unset if none
770
- \t [on|off] show only rows
771
- \x [on|off|auto] toggle expanded output
756
+ \d [S+] [NAME] list tables, views, and sequences or describe table, view,
757
+ sequence, or index
758
+ \d a[S+] [PATTERN] list aggregates
759
+ \d f[S+] [PATTERN] list functions
760
+ \d i[S+] [PATTERN] list indexes
761
+ \d m[S+] [PATTERN] list materialized views
762
+ \d n[S+] [PATTERN] list schemas
763
+ \d p[S] [PATTERN] list table, view, and sequence access privileges
764
+ \d s[S+] [PATTERN] list sequences
765
+ \d t[S+] [PATTERN] list tables
766
+ \d v[S+] [PATTERN] list views
767
+ \l [+] list databases
768
+ \s s[+] [TABLE| QUERY] [k] show stats for a table or a query
772
769
773
- Transaction
774
- \begin begin a transaction
775
- \begin -read-only ISOLATION begin a transaction with isolation level
776
- \commit commit current transaction
777
- \rollback rollback (abort) current transaction
770
+ Variables
771
+ \s et [NAME [VALUE]] set usql application variable, or show all usql application
772
+ variables if no parameters
773
+ \u nset NAME unset (delete) usql application variable
774
+ \p set [NAME [VALUE]] set table print formatting option, or show all print
775
+ formatting options if no parameters
776
+ \a toggle between unaligned and aligned output mode
777
+ \C [TITLE] set table title, or unset if none
778
+ \f [SEPARATOR] show or set field separator for unaligned query output
779
+ \H toggle HTML output mode
780
+ \T [ATTRIBUTES] set HTML < table> tag attributes, or unset if none
781
+ \t [on| off] show only rows
782
+ \x [on| off| auto] toggle expanded output
783
+ \c set [NAME [URL]] set named connection, or show all named connections if no
784
+ parameters
785
+ \c set NAME DRIVER PARAMS... set named connection for driver and parameters
786
+ \p rompt [-TYPE] VAR [PROMPT] prompt user to set application variable
778
787
779
- Connection
780
- \c DSN connect to database url
781
- \c DRIVER PARAMS... connect to database with driver and parameters
782
- \cset show named connections
783
- \cset NAME DSN set named connection
784
- \cset NAME DRIVER PARAMS... define named connection for database driver
785
- \Z close database connection
786
- \password [USER] change password for user
787
- \conninfo display information about the current database connection
788
-
789
- Operating System
790
- \cd [DIR] change the current working directory
791
- \getenv VARNAME ENVVAR fetch environment variable
792
- \setenv NAME [VALUE] set or unset environment variable
793
- \! [COMMAND] execute command in shell or start interactive shell
794
- \timing [on|off] toggle timing of commands
788
+ Input/Output
789
+ \e cho [-n] [MESSAGE]... write message to standard output (-n for no newline)
790
+ \q echo [-n] [MESSAGE]... write message to \o output stream (-n for no newline)
791
+ \w arn [-n] [MESSAGE]... write message to standard error (-n for no newline)
792
+ \o [FILE] send all query results to file or | pipe
793
+ \o ut alias for \o
794
+ \c opy SRC DST QUERY TABLE copy results of query from source database into table on
795
+ destination database
796
+ \c opy SRC DST QUERY TABLE(A,...) copy results of query from source database into table' s
797
+ columns on destination database
798
+
799
+ Control/Conditional
800
+ \i FILE execute commands from file
801
+ \include alias for \i
802
+ \ir FILE as \i, but relative to location of current script
803
+ \include_relative alias for \ir
804
+ \if EXPR begin conditional block
805
+ \elif EXPR alternative within current conditional block
806
+ \else final alternative within current conditional block
807
+ \endif end conditional block
795
808
796
- Variables
797
- \prompt [-TYPE] VAR [PROMPT] prompt user to set variable
798
- \set [NAME [VALUE]] set internal variable, or list all if no parameters
799
- \unset NAME unset (delete) internal variable
809
+ Transaction
810
+ \begin [-read-only [ISOLATION]] begin transaction, with optional isolation level
811
+ \commit commit current transaction
812
+ \rollback rollback (abort) current transaction
813
+ \abort alias for \rollback
814
+
815
+ Operating System/Environment
816
+ \! [COMMAND] execute command in shell or start interactive shell
817
+ \cd [DIR] change the current working directory
818
+ \getenv VARNAME ENVVAR fetch environment variable
819
+ \setenv NAME [VALUE] set or unset environment variable
800
820
```
801
821
802
822
Parameters passed to commands [can be backticked][backticks].
0 commit comments