LinuxCommandLibrary

rsql

Interactive SQL client for multiple databases

TLDR

Connect to database

$ rsql -d [database_url]
copy
Execute query
$ rsql -d [database_url] -c "[SELECT * FROM users]"
copy
Run SQL file
$ rsql -d [database_url] -f [query.sql]
copy
Output as CSV
$ rsql -d [database_url] -c "[query]" --csv
copy
Output as JSON
$ rsql -d [database_url] -c "[query]" --json
copy

SYNOPSIS

rsql [-d 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 multiple database types including PostgreSQL, MySQL, and SQLite. 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, or formatted tables, making it suitable for both human reading and data pipeline integration. The -d flag specifies a database connection URL, while -c executes a query directly and -f runs a SQL file against the specified database.

PARAMETERS

-d URL

Database URL.
-c QUERY
Execute query.
-f FILE
Run SQL file.
--csv
CSV output.
--json
JSON output.
-t
Table format.
-v
Verbose mode.

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)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community