First Query
The following examples show how to run a simple query using the rsql
CLI tool for different database engines.
CockroachDB
rsql --url "cockroachdb://<user[:password>]@<host>[:<port>]/<database>" -- "SELECT version();"
DuckDB
rsql --url "duckdb://?memory=true" -- "SELECT version();"
LibSQL
rsql --url "libsql://?memory=true" -- "SELECT sqlite_version();"
MariaDB
rsql --url "mariadb://<user>[:<password>]@<host>[:<port>]/<database>" -- "SELECT version();"
MySQL
rsql --url "mysql://<user>[:<password>]@<host>[:<port>]/<database>" -- "SELECT version();"
Postgres
rsql --url "postgres://?embedded=true" -- "SELECT version();"
PostgreSQL
rsql --url "postgresql://?embedded=true" -- "SELECT version();"
Redshift
rsql --url "redshift://<user[:password>]@<host>[:<port>]/<database>" -- "SELECT version();"
Rusqlite
rsql --url "rusqlite://?memory=true" -- "SELECT sqlite_version();"
Snowflake
rsql --url "snowflake://<user>@<account>.snowflakecomputing.com/[?private_key_file=pkey_file&public_key_file=pubkey_file]" -- "SELECT CURRENT_VERSION();"
or
rsql --url "snowflake://<user>[:<token>]@<account>.snowflakecomputing.com/" -- "SELECT CURRENT_VERSION();"
Sqlite
rsql --url "sqlite://?memory=true" -- "SELECT sqlite_version();"