SQL, explorer and exports
Each instance has a SQL editor and a table explorer in the Dashboard, so you can look at your data without installing a client or adding your IP to the allowlist. The Backups & exports page takes downloadable copies of a database and restores files into one. The instance must be running for all three.
SQL editor
The SQL editor needs the Database query permission. Pick a database (PostgreSQL and MySQL), write one or more statements and run them with Run or ⌘/Ctrl+Enter. Statements run in order and execution stops at the first one that fails; each statement gets its own result tab, which you can download as CSV.
- Read-only by default. The editor opens in read-only mode every time, and queries run in a read-only transaction. Switch Read-only off to change data; writes apply immediately and there are no backups.
- Destructive statements are confirmed. In write mode, Hubfly space asks before it runs
DROP,TRUNCATE,ALTER … DROP, or anUPDATEorDELETEwithout aWHEREclause. - Limits. A query can be up to 100 KB of SQL. Each result returns up to 500 rows by default (choose 100, 1000 or 5000), and up to 2 MiB of data; larger results are marked as truncated. Statements time out after 30 seconds by default and at most 60 seconds.
- Rate limit. Each person can send up to 120 console requests a minute (SQL runs and row edits together).
- Query history is kept in your browser only, per instance. Hubfly space's audit trail records that a query ran (read-only or write, statement count, duration), never its text or results.
The same editor is available from the terminal. hubfly db query is read-only unless you pass --write, and exits with a non-zero status when a statement fails:
hubfly db query app-db 'select id, email from users order by id desc limit 20'
hubfly db query app-db --database analytics --file report.sql --format csv > report.csv
hubfly db query app-db --write "update users set plan = 'pro' where id = 42"
cat migration.sql | hubfly db query app-db --write --timeout 60sTo run a full interactive client instead, use hubfly db connect (your local psql or mysql) or hubfly db shell (a client that runs on Hubfly space). See connect commands.
Table explorer
The table explorer lists the schemas, tables and views in a database. Open a table to page through its rows, sort by a column and filter rows (equals, not equals, greater or less than, LIKE, ILIKE, is null, is not null).
- Browsing and editing need the Database query permission.
- Editing rows (insert, update, delete) works only on tables with a primary key. Tables without one, and views, are read-only here; change them with the SQL editor.
- Each edit identifies rows by their primary key and must match exactly one row, otherwise nothing changes. Edits apply immediately, and deleted rows cannot be recovered.
- On SQLite (libSQL) the explorer shows the single
mainschema.
Exports
An export is a consistent snapshot of one database that you can download, move or restore elsewhere. The database stays available while the export runs. Creating exports and imports needs the Database admin permission.
| Engine | Formats | What you get |
|---|---|---|
| PostgreSQL | native or sql | native is a pg_dump custom-format archive, the fastest to restore; sql is a plain SQL script. |
| MySQL | sql | A gzip-compressed mysqldump of one database, including routines, triggers and events. It has no CREATE DATABASE, so you can import it into any database. |
| SQLite (libSQL) | sql | A gzip-compressed SQL dump of the database. |
- Exports appear in the list as Queued, In progress, Ready, Failed or Expired.
- A ready export can be downloaded for 7 days, then it expires.
- Export files are limited to 5 GB.
- Deleting an instance does not delete its exports: they stay downloadable until they expire. The delete dialog offers to start an export first.
hubfly db export app-db --format native --output app-db.dump # waits, then downloads
hubfly db export orders --database shop --output shop.sql.gz
hubfly db export app-db --no-wait # prints the export id
hubfly db exports app-db
hubfly db exports download app-db <exportId> --output app-db.dumpImports
An import uploads a file of up to 5 GB and restores it into a database: .sql or .sql.gz files, and for PostgreSQL also native dumps. Imports run against the live database: statements in the file apply immediately and cannot be undone. Import into an empty database when you can, and export first if the target already has data.
| Engine and format | How it is applied |
|---|---|
PostgreSQL native | Restored with pg_restore. Objects are owned by the admin user rather than the owners in the file. Errors on individual objects do not stop the restore; the result reports how many were ignored. |
PostgreSQL sql | Run with psql, stopping at the first error. Statements before the error stay applied unless the file wraps them in its own transaction. |
MySQL sql | Run with the mysql client, stopping at the first error. MySQL schema changes are not transactional, so statements before the error stay applied. DEFINER clauses are removed and the views, routines, triggers and events are owned by the admin user. Statements that need other privileges, such as creating accounts, setting global variables or writing to other databases, fail the import. |
SQLite (libSQL) sql | A SQL text file, optionally gzip-compressed; a raw SQLite database file is not accepted. A dump exported from Hubfly space is imported entirely or not at all. Importing into a database that already has rows with the same keys fails. |
hubfly db import staging-db app-db.dump --format native # asks you to confirm
hubfly db import notes notes.sql.gz --yesAutomatic backups
Automatic backups: coming soon