URL Schemes
Use querious:// links to open connections to databases, for handy integration with launchers and automation tools.
Use mysql:// and postgresql:// links to open connections to MySQL and PostgreSQL databases.
Creating Connections #
You can create a new connection window and connect to a server using:
Identifying Tabs #
Both querious://connect links accept an id parameter: a name of your choosing for the tab the link opens. If a tab with that id is already open, Querious brings it forward instead of connecting again, and since no connection is opened, it is never confirmed.
The id also lets a querious://query link find the tab later.
querious://connect/saved?name=Seth%27s%20iMac&id=sakila
Allowing Links to Connect #
The URL Scheme Connections setting in the General pane of controls what happens when a querious://connect or mysql:// or postgresql:// link is opened:
| Choice | Meaning |
|---|---|
| Confirm | Querious shows a confirmation alert asking if you want to allow the connection. |
| Allow | Links always connect immediately. |
| Don't Allow | Links never connect. |
For security and safety: A link that uses password-command runs a shell command, so Querious always asks for confirmation and shows the command, even when the setting is Allow.
querious://connect/saved #
Opens a new window and connects to a saved connection.
Parameters
| Parameter | Meaning |
|---|---|
name |
The name of the saved connection as shown in Querious. |
select |
A database name or database.table to select once connected. |
database |
Overrides the saved connection's database (MySQL and PostgreSQL). |
schema |
Overrides the saved connection's initial schema (PostgreSQL). For MySQL it means the same as database; if both are given they must match. |
password |
Overrides the saved connection's password (MySQL and PostgreSQL). |
id |
Identifies the tab that is opened. See "Identifying Tabs". |
query |
Text to put in the Query view's editor. It is not run. |
The overrides apply only to the tab the link opens. The saved connection is not changed. database, schema and password can't be used with a SQLite connection.
querious://connect/saved?name=Seth%27s%20iMac&select=sakila.film
querious://connect/new #
Opens a new window and connects using the given parameters. The rdbms parameter chooses the kind of database, and the other parameters that apply depend on it.
All Connections #
Parameters
| Parameter | Meaning |
|---|---|
name |
A name to show for the connection. |
rdbms |
Choices: mysql (the default), postgres (or postgresql), sqlite |
id |
Identifies the tab that is opened. See "Identifying Tabs". |
query |
Text to put in the Query view's editor. It is not run. |
MySQL and PostgreSQL #
Parameters
| Parameter | Meaning |
|---|---|
host |
The server's host. Required unless unix-socket is given. |
port |
The server's port, from 0 to 65535. |
user |
The username. |
password |
The password. |
password-command |
A shell command which prints the password. Used instead of password. Querious always asks for confirmation before running it. |
database |
The database to select once connected. |
unix-socket |
Path of the unix socket file, if connecting through one. |
security |
ssl, ssh, or ssl,ssh. When omitted, SSH is used if ssh-host is given, and SSL is off. Any other value is an error. |
ssl-client-key-file |
Absolute path of the client key. |
ssl-client-cert-file |
Absolute path of the client certificate. |
ssl-ca-cert-file |
Absolute path of the certificate authority's certificate. |
ssh-host |
The SSH host. Required when security includes ssh, so a link never silently connects without the tunnel it asked for. |
ssh-user |
The SSH username. |
ssh-password |
The SSH password. |
ssh-key-file |
Absolute path of the SSH private key. |
ssh-port |
The port SSH is listening on. |
ssh-local-port |
Local port of an existing SSH tunnel to use. Omit it to have Querious create the tunnel. |
MySQL Only #
Parameters
| Parameter | Meaning |
|---|---|
database-behavior |
Choices: initial (the default), exclusive. With exclusive, only the given database is shown. |
use-compression |
Choices: true, false. When omitted, compression is used only for local connections without an SSH tunnel. |
use-cleartext |
Choices: true, false |
auth-plugin |
Overrides the authentication plugin. |
ssl-cipher |
A specific cipher to require. |
ssh-admin-host |
The SSH host to use for administration tasks. The other ssh-admin- parameters are used only when this is given, and ssh-admin-user is then required. |
ssh-admin-user |
The SSH admin username. Required with ssh-admin-host. |
ssh-admin-password |
The SSH admin password. |
ssh-admin-key-file |
Absolute path of the SSH admin private key. |
ssh-admin-port |
The port the SSH admin host is listening on. |
PostgreSQL Only #
Parameters
| Parameter | Meaning |
|---|---|
schema |
The initial schema. |
schema-behavior |
Choices: initial (the default), exclusive. With exclusive, only the given schema is shown. |
search-path |
The search path to use. |
SQLite #
Parameters
| Parameter | Meaning |
|---|---|
file |
Path of the database file. Required. A leading ~ is expanded. |
Empty parameter values are treated as if the parameter were missing. true/false parameters, port numbers and …-behavior parameters that have any other value are an error.
Examples #
querious://connect/new?host=127.0.0.1&user=webadmin&password=thepassword&use-compression=false
querious://connect/new?rdbms=postgres&host=localhost&user=webadmin&database=app&schema=public&ssh-host=example.com&ssh-user=deploy&ssh-key-file=/Users/me/.ssh/id_ed25519
querious://connect/new?rdbms=postgres&host=db.example.com&user=webadmin&password-command=security%20find-generic-password%20-w%20-s%20mydb
querious://connect/new?rdbms=sqlite&file=~/Documents/notes.sqlite
querious://query #
Brings the tab with the given id forward and puts a query in the Query view.
Parameters
| Parameter | Meaning |
|---|---|
id |
Required. The id given to a connect link for a tab that is still open. |
query |
Required. The text to put in that tab's Query view editor. It is not run. |
querious://query?id=sakila&query=SELECT%20*%20FROM%20actor
querious://register #
Opens the Registration window and attempts to register Querious. You can register either with a license key, or with a Team Access key.
Parameters
| Parameter | Meaning |
|---|---|
name |
The name the license is registered to. Required with licenseKey. |
licenseKey |
The license key. Required with name. |
accessKey |
A Team Access key. Querious signs in with it, fetches the license, and registers. Used only when name and licenseKey aren't both given. |
If neither a name and licenseKey pair nor an accessKey is given, nothing happens.
querious://register?name=Seth%20Willits&licenseKey=XXXX-XXXX-XXXX
querious://register?accessKey=XXXXXXXXXXXXXXXX
mysql:// and postgres:// URLs #
Querious also opens standard database URLs, which is handy for tools that already produce them. postgres:// and postgresql:// open PostgreSQL connections, and mysql:// opens MySQL connections. They follow the URL Scheme Connections setting described above, and always open a new connection (unless id matches an open tab).
mysql://user:password@host:port/database?…
postgres://user:password@host:port/database?…
The user, password, host, port and database come from the URL's usual places, so special characters in them must be percent-encoded. Values in the URL's authority and path take precedence over the same setting in the query.
Query Parameters
| Parameter | Meaning |
|---|---|
host, port, user, password |
Used when not already given in the URL. A host starting with / is treated as a unix socket path. |
dbname, database, db |
The database, if the URL has no path. |
socket, unix-socket, unix_socket |
Path of the unix socket file. |
sslmode (PostgreSQL) |
disable, allow and prefer leave SSL off. require, verify-ca and verify-full turn it on. |
sslrootcert, sslcert, sslkey (PostgreSQL) |
Paths of the certificate authority's certificate, client certificate and client key. |
ssl-mode (MySQL) |
disabled and preferred leave SSL off. required, verify_ca and verify_identity turn it on. |
ssl-ca, ssl-cert, ssl-key (MySQL) |
Paths of the certificate authority's certificate, client certificate and client key. Underscores may be used in place of hyphens. |
Any other query parameter is treated as the matching querious://connect/new parameter, such as name, id, query, ssh-host and password-command.
postgres://webadmin:thepassword@db.example.com:5432/app?sslmode=require
mysql://webadmin@127.0.0.1/sakila?name=Local%20Sakila&ssh-host=example.com