Databases

Tools → Databases is a database client in the browser, in the spirit of TablePlus: MySQL, MariaDB, PostgreSQL, SQLite, Redis and Valkey, reached from Studio's server directly or through an SSH tunnel. Browse and edit rows, run SQL, change structures, import and export. Administrators and developers add connections; anybody reaches the ones shared with their role on a project. Like the SSH terminal, it asks for your password again.

studio.dev.agency.test/databases
The tools a studio lives inDatabases: MySQL, MariaDB, PostgreSQL, SQLite, Redis and Valkey, directly or through an SSH tunnel.
  • Databases: MySQL, MariaDB, PostgreSQL, SQLite, Redis and Valkey, directly or through an SSH tunnel.
  • Open one.
  • Rows with filters, pages and export; a double click changes a cell.
  • The SQL editor: one result per statement, saved queries and history.
  • SSH in the browser, with the server’s files over SFTP beside the terminal.
  • A password manager, shared on purpose: by project, by role, or with one person.
  • Backups in any direction, SSH or S3, on as many schedules as you like.
In motion. The databases, the SQL editor, SSH with its files, the password manager and the backups.
Tools → Databases: connections in coloured groups, favourites first, each with its engine, environment, tunnel and project
Every connection you reach. Yours and those shared with you, in groups of your own with their colours, favourites first; the environment tag on each (production in red).
  1. A connection. New connection: the engine, host and port, user and password (stored encrypted, never shown again), the database, TLS. Or paste a link as TablePlus writes it, or the DB_ / REDIS_ lines of a Laravel .env, and Fill in.
  2. Through SSH. Through an SSH tunnel picks one of the SSH page's connections (or the one a +ssh link brings, created when you save); the host is the database's address as that machine sees it, usually 127.0.0.1. Test shows a new host's key to accept first.
  3. Share it with a project: for each role, no access, can read or can read and write. Members use your database credentials without ever seeing them; Studio's administrators read and write every project connection.
The New connection dialog filled from a mariadb+ssh link: a new SSH connection for the tunnel, the database's host, user and database, production environment
From a link. mariadb+ssh://… fills the database and the SSH host of the tunnel; the SSH host becomes one of your SSH connections when you save.
LinkWhat it opens
mysql://user:password@host:3306/dbMySQL (mariadb:// MariaDB), directly
mariadb+ssh://ssh_user:ssh_pw@ssh_host/user:pw@127.0.0.1/dbMariaDB through an SSH tunnel; the SSH password may be left out to use one of your keys
postgres://user:pw@host/db?sslmode=requirePostgreSQL (postgresql://, pgsql://), with TLS
sqlite+ssh://deploy@web1/~/current/database/database.sqlitea SQLite file on an SSH host, with its own sqlite3 (3.33 or later); //var/… for an absolute path
redis://:pw@host:6379/0, rediss://, valkey+ssh://…Redis or Valkey, the database number at the end; rediss with TLS

Add ?name=Shop&env=production&tls=true to any of them. Passwords with / ? # : in them are percent-encoded (an @ works either way). A connection's menu copies its link, with the passwords only for its owner.

The SQL client: tables and views on the left, the orders table's rows with their types, filters, pages and export
Rows. Tables and views (rows and size where the engine knows them) on the left; a table's rows sorted by a click on a column, filtered (=, contains, in, is null, raw SQL…), paged by 50 to 1,000.
Edit in place
Double-click a cell, change it, Enter (or NULL). A row's menu edits it whole, duplicates or deletes it; tick rows to delete many. Rows are found again by their primary key, by ctid on PostgreSQL and rowid on SQLite when there is none.
Structure
Columns with type, null, default, key and comment; indexes; foreign keys and checks; the DDL to copy. New tables, columns and indexes, renames, drops and emptying are SQL shown first, to read and change before it runs.
SQL editor
Run the selection or everything (Ctrl/⌘+Enter): every statement gets its own result, rows (the first 1,000) or rows changed, with its time; an error says which statement. Your history and your saved queries on the side; a result's rows go to CSV or JSON in full.
Read only, production
Someone who may only read runs statements that read, inside a read-only transaction. A production connection opens locked: unlock it for the session to change anything, and every statement that writes asks first.
A cell of the orders table being edited in place, with NULL and Save
In place. Double-click, type, Enter.
The Structure tab: columns, indexes and foreign keys of the orders table
Structure. Columns, indexes, foreign keys; every change is SQL to review.
The New table dialog: columns with type, default, null, key and auto increment
A new table, written for the engine (AUTO_INCREMENT, identity, AUTOINCREMENT).
The SQL editor with two statements run, each with its result, saved queries and history on the side
SQL. One result per statement; saved queries and history.

Import & export#

Import & export: an SQL dump with structure, data, DROP and gzip; an import of a file; recent imports and exports with download and save to the drive
Import & export. Their log as they go; exports to download or save to your drive for a few days.
ExportImport
SQLthe whole database or some tables, structure and/or data, DROP before CREATE, gzip; with mariadb-dump/mysqldump, pg_dump or sqlite3 .dump when they are there (else Studio writes it: portable INSERTs)a .sql or .sql.gz run with mariadb, psql or the host's sqlite3 (else statement by statement), stopping at the first error or going on; up to STUDIO_DB_MAX_IMPORT_MB (512 MB), from your computer or your drive
CSV / JSONtables (a zip of files when there are several) or the rows of a queryrows into a table, columns matched by name, empty values as NULL, the table emptied first if you like
Rediskeys as JSON with their type, value and TTLthe same JSON, the keys that exist kept or replaced

Redis and Valkey#

The keys of a database page by page (SCAN, never KEYS) with a pattern and a type; each key's value by its type (strings with JSON formatting, hashes, lists, sets, sorted sets, streams) to change in place, its TTL, rename and delete; a console that speaks like redis-cli (FLUSHDB and the like ask first; MONITOR and SUBSCRIBE do not run); the server's INFO.

How the tunnels work#

For each SSH connection and credential Studio keeps one OpenSSH master connection open while it is used (fifteen minutes idle by default), and forwards each database to a Unix socket in a folder only Studio's user may enter, never to a port of 127.0.0.1 another process of the server (a workspace) could reach. Only a host whose key was accepted is reached. Whose SSH credential: yours (members reach that database through it, never a shell) or each person's own. Imports and exports run on a queue of their own, served by the studio-databases worker; the installer adds mariadb-client, postgresql-client and sqlite3. Every change made on a shared or production connection is written to Studio's log with who made it.

Read only means read only. Studio refuses statements that write and runs the others in a read-only transaction, but a function with side effects can slip through any client: for a guarantee, share a database user that may only SELECT.