Docs / Using SayQL

Workspaces and groups

Updated

If you work with several companies or clients, a workspace keeps each one's databases apart, and a group keeps the databases of one project together. An AI app sees one workspace, or one group in it, and nothing else. Both are free, and work on your own computer.

Only one company? Nothing changes. Everything you've saved is in a workspace called Personal, and the rail only shows once you add a second workspace.

Workspaces

To add your first one, click New workspace at the top of the Database Navigator. After that, each workspace has a tile on the rail at the left edge of the window: click one to switch, or right-click it to rename or delete it.

  • A workspace shows its own connections, groups, saved scripts and tabs.
  • Switching doesn't stop anything. A query or Investigate run in another workspace keeps going, and its tab is there when you come back.
  • AI provider keys, skills, blocked apps and your preferences are shared by every workspace.
  • Deleting a workspace asks whether to move its connections to another one or delete them. Personal can't be deleted.

Groups

A group holds the databases that belong together, such as one client project. Click New group in the navigator, then right-click a connection and choose Move to…. To put just one database of a server in a group, right-click it and choose Move to group…. Deleting a group never deletes its connections.

What AI apps can see

An AI app sees one workspace, chosen when you set it up. An app set up without a workspace sees Personal only, so moving a connection out of Personal hides it from apps set up the old way. Add one entry per company in the app's MCP settings. Settings → AI apps → Access shows the command for each workspace and group:

claude mcp add sayql-acme -- sayql-mcp --workspace acme
claude mcp add sayql-portside -- sayql-mcp --workspace acme --group portside

You can also set SAYQL_WORKSPACE and SAYQL_GROUP in the app's environment. If the workspace or group doesn't exist, the server won't start, and says why.

  • Something outside the limit gets the same reply as something that doesn't exist, so an app can't tell it's there.
  • Inside the limit, each connection's own rules still apply: what AI apps may see, never-send columns, masking and read-only.
  • Audits you run from SayQL use the workspace of the connection being audited.

What this protects against. It limits what an AI app can reach through the SayQL entry you set up for it. It isn't a wall on your computer: software running as you, including an AI agent allowed to run shell commands, could start sayql-mcp with another workspace or read SayQL's files. For a hard boundary, give each company its own database login, or its own computer account.

A server shared with other companies

One server can hold several companies' databases. Save it once in each workspace. In the connection form, under Databases this workspace can use, choose Only the ones I pick and list them.

  • Only those databases show in the navigator, and AI apps get the same reply for any other as for one that doesn't exist.
  • Investigate, note checks and AI apps can't run a query that names another database, such as other.dbo.customers on SQL Server or other.customers on MySQL, or that reads the server's list of databases.
  • Queries you run yourself in the editor can still use whatever your login allows.

Only a separate login guarantees separation. With one login for several companies, the list stops mistakes and well-behaved AI apps, but not everything: on SQL Server, a view or synonym in an allowed database can point at another one, and SayQL can't see that from the query. For real separation, give each company its own database login, with access to its databases only. Then the database itself refuses the rest.

Teams

Your team's connections appear in one workspace, Personal unless you choose another under Settings → Team, and you can put them in your own groups. That only organises them on your computer. Agents on a team server use their own keys and the rules your admin sets.

Something missing or unclear? Ask in Discussions.