LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

rsql

Interactive SQL client for multiple databases

TLDR

Connect to database
$ rsql --url [postgres://user:pass@host/db]
copy
Execute query
$ rsql --url [postgres://user:pass@host/db] -c "[SELECT * FROM users]"
copy
Run SQL file
$ rsql --url [postgres://user:pass@host/db] -f [query.sql]
copy
Output as CSV
$ rsql --url [postgres://user:pass@host/db] -c "[query]" --csv
copy
Output as JSON
$ rsql --url [postgres://user:pass@host/db] -c "[query]" --json
copy

SYNOPSIS

rsql [--url url] [-c query | -f file] [options]

DESCRIPTION

rsql is a command-line SQL client written in Rust that provides a unified interface for connecting to many database engines, including PostgreSQL, MySQL, MariaDB, SQLite, DuckDB, Redshift, Snowflake, SQL Server, and others. It supports both interactive mode for exploratory queries and batch mode for running SQL files and single commands from scripts.Output can be formatted as CSV, JSON, Markdown, HTML, or formatted tables, making it suitable for both human reading and data pipeline integration. The --url flag specifies a database connection URL, while -c executes a query directly and -f runs a SQL file against the specified database.

PARAMETERS

--url URL

Database connection URL (e.g. `postgres://user:pass@host/db`, `mysql://...`, `sqlite://path`).
-c, --commands QUERY
Execute one or more semicolon-separated SQL commands and exit.
-f, --file FILE
Execute commands from an SQL script file and exit.
--format FORMAT
Output format: ascii, csv, expanded, html, json, jsonl, markdown, plain, psql, sqlite, tsv, unicode, xml, yaml.
--csv
Shorthand for `--format csv`.
--json
Shorthand for `--format json`.
--color WHEN
Colorize output: always, auto, or never.
--theme THEME
Syntax highlighting theme (e.g. solarized-dark, base16-ocean.dark).
--echo MODE
Echo commands before execution: on, off, prompt.
--timer
Print the elapsed time for each command.
--history
Enable command history.
--help
Display help information.
--version
Display version information.

INSTALL

brew install rsql
copy

CAVEATS

Connection string required. Database drivers needed. Rust-based tool.

HISTORY

rsql is a command-line SQL client written in Rust, providing a unified interface for multiple database types.

SEE ALSO

psql(1), mysql(1), sqlite3(1)

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid