SQL interface for relational databases and common data file formats

1 day ago 3

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

rsql is a command line SQL interface for data. rsql is a modern, feature-rich, and user-friendly client, that has been designed to be easy to use, and to provide a consistent experience across all supported data sources.

rsql can be installed using the following methods:

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

demo.webm Feature
Data Sources Arrow, Avro, CockroachDB, CrateDB, CSV, Delimited, DuckDB, DynamoDB, Excel, FlightSQL, FWF, JSON, JSONL, LibSQL (Turso), MariaDB, MySQL, ODS, ORC, Parquet, PostgreSQL, Redshift, Snowflake, SQLite3, SQL Server, TSV, XML, YAML
Compression Brotli, Bzip2, Gzip, LZ4, XZ, Zstd
Syntax Highlighting
Result Highlighting
Query Auto-completion
History
SQL File Execution
Embedded PostgreSQL
Output Formats ascii, csv, expanded, html, json, jsonl, markdown, plain, psql, sqlite, tsv, unicode, xml, yaml
Localized Interface 40+ languages¹
Key Bindings emacs, vi

¹ Computer translations; human translations welcome

rsql --url "<url>" -- "<query>"
Driver URL
arrow (polars) arrow://<file>
avro (polars) avro://<file>
brotli¹ brotli://<file>
bzip2¹ bzip2://<file>
cockroachdb (sqlx) cockroachdb://<user[:password>]@<host>[:<port>]/<database>
cratedb (sqlx) cratedb://<user[:password>]@<host>[:<port>]/<database>
csv (polars) csv://<file>[?has_header=<true|false>][&quote=<char>][&skip_rows=<n>]
delimited (polars) delimited://<file>[?separator=<char>][&has_header=<true|false>][&quote=<char>][&skip_rows=<n>]
duckdb duckdb://[<file>]
dynamodb dynamodb://[<access_key_id>:<secret_access_key>@]<host>[:<port>]>[?region=<region>][&session_token=<token>][&scheme=<http|https>]
excel excel://<file>[?has_header=<true|false>][&skip_rows=<n>]
file¹ file://<file>
flightsql flightsql://<user[:password>]@<host>[:<port>][?scheme=<http|https>]
fwf fwf://<file>?widths=<widths>[&headers=<headers>]
gzip¹ gzip://<file>
http¹ http://<path>[?_headers=<headers>]
https¹ https://<path>[?_headers=<headers>]
json (polars) json://<file>
jsonl (polars) jsonl://<file>
libsql² libsql://<host>?[<memory=true>][&file=<database_file>][&auth_token=<token>]
lz4¹ lz4://<file>
mariadb (sqlx) mariadb://<user>[:<password>]@<host>[:<port>]/<database>
mysql (sqlx) mysql://<user>[:<password>]@<host>[:<port>]/<database>
ods ods://<file>[?has_header=<true|false>][&skip_rows=<n>]
orc orc://<file>
parquet (polars) parquet://<file>
postgres postgres://<user>[:<password>]@<host>[:<port>]/<database>?<embedded=true>
postgresql (sqlx) postgresql://<user>[:<password>]@<host>[:<port>]/<database>?<embedded=true>
redshift (sqlx) redshift://<user[:password>]@<host>[:<port>]/<database>
rusqlite rusqlite://[<file>]
s3¹ s3://[<access_key_id>:<secret_access_key>@]<host>[:<port>]/<bucket>/<object>[?region=<region>][&session_token=<token>][&force_path_style=(true|false)][&scheme=<http|https>]
snowflake snowflake://<user>[:<token>]@<account>.snowflakecomputing.com/[?private_key_file=pkey_file&public_key_file=pubkey_file]
sqlite (sqlx) sqlite://[<file>]
sqlserver sqlserver://<user>[:<password>]@<host>[:<port>]/<database>
tsv (polars) tsv://<file>[?has_header=<true|false>][&quote=<char>][&skip_rows=<n>]
xml xml://<file>
xz¹ xz://<file>
yaml yaml://<file>
zstd¹ zstd://<file>

¹ the driver will attempt to detect the type of file and automatically use the appropriate driver.
² libsql needs to be enabled with the libsql feature flag; it is disabled by default as it conflicts with rusqlite.

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

Licensed under either of:

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
Read Entire Article