Skip to content

Command-line options ​

quarry [OPTIONS] [TARGET] [EXTRA]

TARGET is a URL, a saved connection name, a SQLite file, or a database name. See Connecting for how it's interpreted. EXTRA is a database name when TARGET is a URL without one, or the user in the pgcli-style quarry dbname user.

Connection ​

OptionShortMeaning
--host HOST-hHost
--port PORT-p, -PPort
--user USER-u, -UUser. Also --username.
--database DB-d, -DDatabase. Also --dbname.
--socket PATH-SUnix socket
--backend NAMEpostgres (pg, postgresql), mysql (mariadb, my) or sqlite (sqlite3, lite), for connecting with flags only
--password-WAlways ask for a password before connecting
--no-password-wNever ask for a password
--readonly-rRefuse statements that change data or schema. See read-only mode.
--init-command SQLRun SQL right after connecting. Repeatable.

TLS and SSH ​

OptionMeaning
--ssl-mode MODEdisable, prefer (default), require, verify-ca, verify-full
--ssl-ca FILECA certificate to trust (PEM)
--ssl-cert FILEClient certificate (PEM)
--ssl-key FILEClient key (PEM)
--ssh [USER@]HOST[:PORT]Tunnel through SSH
--ssh-key FILESSH private key

See TLS and SSH tunnels.

Running SQL ​

OptionShortMeaning
--execute SQL-eRun SQL (or one special command) and exit. Repeatable.
--file FILE-fRun the SQL in a file and exit
--format FORMAT-FOutput format: rounded, psql, csv, tsv, json, markdown, … See Output formats.
--continue-on-errorKeep going after a failing statement

See Scripts, exports and pipes.

Interface ​

OptionShortMeaning
--tui-TOpen the full-screen TUI. Ignored in scripts.
--theme NAMEColour theme for this run
--prompt FORMATPrompt format for this session. See the prompt.
--icons SETnerd, unicode or ascii for this run. See icons.
--no-colorNo colour
--less-chattySkip the banner and the goodbye message
--row-limit NAsk before showing more than N rows. 0 never asks.

Configuration and connections ​

OptionShortMeaning
--config FILEUse this config file instead of ~/.config/quarry/config.toml. Favourites and themes are then read from next to it.
--list-lList saved connections and exit
--save NAMESave this connection under NAME. See Saved connections.
--default-configPrint the default config file, every option commented, to start customizing from. See Configuration file.
--setup-llmChoose how \llm reaches a model, test it and save it. See Asking a model for SQL.
--completions SHELLPrint the tab-completion script for bash, zsh, fish, elvish or powershell. See Shell completion.

Help ​

OptionShortMeaning
--helpShow help. (-h is the host.)
--version-VShow the version

Exit status ​

StatusWhen
0Everything ran
1A statement failed, or quarry couldn't connect
2The command-line options were invalid

Released under the MIT licence.