Skip to content

Environment variables

The environment variables that usql v0.19.13-0.20261129074835-be3acfadfc0c reads, as \? variables lists them. Set one before the command, as USQL_PAGER=less usql. A row that names more than one variable gives them in the order that usql reads them: the first one that is set wins.

The environment of the programs that usql runs, such as the pager and the editor, is a section of the configuration. See the section env.

VariableDescription
USQL_CONFIGconfig file path (default config.yaml in the configuration directory)
USQL_DSNDSN to open when the command line names none, removed from the environment after it is read
USQL_EDITOR
EDITOR
VISUAL
editor used by the \e, \ef, and \ev commands
USQL_EDITOR_LINENUMBER_ARGhow to specify a line number when invoking the editor
USQL_HISTORYpath of the history file (default the history file in the state directory)
USQL_PAGER
PAGER
name of external pager program
USQL_SHOW_HOST_INFORMATIONdisplay host information when connecting to a database
USQLRCpath of the file that runs at start (default init.sql in the config directory)
USQL_SSLMODE
SSLMODE
when set to 'retry', allows connections to attempt to reconnect when no ?sslmode= was specified on the url
USQL_TERM_GRAPHICS
TERM_GRAPHICS
use the specified terminal graphics
USQL_SHELL
SHELL
shell that runs the \! command, a backtick, \g |command, \o |command, the pager and the editor