Skip to content
Keboola Docs

Use a workspace

Develop and test SQL against a copy of your data before it becomes a transformation, from the browser, your own IDE, or a terminal.

How-to Going further about 10 minutes

A transformation is SQL you have finished writing. A workspace is where you write it: your own schema, holding a copy of the Storage tables you ask for, where a wrong query costs you nothing.

Where you are: you have tables in Storage and a query you are not sure about. When you finish: the same query, tested against real rows, ready to paste into a transformation.

Before you start

You need

  • A Keboola project. No project yet? Get a project.
  • A table in Storage, such as staffing_outlook from Transform data if you are following the guide.

Depending on the tab you use

  • Prompt tab: Kai, the Kai Agent button in the project's top bar, on supported stacks. The first time, an organization admin switches it on; see Get started with Kai.
  • UI tab: only a browser.
  • CLI / API tab:

    kbagent, connected with an admin (master) token.

Three ways to do this, one page. They are alternatives, not steps. Prompt is what you paste into Kai; UI is the same task click by click, for when you want to see where each setting lives; CLI / API is the same task from a terminal, with the raw request beside it. Pick one tab and carry on; your choice follows you to the next page.

If a step builds something other than what this page describes, say so in the same chat; it edits what it made. Nothing here is one-way.

The Prompt tab reaches the tested query without a workspace at all, which is the honest shortest path; the other two build one. All three end with SQL you trust.

A workspace is a schema of your own in the project’s backend, with the tables you choose copied into it. SQL workspaces follow the backend the project runs on, Snowflake or BigQuery; Python and R workspaces give you a notebook against the same data.

Nothing you do in one reaches Storage. The copy is taken at the moment you load it and stays as it was until you load it again, so dropping a table or rewriting a query twenty times leaves production untouched. The workspaces reference covers the rest, including the Python and R flavours.

Most of the time you do not need a workspace. You want one because you want to try SQL against your data, and Kai does that without creating anything: open Kai Agent in the top bar and ask the question you would have written the query for.

Prompt
Using out.c-Boolabean-staffing-outlook.staffing_outlook, which café and which day has the highest
expected_units_per_person? Show me the SQL you ran.

Asking for the SQL matters. The answer is the thing you were developing, and it is what you paste into a transformation once it says what you meant.

Open a real workspace when the chat stops being the right tool:

  • you are iterating for an hour rather than asking two questions;
  • you want your own IDE or notebook against the data, not a chat window;
  • you need Python or R libraries that a transformation does not have yet.

Creating the workspace is then the UI or CLI / API tab’s job.

Check: the answer names a café and a day, and the SQL it shows runs on its own.

Coming from the Prompt tab? You have no workspace to check. Your answer arrived with the SQL that produced it, which is what the other two tabs spend a workspace getting to. You are done.

Your query returns rows, and the same query returns the same rows after a reload: the copy does not move under you. The workspace itself shows up in Workspaces, and from a terminal in kbagent workspace list --project docs-demo, with its ID, its backend, and whether it is read-only.

  • A name will not resolve, but the table is loaded. Case. Object '<NAME>' does not exist means an unquoted name was upper-cased and the stored one is not; invalid identifier "<name>" means you quoted a name that is stored in a different case. The table above shows both.
  • The workspace is empty after loading. Loading again replaces what was there rather than adding to it, in the UI’s Load Data and in workspace load alike. Pass --preserve when you meant to add a table.
  • You cannot find the password. Workspace credentials are shown once, when they are created, and are not readable back. Reissue them from the Connect dialog, or with kbagent workspace password.
  • Old workspaces you forgot about. They are all in Workspaces; from a terminal, kbagent workspace list --project docs-demo --orphaned finds the ones whose configuration is already gone, and kbagent workspace gc --dry-run says what it would clean up before it does anything.
  • Transform data is where the query you just tested belongs.
  • Workspaces covers the Python and R flavours, access for other users, and read-only access to all of Storage.
Ask Kai

Hi, I'm Kai — Keboola's AI assistant for the docs. Ask me anything and I'll answer from the documentation and cite the pages I use.

Kai is an AI and can make mistakes. Check the sources it links.