Workspaces

Overview

Workspaces provides a unified editor for creating, organizing, and managing code across multiple file types that you can use to analyze data, develop models, and build pipelines.

A workspace is private to you and offers a development environment where you can build, experiment, and test your work. All content in Workspaces is file-based, allowing you to work on more complex projects and easily integrate with Git for version control, collaboration, and alignment with your existing workflows.

The Workspaces environment

Workspaces is a new editor composed of six sections, or panes:

Overview of the Workspaces environment.
  1. Workspaces: One area for all your files and folders. Drag files to move them between folders. Use nested folders to group related worksheets under logical categories so that you can quickly find specific worksheets without searching through a flat list. Each user has a default workspace named “My Workspace” that is automatically provisioned by Snowflake. You can also create a new workspace by selecting + Add New in the Workspaces menu. The default workspace cannot be deleted or renamed.

  2. Worksheets: Open and edit worksheets you own or have any permissions on. Note that edits will not be saved if you only have edit permissions on the worksheet. To convert a worksheet into a file in a workspace, drag it to a folder inside the workspace. Workspace queries are run similarly to worksheets with a few small differences, including improved UI performance and the ability to run two queries simultaneously from the same SQL file.

  3. Object Explorer: A hierarchical view of all databases in your account, the schemas for each database, and other objects, organized by type. Use the filter to search for objects. You can also filter out unusable objects to simplify your view by selecting Show databases I can query. The options available in the vertical ellipsis More actions for worksheet (more actions) button vary by object type, but include features such as placing names in the editor, copying names, and viewing definitions.

  4. Editor: Edit queries and split them side by side to view multiple files simultaneously. Use inline Copilot to get suggestions and completions directly within the editor workspace.

  5. Results: Split results side-by-side or pin them for easy comparison.

  6. Query History: View the history of all queries you’ve run. Current File shows historical queries from the file currently open and selected in the editor. Filter to the current file or across all files. All Files displays all historical queries you have run across all files.

Create and work with files and folders

In a workspace you can use a familiar IDE and source control conventions to author, organize, and run code.

  1. Sign in to Snowsight.

  2. In the navigation menu, select Projects » Workspaces.

  3. Select the + next to the appropriate folder. If you’re using Workspaces for the first time, select + Add New.

  4. Select from the following options to create a new file or folder or upload an existing file or folder:

    • SQL File: Creates a new, blank SQL file in the editor as a tab in the editor. By default, .sql is appended to unnamed files. The editor recognizes it as a SQL file and enables syntax highlighting and autocomplete.

    • File: Creates a new file. Name the file and its extension. If the extension is recognized by the editor (for example, Java, JavaScript, or Scala), code highlighting and autocomplete are enabled.

    • Folder: Creates a new, empty folder inside the workspace.

    • Upload Files: Upload one or more files to any location in your workspace. The editor uses the file extension and applies the appropriate icon, behavior, and syntax highlighting to the file when it’s opened. For example, .sql files show SQL-specific features.

    • Upload Folder: Select one or more files or folders to add to the selected workspace.

Manage files

You can rename, delete, move, and organize your workspaces, files, and folders.

To rename or delete a workspace, file, or folder:

  1. Hover over the target and select the vertical ellipsis More actions for worksheet (more actions).

  2. Select Rename or Delete. If you choose to delete, you are prompted to confirm.

  • To create a folder in a workspace, select the + next to the workspace or an existing folder.

  • To organize files and folders, drag any file or folder into a different location in the same workspace. You can also drag a worksheet into a workspace.

View multiple files or results in one layout

Managing multiple files with tabs and split panes offers several advantages:

  • Compare code or results side by side: Quickly reference one worksheet query while working on another.

  • Multitask more efficiently: View different cells, outputs, or files at once with less switching.

To adjust your Workspaces layout, select the vertical ellipsis More actions for worksheet (more actions) in the Workspaces pane and choose the appropriate option:

  1. Split right

  2. Split down

  3. Close others

Integrate with a Git repository

Workspaces can be local to Snowflake, or you can sync workspaces in development with a branch in a Git repository. In Workspaces, you can:

Create a Git workspace

You can create a workspace connected to a Git repository to develop and manage files directly in Snowsight.

To create a new Git-synced workspace:

  1. Sign in to Snowsight.

  2. In the navigation menu, select Projects » Workspaces.

  3. In the Workspaces menu, select From Git repository.

  4. Copy the URL from your Git repository (for example, https://www.github.com/my-user/my-repo-name), and then paste it into the Repository URL field.

  5. Optional: Rename the new Git-synced workspace.

  6. In the API Integration menu, select an API integration.

    API integrations are created by the account administrator and must allow access to the Git repository URL you are using in step 4. For details, see Create an API integration for interacting with the repository API.

    In addition, if you’re using GitHub as your Git provider and prefer OAuth for authentication, the account administrator must create an API integration that supports OAuth. For example:

    CREATE OR REPLACE API INTEGRATION api_integration_name
       API_PROVIDER = git_https_api
       API_ALLOWED_PREFIXES = ('https://github.com/')
       API_USER_AUTHENTICATION = (
          TYPE = snowflake_github_app
       )
       ENABLED = TRUE;
    
    Copy
  7. Under API integration, select an authentication method:

    • OAuth2 - Select Sign in to authenticate with your GitHub repository. After signing in, you won’t need to provide credentials in future sessions. Note that OAuth2 is not available for PrivateLink environments.

    • Personal access token - Select the database and schema where the object containing your token is stored. To create a new secret, select + Secret and enter the required details. The API integration must be configured to allow access to this secret or to all secrets.

    • Public repository - Select this option if you are using a public repository that doesn’t require authentication. Note that it isn’t possible to commit and push any changes from your workspace to this public repository.

  8. Select Create.

Update author details and credentials for a branch

By default, your Snowflake email and username are used for committing changes to your Git repository. You can update these at any time.

  1. Sign in to Snowsight.

  2. In the navigation menu, select Projects » Workspaces.

  3. Select the Changes tab.

  4. Select the ellipsis and then select Edit credentials.

  5. Specify an author name and email.

  6. Select Update.

Create a new branch

You can create a new branch from your current branch to work on changes independently.

  1. Sign in to Snowsight.

  2. In the navigation menu, select Projects » Workspaces.

  3. Select the Changes tab.

  4. Select the repository dropdown.

  5. Select + New.

  6. Specify a new branch name, and then select Create.

Switch to a different branch

If you have saved but uncommitted changes, you’ll need to choose how to handle them before switching branches.

  1. Sign in to Snowsight.

  2. In the navigation menu, select Projects » Workspaces.

  3. In the Git workspace view, select Changes.

  4. From the branch menu, select the branch you want to switch to.

    Tip: To filter the list, start typing a branch name.

Fetch remote branches

If a new branch was created outside of Snowsight (for example, one created in your Git provider), you can fetch it into your Git-synced workspace using the Fetch All option. This updates your list of available remote branches.

  1. Sign in to Snowsight.

  2. In the navigation menu, select Projects » Workspaces.

  3. In the Git workspace view, select Changes.

  4. Select the down arrow next to the Pull menu, and then select Fetch All. When the fetch finishes, newly created remote branches appear in the branch list and are available to check out.

View updated files

To view all the files that were added, deleted, or modified since your last successful commit and push:

  1. Sign in to Snowsight.

  2. In the navigation menu, select Projects » Workspaces.

  3. At the top of the folder view, select Changes. Modified files are indicated with an M, added files are indicated with an A, and deleted files are indicated with a D.

  4. To view a visual diff of the changes in the editor, select a file.

Commit and push updates

After reviewing your changes, you can commit and push them to your remote Git repository from within the workspace.

To commit and push your updated files to the remote Git repository:

  1. Sign in to Snowsight.

  2. In the navigation menu, select Projects » Workspaces.

  3. Select Changes at the top of the folder view.

  4. Write a commit message in the Commit message field.

  5. Select Push.

  6. Write a commit message and select Push to push your updates to the Git repository.

    Note

    If conflicts are detected, you are prompted to pull first. Select Pull to review a list of files with conflicts.

View and resolve conflicts

If a conflict occurs during a push, you can view and resolve it directly in the workspace before committing again.

  1. In Workspaces, at the top of the folder view, select Changes. If one or more files have a conflict, a message is displayed at the top of the view. Files with a conflict are indicated with a red M.

  2. To view a visual diff of the conflict in the editor, select a file. Under File with conflicts, differences are highlighted inline.

  3. Accept the current change, an incoming change, or both changes. The result of the merge is shown.

  4. Under Diff View you can view the current and remote versions side by side.

  5. Select Accept all current or Accept all remote.

  6. After you resolve the conflicts, select Push.

  7. Write a commit message.

  8. Select Push.

Keyboard shortcuts

Worksheets provide keyboard shortcuts to help you quickly navigate, customize your view, and edit queries. The following table identifies commonly used keyboard shortcuts:

Task

MacOS shortcut

Windows shortcut

Run selected

CMD + Return

CTRL + Enter

Run all

CMD + Shift + Return

CTRL + Alt + Enter

Split pane horizontally

CTRL + \

CTRL + \

Split pane vertically

CTRL + Shift + \

CTRL + Shift + \

Managing Workspaces

  • To disable Workspaces, set the ENABLE_PERSONAL_DATABASE account-level parameter to FALSE:

ALTER ACCOUNT SET ENABLE_PERSONAL_DATABASE = FALSE;
Copy

This parameter requires ACCOUNTADMIN privileges. After you set it to FALSE, Workspaces will not be functional; however, Workspaces will still be listed in the Snowsight navigation menu.

Secondary roles don’t need to be enabled for Workspaces, but if you have session policies explicitly blocking secondary roles, a current limitation will prevent Workspaces from functioning until the session policy is removed.

Considerations

When a user accesses Workspaces for the first time, Snowflake automatically creates an internal, user-specific database (formerly called a Personal Database). This database is used exclusively to store workspaces and cannot contain standard objects such as tables or views. It does not grant the user any additional capabilities or privileges beyond enabling Workspace functionality.

Administrators may notice that users appear to have OWNERSHIP, USAGE, and CREATE SCHEMA privileges on this database. These privileges are required for interacting with Workspaces and do not affect access to other resources.

Limitations

  • Workspaces do not support sharing.

  • Query filters are not supported. Any queries containing filters will fail.

  • Workspaces files are not included in Universal Search results.

  • Opening and editing the same worksheet in the new Workspaces UI and old Worksheets UI simultaneously can result in lost changes.

  • For worksheets, execution context settings (role, warehouse, and namespace) are not synchronized across the new Workspaces UI and the old Worksheets UI.