Database tabNEW
Browse and query PostgreSQL, MySQL and MariaDB servers from the VM page: schema tree, ER diagram, data and SQL.
When it appears
A VM can be marked as running a database service (PostgreSQL, MySQL or MariaDB) in its details under Workload (vm.edit.resources). Database servers then get a Database tab on the VM page.
| Permission | Allows |
|---|---|
| vm.db.view | Open the tab: schema tree, ER diagram, structure and rows, all read-only |
| vm.db.query | Run any SQL including writes, edit rows, and change the connection |
Connection
- Set host, port, username, database and password on the Connection tab. The host can only be one of the VM's own addresses.
- The password is stored encrypted; leave the field empty to keep the saved one.
- Browsing runs in read-only transactions. Every statement has a timeout and results are capped at 1000 rows.
- The Platform project's database server uses the portal's own connection and is always read-only.
Schema tree and ER diagram
- On the left: a database picker, search (press /), and Tables and Views with their columns and indexes.
- The ERD view draws tables as cards with their columns and relationships.
- Selecting a table in the tree or the diagram selects it everywhere. “Query in SQL” opens a query for it.
Data and structure
- Data shows a table's rows. With vm.db.query you can edit cells in place and delete rows with press-and-hold. Views and tables without a primary key can't be edited.
- Copy one or more rows as JSON.
- Structure lists columns (name, type, null, default), indexes, foreign keys and the tables that reference this one. Foreign keys are clickable and open the referenced table.
- The create statement (or view definition) is shown at the bottom.
SQL editor
- Syntax highlighting in the server's SQL dialect.
- Autocomplete for keywords, schemas, tables and columns from the live schema.
- Lint warnings underline syntax the parser can't read and tables that don't exist; the server has the final word when the query runs.
- Ctrl+Enter or Cmd+Enter runs the query.
Every query and every change, including failed ones, is recorded in Activity with the VM and the user.
Features on this page
- Database tabNEW
- Schema tree and ER diagramNEW
- Data editingNEW
- Table structureNEW
- SQL editorNEW
More in Virtual machinesAll topics
Create a VMThe seven-step New VM wizard, how names map to VMIDs, placement, and what happens after Create.Power actionsStart, shutdown, reboot, hard stop, suspend and resume, each with its own permission, for one VM or many.The VM page and consoleThe Virtual Machines list, a VM's tabs, and the browser console (noVNC, SSH and RDP).