Database clients
Connect DataGrip, DBeaver, psql, TablePlus or another desktop client to the databases you can reach in QueryDesk. The client sends each statement to QueryDesk over HTTPS, signed in as you, and QueryDesk runs it with your access, reviews, data protection and the audit log. No database password reaches your machine, and your machine needs no network route to the database.
Which client to use
| Client | Use it with | Engines |
|---|---|---|
| DataGrip plugin | DataGrip, and any JetBrains IDE with the Database tools | Every engine QueryDesk connects to |
| QueryDesk CLI | Postico, psql, TablePlus, Sequel Ace, mysql and any other Postgres or MySQL client | PostgreSQL, CockroachDB, TimescaleDB, AlloyDB and Redshift, and MySQL, MariaDB, TiDB, OceanBase, StarRocks and Doris |
| JDBC driver | DBeaver, DbVisualizer and any other JDBC tool | Every engine QueryDesk connects to |
In QueryDesk, open a database's Query view and click Connect a client in the left panel. It shows the steps for each client that works with that database, filled in with your QueryDesk address and the database's credentials. Its URLs use the database's default credential or, when the default requires reviews or there is none, the first credential that needs none. querydesk databases prints a URL for every database and credential you can use.
Credentials that require reviews
Database clients don't support credentials that require reviews yet. A client connects only through a credential with Reviews set to 0, and Connect a client never shows another in its URLs. When every credential on a database requires reviews, no client can connect to it: run its queries in the Query view. A super admin can add a credential with Reviews set to 0 in the database's settings.
DataGrip and JetBrains IDEs
- Install the QueryDesk plugin from the JetBrains Marketplace. It works in DataGrip and in any JetBrains IDE with the Database tools.
- In the Database tool window, choose + › Connect QueryDesk (Tools › QueryDesk in IntelliJ IDEs) and enter the address you use QueryDesk at, for example
https://app.querydesk.com. - Sign in in the browser. The plugin adds a data source for each credential you can use, under
QueryDesk/<group>, orQueryDeskfor a database with no group. Each one loads its schema the first time you open it.
The plugin keeps your sign-in in the IDE's password safe, so you stay signed in across restarts. Databases you gain or lose in QueryDesk are added or removed at startup, every 5 minutes and when you switch back to the IDE.
The QueryDesk CLI
The CLI listens on your machine and speaks the Postgres and MySQL wire protocols, so any Postgres or MySQL client connects to it as if it were the database.
Install it
With Homebrew, on macOS or Linux:
brew install devhub-tools/tap/querydesk
Or download the archive for your platform from GitHub releases and put querydesk on your PATH.
Sign in and start it
querydesk login --server https://app.querydesk.com
querydesk start
Replace the address with the one you use QueryDesk at. querydesk login opens your browser and keeps the sign-in in your OS keychain. querydesk start runs in the background and prints each database you can reach with the URL to connect to it. querydesk databases prints them again, querydesk status says whether it's running and querydesk stop stops it.
Connect
Paste the URL into your client:
postgres://<username>:<local password>@127.0.0.1:15432/<database name>?sslmode=disable
mysql://<username>:<local password>@127.0.0.1:13306/<database name>
Or fill in the fields:
| Field | Value |
|---|---|
| Host | 127.0.0.1 |
| Port | 15432 for PostgreSQL, CockroachDB, TimescaleDB, AlloyDB and Redshift, 13306 for MySQL, MariaDB, TiDB, OceanBase, StarRocks and Doris |
| Database | the database's name in QueryDesk |
| User | the credential's username |
| Password | the local password |
Connect a client shows the URL with LOCAL_PASSWORD in place of the local password, because QueryDesk never sees it. The local password stops other users and processes on your machine from running queries as you. The CLI keeps it in its config file, querydesk/config.json under your OS config directory, and querydesk databases prints the URLs with it filled in.
The CLI finds a database by its name. When two databases you can reach share a name in different groups, it connects to the first one it finds.
How it behaves
- QueryDesk runs each statement on its own, so the CLI can't hold a transaction open.
BEGINfails with a message that says so. Leave your client in autocommit. SETchanges stay in the CLI, andSHOWreads them back. They don't reach the database.- A query that needs a review fails with the id of the query waiting in QueryDesk. Run it again once it's approved.
- Cancelling a query in your client closes its request to QueryDesk.
The JDBC driver
-
Download
querydesk-jdbc-<version>.jarfrom the newest driver release, taggedjdbc-v, and add it as a driver file in DBeaver, DbVisualizer or your JDBC tool. -
Set the driver class to
com.querydesk.jdbc.QueryDeskDriver. -
Create a connection with the URL that Connect a client shows:
jdbc:querydesk://<host>/<credential id>?product=<product>&version=<version>&engine=<engine>The host is your QueryDesk address without
https://, followed by its port when it isn't 443. A QueryDesk served over plain HTTP also needsssl=false.productandversiontell your tool which SQL dialect to use.engineis the database's type in QueryDesk, which lets the driver answer the checks a tool runs that the engine can't. -
Leave the user and password empty. The first connection opens your browser to sign in.
Keep the transaction mode on Auto: the driver can't hold a transaction open yet.