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

# Manage SQL Scripts

`Sheet` is the medium for you to interact inside SQL Editor. Sheet is the entity where you store,
run and share the SQL scripts with your teammates.

## Save sheet

Click **Save** on the upper right of the Editor or use the shortcut key `(⌘ + S)` to save
your SQL queries for later reference. SQL Editor will also automatically record SQL queries which
have run successfully.

<img src="https://mintcdn.com/dbx/oPldGQC4HFcCc-EY/content/docs/sql-editor/manage-sql-scripts/sheet-gutter.webp?fit=max&auto=format&n=oPldGQC4HFcCc-EY&q=85&s=69888faeb6fee4b1605df875f8c33596" alt="sheet" width="1179" height="729" data-path="content/docs/sql-editor/manage-sql-scripts/sheet-gutter.webp" />

## Query history

SQL Editor automatically records SQL queries which have run successfully. You can find them in
the **History** panel on the left, where you can search past queries by statement.

<img src="https://mintcdn.com/dbx/oPldGQC4HFcCc-EY/content/docs/sql-editor/manage-sql-scripts/history-gutter.webp?fit=max&auto=format&n=oPldGQC4HFcCc-EY&q=85&s=9c1a3984229bc5c731742f91bea690c8" alt="history" width="1336" height="681" data-path="content/docs/sql-editor/manage-sql-scripts/history-gutter.webp" />

Each history item has a **Copy history link** button that copies a direct URL to the clipboard.
Opening that URL reopens the item's exact statement and its database connection in a new SQL Editor tab.

<Info>
  Query history is private to the user who ran the query, so a history link only resolves for the creator.
  If the original database has since been deleted or is no longer accessible, the statement still opens,
  but you need to pick a database connection manually.
</Info>

## Configure sheet access

You can configure the sheet with one of the following access levels:

* `Private` - Only you can access this sheet
* `Project` - Both sheet OWNER and project OWNER can read/write, and project DEVELOPER can read
* `Public` - Sheet OWNER can read/write, and all others can read

<img src="https://mintcdn.com/dbx/oPldGQC4HFcCc-EY/content/docs/sql-editor/manage-sql-scripts/share-link-access.webp?fit=max&auto=format&n=oPldGQC4HFcCc-EY&q=85&s=7e16b8d3be7413420b73c4b9808cc0f2" alt="Configure access" width="1177" height="498" data-path="content/docs/sql-editor/manage-sql-scripts/share-link-access.webp" />

To share a sheet, click **Copy** button to copy the sharing link to the clipboard.

<img src="https://mintcdn.com/dbx/oPldGQC4HFcCc-EY/content/docs/sql-editor/manage-sql-scripts/share-popover.webp?fit=max&auto=format&n=oPldGQC4HFcCc-EY&q=85&s=fdf328f27f59124c4e41a137ddd334d4" alt="Copy the share link" width="1175" height="480" data-path="content/docs/sql-editor/manage-sql-scripts/share-popover.webp" />

## Manage sheet

You can manage sheets in the **Sheets** panel on the top left side of the page. You can find all
created sheets, sheets others shared with you and star sheets.

<img src="https://mintcdn.com/dbx/oPldGQC4HFcCc-EY/content/docs/sql-editor/manage-sql-scripts/sheet-panel.webp?fit=max&auto=format&n=oPldGQC4HFcCc-EY&q=85&s=e4a30529de2cb521375b78ced86189ff" alt="Sheets" width="1211" height="726" data-path="content/docs/sql-editor/manage-sql-scripts/sheet-panel.webp" />
