Databases
The Databases page (/studio/db) lists every database you own or that is shared with you.
Add a database
The Add Database form at the top takes a Name and a Type:
| Type | Meaning |
|---|---|
| Memory | Memory only, basically a cache. The data is lost when the server stops, unless it has a backup: then it starts from the backup. The default. |
| Mapped | Memory mapped file: reads from memory, changes are written to the disk. |
| File | File only: reads and writes go to the disk, no memory caching. Uses the least memory. |
See storage for the details of each type. A new database is always owned by the user who adds it. You can change the type later with Convert.
The refresh button next to the form reloads the list.
The database table
| Column | Meaning |
|---|---|
| Role | Your role on the database: admin, write or read |
| Owner | The user who owns the database |
| Name | The name of the database |
| Type | memory, file or mapped |
| Size | Size of the database in bytes |
| Backup | Date and time of the last backup, or N/A |
Click a column header to sort by it: ascending, descending, then back to unsorted. Click a row (or press Enter on it) to open the query page of that database. The chevron at the end of the row opens the users of the database.
The Export menu above the table downloads the rows as CSV or JSON, or prints them (see Export and print).
Database actions
The actions menu of a row shows only the actions your role allows. The ones that delete or overwrite data, including Backup, are at the bottom, below a line. Most of them ask you to confirm first.
| Action | Who can use it | What it does |
|---|---|---|
| Audit | any role | Shows the audit log of the database: when, who and which query changed it. |
| Backup | admin role | Backs up the database. An existing backup is replaced. |
| Clear → All, Db only, Audit only, Backup only | admin role | Empties the database, its audit log, its backup, or all of them. |
| Convert → Memory, File, Mapped | admin role | Changes the type of the database. |
| Copy | any role | Copies the database under a new Name. The copy is yours. |
| Optimize | write or admin role | Packs the database file, reclaiming unused space. |
| Rename | owner | Gives the database a new Name. |
| Rollback | admin role | Swaps the database with its backup: the backup becomes the database and the database becomes the backup (Memory databases keep the backup). |
| Restore | admin role | Replaces the database with its backup and keeps the backup. |
| Remove | owner | Disconnects the database from the server. The files stay on the disk. |
| Delete | owner | Deletes the database and its files permanently. You have to type the database name to confirm. |
Share a database
Open the users panel with the chevron at the end of the row. It lists the users of the database grouped by role, with a Filter users... box. Large groups show the first 10 users and a +N more link.
| Role | The user can |
|---|---|
| Admin | read, change, back up, convert and clear the database, and add and remove its users |
| Read/Write | read and change the data, optimize the database |
| Read Only | read the data, see the audit log, copy the database |
Users with the admin role can:
- add a user with the + button: a Username and a Role,
- change a user's role by clicking the username,
- remove a user with the remove button next to the name.
The owner always has the admin role and cannot be changed or removed. A shared database shows up on the other user's Databases page with their role in the Role column.
The server admin sees and manages every database of the server on the admin pages.