This document describes the complete workflow of the SQL Coder web interface: model service configuration, database connection configuration, semantic file generation, workspace creation, conversational interaction, SQL validation, and keyboard shortcuts. All screenshots are taken from a running instance with the interface set to English; the Chinese edition is web-interface-guide.zh-CN.md.
A data subject in the interface corresponds to one source_id under databases in the runtime configuration. A workspace is bound to exactly one data subject at creation time and does not switch databases afterwards. The semantic file is the sole description of the schema available to the model, and its semantic_model.name must equal that source_id; when the file is produced through the interface, the value is written automatically and requires no manual editing.
The interface requires:
- Python dependencies and Node.js 18 or later installed locally;
- a running local bridge process; no configuration file has to be prepared — the first start writes an empty skeleton, and the model, connections, semantic files and memory switch are set in the interface;
- the frontend served either by the bridge (after a build) or by the development server.
Startup commands and the two deployment modes are documented in the Web interface section of the README. The rest of this document assumes the interface is open in a browser.
The model service is the first card on the Settings page, reachable from the left navigation rail.
The card has four elements: Provider, Model, Base URL (custom providers only) and API Key. Test and Save in the upper-right corner verify endpoint availability and persist the configuration, respectively.
Provider is a drop-down whose values are the English vendor names; the selection determines the default endpoint and the candidate models. The supported values are:
| Value | Displayed as | Default base URL |
|---|---|---|
deepseek |
DeepSeek | https://api.deepseek.com |
openai |
OpenAI | https://api.openai.com/v1 |
qwen |
Qwen | https://dashscope.aliyuncs.com/compatible-mode/v1 |
kimi |
Kimi | https://api.moonshot.cn/v1 |
glm |
GLM | https://open.bigmodel.cn/api/paas/v4 |
doubao |
Doubao | https://ark.cn-beijing.volces.com/api/v3 |
minimax |
MiniMax | https://api.minimaxi.com/v1 |
hunyuan |
Hunyuan | https://api.hunyuan.cloud.tencent.com/v1 |
xiaomi |
Xiaomi MiMo | https://api.xiaomimimo.com/v1 |
generic |
Custom (OpenAI-compatible) | supplied by the user |
For a preset provider the base URL is fixed by the preset and applied in the background, so the field is not displayed. For generic, the card adds a Base URL row, which must not be empty. When the provider is switched, the model field falls back to the first candidate of the new provider if the current model does not belong to that provider's candidate set; generic has no candidate set, so a typed model name is preserved.
Model is an editable drop-down rather than a closed list: the options list the provider's common models, and a new model name can be typed directly, so releases newer than the interface remain usable. API Key is a password field; a stored key is shown only by its last four characters (for example ••••6882). Submitting the form with this field empty keeps the stored key instead of clearing it.
Validate the configuration in two steps:
- Select Test. On success the card shows
Connected · {latency}ms; on failure a dialog reports the error code and the original message. - Select Save. The
llmsection of the runtime configuration file loaded by the bridge is rewritten; the key is stored in that file in clear text, and the interface subsequently returns only its last four characters.
Changes take effect for subsequent requests and do not alter SQL versions that have already been committed.
The second card on the Settings page, Database connections, lists every configured connection.
Each row has three parts: the connection identifier with database details (dialect, host and port, database name); the semantic file summary (file name, table count, generation time); and row actions (Edit, Delete). When no semantic file exists, the second line reads No semantic file.
Select Add connection in the card header and fill in the dialog.
| Field | Meaning | Notes |
|---|---|---|
| Name | source_id |
Unique identifier of the connection and the data-subject identifier in workspaces; immutable after creation |
| Type | SQL dialect | MySQL in the current release |
| Host and port | Endpoint | An empty port lets the driver apply its default |
| Database | Database name | Must match a database visible to the account |
| User / Password | Credentials | The password is masked; only a placeholder is echoed on later edits |
The dialog provides three actions. Test verifies connectivity and credentials without writing the configuration. Cancel discards the edit. Save & generate semantic file writes the connection and immediately starts semantic file generation (Section 3).
Edit opens the same dialog with the name read-only. If the dialect, host, port, database or user changes, saving regenerates the semantic file; when only fields that cannot affect the schema (for example the password) change, the existing file is reused.
Delete requires confirmation. If any workspace still references the connection, its data is retained and the connection is marked disabled instead of removed: it disappears from the data-subject candidates for new workspaces, while existing workspaces remain usable. The interface reports Still used by {count} workspaces, so it was disabled.
The Memory switch at the bottom of the settings page governs business memory. When on, the system summarises the business definitions and query constraints that appear in a conversation — including the result conclusions confirmed in that round — stores them locally, and injects them as context into later sessions; when off, nothing is read or written.
It is off by default. With it off the system still keeps sessions, versions and debug evidence — it simply does not accumulate cross-session definitions. A change is written to the runtime configuration immediately (memory.enabled) and needs no bridge restart; open sessions apply it from their next request.
The semantic file is the schema view presented to the model and determines which tables, columns and descriptions the model may reference when generating SQL. Generation is triggered by Save & generate semantic file and proceeds in four stages, with progress reported inside the dialog:
- Connecting — establish the connection and verify credentials;
- Reading tables — enumerate the tables in the database;
- Reading columns — read column names, types and available comments table by table;
- Writing file — write
content/semantic/<source_id>.yaml.
On completion the dialog closes and the row displays the file name, table count and generation time (Figure 3). On failure an error dialog appears, the connection record is retained and the semantic file remains absent; saving again retries the scan.
After generation, open the Data structure window from the navigation rail to inspect exactly what the model reads.
The window provides a semantic-file selector at the top, the list of tables with column counts on the left, the columns and types of the selected table in the middle, and the first ten rows of that table at the bottom. The preview queries the database directly and exists for verification only; it is not part of the model call. If the connection behind the file has been deleted, the preview is unavailable while the column metadata remains readable.
Note that the model answers from the semantic file alone and does not read database metadata directly. Columns whose business meaning is not evident from their names should be documented in the semantic file and the file regenerated, otherwise the model can only infer meaning from identifiers.
A workspace is the container of one conversation; it binds a data subject and stores the conversation, SQL versions and execution evidence.
From Workspaces (the home page), select New in the upper-right corner.
The list is ordered by update time and shows name, data subject, SQL dialect, version, update time and actions. The search box filters by name. Deletion requires confirmation and removes the entire conversation with its records.
Provide a Name and select a Data subject. Candidates include only connections that own a semantic file; SQL dialect is filled from the selected subject and is not editable. Names must be unique across all workspaces; a duplicate name is rejected with an error message.
Selecting Create opens the workspace. Neither the name nor the subject can be changed on this page afterwards; use a new workspace to change either.
The workspace is split into two panes: the current SQL and its actions on the left, the Coder conversation on the right.
The left pane contains, from top to bottom, a toolbar (Copy SQL, Format, Validate query, current target range), the SQL editor, and a save hint. The editor accepts direct edits; while uncommitted changes exist the toolbar marks Unsaved edits, and the SQL is saved automatically before a message is sent or a validation is started.
The right pane contains the conversation, the composer, and the mode and command hints. The heading shows the current phase, for example Writing SQL, Awaiting clarification or Awaiting review.
Describe the requirement in natural language (tables, aggregation rules, filters, ordering) and submit with Send or Enter. The system then reads the semantic file, samples data when needed, generates SQL, and writes the result to the left pane. The editor is read-only during generation; Stop terminates the run, and committed SQL versions and pending checkpoints survive termination.
Normal mode produces SQL directly. Plan mode first produces a query plan that must be approved before SQL is generated. Normal mode suits well-specified requests; plan mode reduces rework when joins or metric definitions need agreement in advance.
When a request admits several valid interpretations, a Confirm requirements card appears in the right pane, listing each question with candidate answers, a recommended option and an Other… free-text input. After all questions are answered, Confirm and continue resumes the run with those answers.
In plan mode the plan requires approval: Generate from this plan approves the current plan, while an instruction typed into the composer asks the model to revise it before another review.
Every committed change creates a new SQL version, shown next to the pane title (for example SQL v1). History lists each version with its kind, version number and summary; a selected version can be previewed and restored through the conversation.
Start over returns the window to the state before the first question: the conversation, the version history and the business-memory records produced in that window are removed, irreversibly. New session creates another workspace under the same data subject.
The editor also serves as a read-only debugger. Validate query executes the SQL against the real database and returns the result, which confirms syntax and semantics as well as locating the failing stage of a multi-part query. The scope follows the selection; the three granularities are shown in the three figures below.
With no selection, the entire SQL is executed.
The panel has two tabs: Results lists the columns and rows returned for each target, and Executed SQL shows the statement actually issued. The figure above is a query without CTEs, returning 20 rows.
When the selection fully covers one or more CTE declarations, those CTEs are executed, with the CTEs they depend on materialised as a WITH prefix.
Here british is selected (lines 1–10) and the panel returns driver_id and nationality, not the full_name and wins of the final statement. Different columns mean a different scope: that is the direct evidence that only the CTE ran, and the toolbar states both version and range as SQL v{n} · lines 1–10.
When the selection covers only the SELECT body of a CTE, that fragment is executed with the CTEs visible above it materialised as a WITH prefix, so the fragment runs on its own.
The selection is the SELECT inside wins (lines 12–21), whose FROM british b reads an upstream CTE. The Executed SQL tab is the evidence: the statement issued begins with WITH british AS (…) and only then the selected fragment. A single JOIN or aggregate can therefore be isolated without stitching the upstream definitions by hand, and without touching the rest of the statement.
- Uncommitted edits are saved before execution; the verdict is bound to the SQL version, so after further edits it must be repeated.
- At most
data_access.max_rowsrows are returned, each statement is subject tostatement_timeout_seconds, and write operations are rejected. - The divider between editor and panel is draggable, and Hide result / View result toggle the panel.
| Action | Shortcut | Scope |
|---|---|---|
| Save current SQL | Ctrl + S / ⌘ + S |
SQL editor |
| Undo / redo | Ctrl + Z / Ctrl + Shift + Z (⌘ on macOS) |
SQL editor |
| Send message | Enter |
Composer |
| Insert line break | Shift + Enter |
Composer |
| Open command menu | / |
Composer |
| Move within menu | ↑ / ↓ |
Command menu |
| Select command | Enter or Tab |
Command menu |
| Close menu | Esc |
Command menu |
Commands are grouped by purpose: General contains /sql_explain (explain the current or selected SQL) and /sql_fix (repair SQL according to a requirement or a validation error); SQL authoring contains /sp (write a stored procedure with parameters and logic agreed in natural language). A command may be submitted on its own as a complete request, or followed by an instruction, for example /sql_fix handle nulls.
While a generation or validation is running the editor is read-only and Ctrl + S does not save; wait for the run to finish or stop it first.
| Symptom | Cause | Remedy |
|---|---|---|
| Provider and model saved, but Test returns 404 | Missing path prefix in the base URL, or the model is not available to the account | Compare against the table in Section 1.1 |
| Test returns 401 | Wrong or truncated key, or a key that does not match the endpoint | Paste the key again and confirm it belongs to the provider |
| No semantic file after saving a connection | The account cannot read the schema, or the scan was interrupted | Read the error code in the dialog, correct the cause and save again |
| The data-subject list is empty when creating a workspace | No connection has a semantic file yet | Complete Section 3 first |
| Validation fails with a permission error | The database account is restricted beyond read-only, or the host is unreachable | Use an account with read-only access to the database |











