5. SQL Editor and Tabs
5.1 Create / Close / Rename Tabs
- New tab: Click the + button at the far right of the tab bar.
- Close tab: Click the ✕ button on the tab. Depending on the tab type and whether there are unsaved changes, you are prompted to "save and close" or "discard changes and close".
- Rename: Double-click the tab title, or right-click and choose Rename.
- Close others: Right-click and choose Close Others to close all other tabs in the same workspace.
- Open in compare view: Right-click a Persist SQL tab and choose Open in compare view to open it read-only in a standalone Compare view (temp tabs are not supported). See §11.10.
- Reorder open tabs: When a workspace has more than 2 open tabs, you can drag a tab title on the tab bar, or drag up/down in the tab list from the list button (☰) on the left of the tab bar, to change the left-to-right display order. Both places always reflect the same order.
- Open tabs in the current workspace only: This reordering affects only the open tabs in the editor. It does not change the disk order of the sidebar Persist list, and it does not persist after an app restart (current session only).
Agent closing tabs: When the Agent "closes a tab" it only closes the editor tab—it does not delete the Persist tab from the sidebar workspace list; you can still reopen it from the sidebar.
Horizontal tab scrolling: When open tabs exceed the tab bar width, the tab bar supports horizontal scrolling:
- Moving the pointer over the tab bar reveals a very thin (2px) horizontal scrollbar hint.
- The mouse wheel scrolls the tab bar horizontally to quickly reach off-screen tabs.
- Trackpad horizontal swipe gestures keep their native behavior and are unaffected.
5.2 Temp Tabs vs. Persist Tabs
Lantide Data has two tab types:
| Type | Description | Marker |
|---|---|---|
| Temp tab | A newly created tab whose SQL is not yet saved to the server | No special marker |
| Persist tab | A saved tab; its SQL is stored in the workspace and survives an app restart | A p marker next to the tab title |
Temp tabs disappear once closed; Persist tabs appear in the sidebar workspace list and can be reopened anytime. After the Agent creates a Persist tab, the sidebar list updates immediately. The sidebar Persist list only contains persistent SQL tabs (not the markdown cache tabs produced by Agent materialization).
Unsaved edits show a * next to the tab title. Only manual user edits trigger *; when the Agent writes SQL or Markdown into a tab via tools, the content is already persisted to the workspace and does not show an unsaved marker.
5.3 Write and Run SQL
After writing SQL statements in the editor, you can run them in two ways:
- Run all: With no text selected, click Run or press the shortcut to execute all SQL in the editor.
- Run selection: Select part of the SQL first, then click Run or press the shortcut to run only the selection.
While a query is running, the same button becomes Running… (square icon). Click it again to send a custom interrupt and request the backend to abort the query. A successful abort is not treated as a normal SQL Query Error (and does not show a red error block); you can Run again at any time.
Tip: Lantide Data supports read-only queries only (
SELECT,DESCRIBE,SHOW,PRAGMA). Write operations such asINSERT,UPDATE,DELETE, andCREATEare not supported.
5.4 Save Tab
- Click Save in the toolbar, or press
Cmd + S(macOS) /Ctrl + S(Windows/Linux). - On the first save of a temp tab, a dialog prompts you for a Name (required), an optional Label, and an optional Project; after you confirm, the tab becomes a Persist tab.
- Saving a Persist tab directly updates the existing saved record (SQL content); edit the Name / Label / Project using the Metadata dialog instead (see §5.6).
Note: A tab name must not duplicate the name of a loaded data file, to avoid confusion when writing SQL.
5.5 Common Shortcuts
| Shortcut | Action |
|---|---|
Shift + Enter |
Run query |
Cmd/Ctrl + Enter |
Run query |
Cmd/Ctrl + S |
Save tab |
Cmd/Ctrl + / |
Toggle line comment |
[Image] Tab bar: showing a temp tab, a Persist tab (with the
pmarker), and the unsaved marker (*)
5.6 Persist Tab Metadata
Besides its SQL body, a persistent SQL tab can maintain the following metadata (used for sidebar identification, Agent list_sql_tab discovery, and filtering by project):
| Field | Description |
|---|---|
| Name | The tab's identifying name (shown in the tab bar and the sidebar's main row text; to rename, double-click the tab bar or right-click → Rename) |
| Label | Optional description (≤200 characters), e.g. a pipeline stage's purpose; returned when the Agent lists tabs |
| Project | Optional project association; when a project is focused and the Agent executes a Plan, it can list_sql_tab(project_id=…) to reuse an existing tab |
Where to edit:
- Tab bar: right-click a persistent SQL tab → Metadata
- Sidebar: right-click a tab in the workspace Persist list → Metadata
When you first save a temp tab as a Persist tab, the save dialog already includes the fields above. Tabs from older versions that were not associated with a project can still appear in the list; the Agent can list them together with include_unscoped=true when needed.