Settings and variables
The settings and variables of usql v0.19.13-0.20261129074835-be3acfadfc0c, as \? variables lists them. Each belongs to a section. The section is a key of config.yaml, and\config and -O name a setting with its section, asprint.border.
Keys of config.yaml
config.yaml holds each section as a map of names and values. TheConfigure usql guide says where the file is.
| Key | What it holds |
|---|---|
vars: | usql script variables |
usql: | Settings of usql |
print: | Display settings |
charts: | Chart settings |
env: | Environment of the commands that usql runs, such as \!, the pager and the editor |
connections: | Named connections |
aliases: | Aliases, the meta commands of the user |
usql script variables
The section vars. Set a name of it with:
usql --set=NAME=VALUE
\set NAME VALUE inside usqlA script variable can have any name. usql sets the variables of this table itself.
| Name | Description |
|---|---|
ROW_COUNTvars.ROW_COUNT | number of rows returned or affected by the last query, or 0 if it failed |
Settings of usql
The section usql. Set a name of it with:
usql --uset=NAME=VALUE
\uset NAME VALUE inside usql| Name | Description |
|---|---|
editorusql.editor | editor used by the \e, \ef, and \ev commands |
fetch_countusql.fetch_count | the number of result rows to read and show at a time, 0 for all of them at once, as psql's FETCH_COUNT (default 0) |
on_error_stopusql.on_error_stop | stop batch execution after error |
pagerusql.pager | name of external pager program |
prompt1usql.prompt1 | specifies the standard usql prompt |
prompt2usql.prompt2 | specifies the prompt used when a statement continues on another row |
quietusql.quiet | run quietly (same as -q option) |
show_host_informationusql.show_host_information | display host information when connecting to a database |
encodingusql.encoding | encoding of a script read with -f, \i or from a pipe, such as windows-1252 or shift_jis (default utf-8) |
sslmodeusql.sslmode | when set to 'retry', allows connections to attempt to reconnect when no ?sslmode= was specified on the url |
syntax_hlusql.syntax_hl | enable syntax highlighting of the input |
syntax_hl_formatusql.syntax_hl_format | color depth of the highlighting [noop, terminal, terminal256, terminal16m] |
syntax_hl_override_bgusql.syntax_hl_override_bg | keep the background of the terminal, and not the background of the highlighting style |
syntax_hl_styleusql.syntax_hl_style | syntax highlighting style name |
term_graphicsusql.term_graphics | use the specified terminal graphics |
Display settings
The section print. Set a name of it with:
usql --pset=NAME[=VALUE]
\pset NAME [VALUE] inside usql| Name | Description |
|---|---|
borderprint.border | border style (number) |
columnsprint.columns | target width for the wrapped format |
csv_fieldsepprint.csv_fieldsep | field separator for CSV output (default ",") |
expandedprint.expanded | expanded output [on, off, auto] |
fieldsepprint.fieldsep | field separator for unaligned output (default "|") |
fieldsep_zeroprint.fieldsep_zero | set field separator for unaligned output to a zero byte |
footerprint.footer | enable or disable display of the table footer [on, off] |
formatprint.format | set output format [unaligned, aligned, wrapped, vertical, html, asciidoc, csv, json, markdown, ...] |
header_alignprint.header_align | alignment of the column names in aligned, wrapped and markdown output [center, left, right, column] (default center) |
linestyleprint.linestyle | set the border line drawing style [ascii, old-ascii, unicode] |
json_indentprint.json_indent | number of spaces to indent JSON output, 0 for compact output [N, on, off] (default 0) |
localeprint.locale | the locale whose digit group separator numericlocale uses, such as en-US (default the locale of the system) |
nullprint.null | set the string to be printed in place of a null value |
numericlocaleprint.numericlocale | enable display of a locale-specific character to separate groups of digits |
pager_min_linesprint.pager_min_lines | number of lines the output must have before the pager starts, 0 for no minimum (default 0) |
pagerprint.pager | control when an external pager is used [on, off, always] |
recordsepprint.recordsep | record (line) separator for unaligned output |
recordsep_zeroprint.recordsep_zero | set record separator for unaligned output to a zero byte |
tableattrprint.tableattr | specify attributes for table tag in html format, or proportional column widths for left-aligned data types in latex-longtable format |
timeprint.time | format used to display time/date column values (default RFC3339Nano) |
timezoneprint.timezone | the time zone to display a timestamp with a time zone in (default "") |
titleprint.title | set the table title for subsequently printed tables |
tuples_onlyprint.tuples_only | if set, only actual table data is shown |
unicode_border_linestyleprint.unicode_border_linestyle | set the style of Unicode line drawing [single, double] |
unicode_column_linestyleprint.unicode_column_linestyle | set the style of Unicode line drawing [single, double] |
unicode_header_linestyleprint.unicode_header_linestyle | set the style of Unicode line drawing [single, double] |
xheader_widthprint.xheader_width | maximum width of the header of a record in expanded output [full, column, page, N] (default full) |
Chart settings
The section charts. Set a name of it with:
usql --option=charts.NAME=VALUE
\config charts.NAME VALUE inside usql| Name | Description |
|---|---|
pathcharts.path | directory of the chart files, relative to the directory of the configuration file (default "charts") |
Environment of the commands that usql runs, such as \!, the pager and the editor
The section env. Set a name of it with:
usql --option=env.NAME=VALUE
\setenv NAME [VALUE] inside usqlThe names of this section are the ones that you pick.
Named connections
The section connections. Set a name of it with:
usql --cset=NAME=DSN
\cset NAME [DSN] inside usql
\cset NAME DRIVER PARAMS... inside usqlThe names of this section are the ones that you pick.
Aliases, the meta commands of the user
The section aliases. Set a name of it with:
NAME: TEXT under aliases: in config.yaml, which \NAME runsThe names of this section are the ones that you pick.