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

ClientUse it withEngines
DataGrip pluginDataGrip, and any JetBrains IDE with the Database toolsEvery engine QueryDesk connects to
QueryDesk CLIPostico, psql, TablePlus, Sequel Ace, mysql and any other Postgres or MySQL clientPostgreSQL, CockroachDB, TimescaleDB, AlloyDB and Redshift, and MySQL, MariaDB, TiDB, OceanBase, StarRocks and Doris
JDBC driverDBeaver, DbVisualizer and any other JDBC toolEvery 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

  1. Install the QueryDesk plugin from the JetBrains Marketplace. It works in DataGrip and in any JetBrains IDE with the Database tools.
  2. 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.
  3. Sign in in the browser. The plugin adds a data source for each credential you can use, under QueryDesk/<group>, or QueryDesk for 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:

FieldValue
Host127.0.0.1
Port15432 for PostgreSQL, CockroachDB, TimescaleDB, AlloyDB and Redshift, 13306 for MySQL, MariaDB, TiDB, OceanBase, StarRocks and Doris
Databasethe database's name in QueryDesk
Userthe credential's username
Passwordthe 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. BEGIN fails with a message that says so. Leave your client in autocommit.
  • SET changes stay in the CLI, and SHOW reads 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

  1. Download querydesk-jdbc-<version>.jar from the newest driver release, tagged jdbc-v, and add it as a driver file in DBeaver, DbVisualizer or your JDBC tool.

  2. Set the driver class to com.querydesk.jdbc.QueryDeskDriver.

  3. 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 needs ssl=false. product and version tell your tool which SQL dialect to use. engine is the database's type in QueryDesk, which lets the driver answer the checks a tool runs that the engine can't.

  4. 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.

Was this page helpful?