Skip to content

theseus-rs/rsql

rsql

ci Documentation Code Coverage Benchmarks Latest version Github All Releases License Semantic Versioning

rsql is a command line interface for databases.

Getting Started

rsql can be installed using the following methods:

Linux / MacOS

curl --proto '=https' --tlsv1.2 -LsSf https://github.com/theseus-rs/rsql/releases/latest/download/rsql_cli-installer.sh | sh

Windows

irm https://github.com/theseus-rs/rsql/releases/latest/download/rsql_cli-installer.ps1 | iex

For more information, and additional installations instructions (cargo, homebrew, msi), visit the RSQL site.

Quick Demo

asciicast

Usage

rsql --url '<url>'
Driver URL
duckdb duckdb://?<memory=true>[&file=<database_file>]
libsql¹ libsql://<host>?[<memory=true>][&file=<database_file>][&auth_token=<token>]
mariadb (sqlx) mariadb://<user>[:<password>]@<host>[:<port>]/<database>
mysql (sqlx) mysql://<user>[:<password>]@<host>[:<port>]/<database>
postgres postgres://<user>[:<password>]@<host>[:<port>]/<database>?<embedded=true>
postgresql (sqlx) postgresql://<user>[:<password>]@<host>[:<port>]/<database>?<embedded=true>
rusqlite rusqlite://?<memory=true>[&file=<database_file>]
sqlite (sqlx) sqlite://?<memory=true>[&file=<database_file>]
sqlserver sqlserver://<user>[:<password>]@<host>[:<port>]/<database>

¹ libsql needs to be enabled with the libsql feature flag; it is disabled by default as it conflicts with rusqlite.

Features

Feature
Databases DuckDB, LibSQL (Turso), MariaDB, MySQL, PostgreSQL, SQLite3, SQL Server
Embedded PostgreSQL
Syntax Highlighting
Result Highlighting
History
SQL File Execution
Output Formats csv, html, json, jsonl, markdown, plain, psql, sqlite, tsv, xml, yaml
Localized Interface 40+ languages¹
Key Bindings emacs, vi

¹ Computer translations; human translations welcome

Safety

These crates use #![forbid(unsafe_code)] to ensure everything is implemented in 100% safe Rust.

License

Licensed under either of:

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

VSCode Development Container
GitHub Codespaces