Help · Kinds of tab
Databases
Connect to a database, run SQL or Redis commands, read the results and browse the schema.
A database tab has the schema on the left, a query editor at the top and the results below it.
Supported engines
- PostgreSQL
- MySQL
- MariaDB
- SQL Server
- SQLite (a file on this computer)
- Redis
- SproutDB (a server, or a database folder on this computer)
Connect to a database
- Press Ctrl+Shift+T and choose Database.
- Under New connection, pick an engine. The form opens with that engine's defaults.
- Fill in Host, Port, the sign-in and the database.
- Click Connect.
You can also paste an address into the box instead, for example postgres://user@host/db, or the path of a SQLite file. The form opens filled in, so you can check it before you connect.
In the form:
- Route decides how the connection travels. See Routes.
- Sign-in offers what the engine supports: a password, Ask when connecting, or None for Redis and SproutDB. SQL Server also offers Windows sign-in (Kerberos on Linux and macOS).
- The arrow next to the database field signs in and lists the databases on the server.
- Test connection checks the connection without opening a tab.
- For Redis and SproutDB, Plain connection without TLS turns encryption off.
- Save to the sidebar keeps the connection, with a name and a folder.
If a server shows a certificate Vandle does not trust yet, you are asked: Always trust, Trust just this once or Cancel.
Write and run queries
The editor highlights SQL. Statements are separated the usual way for each engine:
- a semicolon for SQL
GOon its own line for SQL Server- one command per line for Redis
The editor marks the statement under the cursor, and the bar above it says which one it is, for example "statement 2 of 5 under the cursor".
| Action | What runs |
|---|---|
| Run | The selection, or everything |
| Run statement | The selection, or the statement under the cursor |
| Run all | Every statement |
Run statement is also Ctrl+Enter.
If a statement fails, the statements after it do not run. Cancel stops a statement that is still running.
Read the results
Every statement that returns something gets its own numbered result. Choose Stacked to see them one below the other, or Tabs to see one at a time.
In a result you can:
- click a column header to sort by it
- click Copy to copy every row, tab-separated with a header line
- click Chart to show the rows as bars, when the result has a label column and a number column
- drag the grip below the grid to resize it, or double-click it to fit all rows
- click Pin to keep the result when you run again (other results are replaced)
A result with a lot of rows stops every 100,000 rows. Click Load more to go on, or Stop here.
Results are not saved. They are gone once the tab closes.
Follow foreign keys
When a result column belongs to a foreign key, its values are links. Click one to open the row it points at. That row opens as a new result right below, marked opened from with where you came from.
Below such a result, Pointed at by lists the columns of other tables that point at this row. Click one to open those rows.
Send a result to a dashboard
To dashboard adds the query as a widget to one of your dashboards, as a table, a chart or a single number. The widget runs the query itself whenever the dashboard refreshes. This needs a database saved to the sidebar. See Dashboards.
Browse the schema
The left side lists the TABLES and VIEWS of the database.
- Type in the search box to find tables and columns by name.
- Click a table to see its columns and their types.
- PK marks a primary key column, FK a foreign key.
- Click an FK column to jump to the table it points at.
- Click a PK column with references to see which columns point at it.
- First 100 rows writes a query for the table into the editor, below what is there, and runs it.
In a Redis tab, the list shows key prefixes and keys instead, and Keys with their values reads them.
To read the schema again, click the refresh button above the list, or press Ctrl+Shift+R.
Keys
| Key | Action |
|---|---|
| Ctrl+Enter | Run the statement under the cursor |
| Ctrl+Shift+R | Read the schema again |
You can change these keys in Settings under Hotkeys. See Keyboard.