> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sevalla.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Database Studio

> Use the integrated Database Studio to run queries and manage your database.

With the Database Studio, you can manage your MySQL, MariaDB, and PostgreSQL databases right from the Sevalla UI. It allows you to run queries, view data, and more without having to use an external tool or download your database.

To access the Database Studio, go to your database and click **Studio**.

<Frame caption="Access the Database Studio.">
  <img className="block dark:hidden" src="https://mintcdn.com/sevalla/r62AEJ57ir2_H543/images/database-studio-light.png?fit=max&auto=format&n=r62AEJ57ir2_H543&q=85&s=b1df7d079be876a5c3e785dabea2ae68" alt="Access the Database Studio" width="3592" height="836" data-path="images/database-studio-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/sevalla/r62AEJ57ir2_H543/images/database-studio-dark.png?fit=max&auto=format&n=r62AEJ57ir2_H543&q=85&s=a8e1c518d66f253465bc7e5431d81a4c" alt="Access the Database Studio" width="3586" height="840" data-path="images/database-studio-dark.png" />
</Frame>

## Sort your data

Within the Database Studio, you can sort the columns by using the arrows at the top of each column; you can also choose which columns you want to show using the **Columns** option. You can use **Filters** to show specific data, and you can apply more than one filter at a time. When a filter is applied, it shows an exclamation mark on the **Filters** option.

<Frame caption="Apply filters to your database to show specific data.">
  <img className="block dark:hidden" src="https://mintcdn.com/sevalla/SmxtuQa39gZkt5q5/images/database-studio-filter-light.png?fit=max&auto=format&n=SmxtuQa39gZkt5q5&q=85&s=de784aba60c6121233384ba5d5532a28" alt="Apply filters to your database to show specific data" width="2290" height="490" data-path="images/database-studio-filter-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/sevalla/SmxtuQa39gZkt5q5/images/database-studio-filter-dark.png?fit=max&auto=format&n=SmxtuQa39gZkt5q5&q=85&s=c176a398f6a4396dc414cf01eb9a950c" alt="Apply filters to your database to show specific data" width="2298" height="498" data-path="images/database-studio-filter-dark.png" />
</Frame>

To open and edit the filter within the [SQL console](#sql-console), click **Open in SQL**.

<Frame caption="Database studio SQL editor.">
  <img className="block dark:hidden" src="https://mintcdn.com/sevalla/Jux_WOUQ8HU0TATP/images/database-studio-sql-filter-light.png?fit=max&auto=format&n=Jux_WOUQ8HU0TATP&q=85&s=1d38b5c6617cc83e3b7db4100f23e117" alt="Database studio SQL editor" width="2560" height="500" data-path="images/database-studio-sql-filter-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/sevalla/Jux_WOUQ8HU0TATP/images/database-studio-sql-filter-dark.png?fit=max&auto=format&n=Jux_WOUQ8HU0TATP&q=85&s=4c6d310f52723d11ee82fc91e79efd3a" alt="Database studio SQL editor" width="2566" height="498" data-path="images/database-studio-sql-filter-dark.png" />
</Frame>

You can create customized views of your database for easier access to the data you need. Click the plus icon, then select **Create View**. From there, you can give your view a name, choose the tables and columns to display, and apply any necessary conditions.

<Frame caption="Create a new view for your database.">
  <img className="block dark:hidden" src="https://mintcdn.com/sevalla/SmxtuQa39gZkt5q5/images/database-studio-create-view-light.png?fit=max&auto=format&n=SmxtuQa39gZkt5q5&q=85&s=0bee1a20c24e6eb8730021761373c55e" alt="Create a new view for your database" width="2560" height="1020" data-path="images/database-studio-create-view-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/sevalla/SmxtuQa39gZkt5q5/images/database-studio-create-view-dark.png?fit=max&auto=format&n=SmxtuQa39gZkt5q5&q=85&s=4e7937f427bb95d6e821f1086857c33f" alt="Create a new view for your database" width="2576" height="1018" data-path="images/database-studio-create-view-dark.png" />
</Frame>

To open and edit the view within the [SQL console](#sql-console), click **Open in SQL console**.

## Export your database

Within the Database studio, you can export your entire database or just selected data to a `.json`, `.csv`, or `.xlsx` file. To export your data, click the ellipsis (three dots) and choose the file type you want to export to.

<Frame caption="Export your database.">
  <img className="block dark:hidden" src="https://mintcdn.com/sevalla/SmxtuQa39gZkt5q5/images/database-studio-export-light.png?fit=max&auto=format&n=SmxtuQa39gZkt5q5&q=85&s=d94d57a0405ec36eebb29871dba13fa4" alt="Export your database" width="2572" height="662" data-path="images/database-studio-export-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/sevalla/SmxtuQa39gZkt5q5/images/database-studio-export-dark.png?fit=max&auto=format&n=SmxtuQa39gZkt5q5&q=85&s=be0654663b9995d973831c50fa5f1040" alt="Export your database" width="2578" height="676" data-path="images/database-studio-export-dark.png" />
</Frame>

## SQL console

Within the Database studio, you can access an SQL console where you can run SQL queries on your database. The SQL editor lets you view the **Database Schema**, **Prettify** the code for better readability, and **Run** the SQL directly in the console. When you run the SQL query, you can choose to show the results as a table or as JSON, and export the results to a `.json`, `.csv`, or `.xlsx` file. You can also store these queries as snippets and create folders to organize the snippets.

<Frame caption="Database studio SQL console.">
  <img className="block dark:hidden" src="https://mintcdn.com/sevalla/Jux_WOUQ8HU0TATP/images/database-studio-sql-console-light.png?fit=max&auto=format&n=Jux_WOUQ8HU0TATP&q=85&s=76c84554f406216af1ab57bae5385021" alt="Database studio SQL console" width="2558" height="1086" data-path="images/database-studio-sql-console-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/sevalla/Jux_WOUQ8HU0TATP/images/database-studio-sql-console-dark.png?fit=max&auto=format&n=Jux_WOUQ8HU0TATP&q=85&s=e228c8f637333fc7ec8196bf2c6d80b4" alt="Database studio SQL console" width="2564" height="1090" data-path="images/database-studio-sql-console-dark.png" />
</Frame>

## Add a record

To add a record to your database, click **Add record**, enter the required data into the table, and click **Save x change(s)**.

<Frame caption="Add a record to your database table.">
  <img className="block dark:hidden" src="https://mintcdn.com/sevalla/SmxtuQa39gZkt5q5/images/database-studio-add-record-light.png?fit=max&auto=format&n=SmxtuQa39gZkt5q5&q=85&s=269281af9d3a69d1e2e51041e3e9276e" alt="Add a record to your database table" width="2566" height="522" data-path="images/database-studio-add-record-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/sevalla/SmxtuQa39gZkt5q5/images/database-studio-add-record-dark.png?fit=max&auto=format&n=SmxtuQa39gZkt5q5&q=85&s=3339e1a5a1afcc11358b805ba4fbdb24" alt="Add a record to your database table" width="2570" height="526" data-path="images/database-studio-add-record-dark.png" />
</Frame>

## Add a table

To add another table to your database, click the plus icon and then **Create Table**. You can then name the table and define its columns, specifying the data type, constraints, default values, and expressions for any generated data. Additionally, you can add table-level constraints and indexes as needed.

<Frame caption="Add a new table to your database.">
  <img className="block dark:hidden" src="https://mintcdn.com/sevalla/SmxtuQa39gZkt5q5/images/database-studio-add-table-light.png?fit=max&auto=format&n=SmxtuQa39gZkt5q5&q=85&s=a8f86291eecaa90ca72151c5d231e2dd" alt="Add a new table to your database table" width="2562" height="1034" data-path="images/database-studio-add-table-light.png" />

  <img className="hidden dark:block" src="https://mintcdn.com/sevalla/SmxtuQa39gZkt5q5/images/database-studio-add-table-dark.png?fit=max&auto=format&n=SmxtuQa39gZkt5q5&q=85&s=135d4fc8646b0c258363c7f34ccd319c" alt="Add a new table to your database table" width="2574" height="1018" data-path="images/database-studio-add-table-dark.png" />
</Frame>

Once you've added the required columns, click **Review and create**. This will show you the SQL for the new table. If it looks correct, click **Create table**.

## Settings

The following settings are available within the Database studio:

* **Table rows count:** Displays the total number of rows in each table. This action performs a light scan of the table, which may slow down performance and increase billing costs, particularly for large tables or databases with many rows.
* **Expand subviews:** If a table contains a foreign key to another table, you can open the related data in a subview. This option keeps subviews open, allowing you to easily explore related records without navigating away.
* **Pagination type:** Choose how you want to view the results, **Limit offset** allows you to determine how many rows are shown per page, **Pages** shows the rows in batches of 50.
* **Flat schemas:** PostgreSQL only. Shows the database tables without grouping them by the schema.
* **Show bytea as:** PostgreSQL only. Choose to show the bytea data type as HEX or UTF8.
* **Editor keybindings:** Choose which keybinding profile you want to use for your keyboard shortcuts from VS Code, Vim, or Emacs.

## Report a bug

If you encounter an issue while using the Database studio, click Report a bug, you can then download the error context and report it to our [Support Team](/support/contact-support).
