Database Studio — Validating with the SQL · Data Tabs
Before writing script code, we recommend checking the connection and the data directly on two tabs of Database Studio. Run the SQL in the studio first, confirm the result, and then move it into the script.
Solution Explorer
├── Data Editor Pages
└── Database
├── Database Connections (Chapter 2)
├── Database Studio ← this chapter
│ ├── Structure tab (Chapter 3 — table structure editing)
│ ├── Data tab (row view — read-only)
│ └── SQL tab (free SQL execution)
└── Database Events (Chapter 8)Choose local in Connection at the top and press [Open]; ● OPEN appears on the right and the table list appears in Tables on the left.
[Close] · [Refresh] close the connection or reread the lists, and [Backup...] backs up the open DB to a file (Chapter 9).
Note The studio's connection is the same connection as
DB["local"]in scripts. A connection you open stays open after you leave the screen, so while it is open in the studio,DB["local"].IsOpenin scripts is alsotrue.
SQL Tab — Free Execution

An SQL editor with syntax highlighting.
| Button | Action |
|---|---|
| Run (F5) | Runs all SQL in the editor |
| Run Selected | Runs only the selection (everything if nothing is selected) |
| Explain | Shows the execution plan |
| Clear · Load .sql... · Save .sql... | Clear the editor · read / save a .sql file |
| History | The last 20 SQL statements run |
Caution The button name includes F5, but F5 is the QMachineStudio-wide shortcut for switching to the machine screen (Run) in the development screen. Run SQL by pressing the [Run (F5)] button.
Useful SQL to try with the sample project:
-- Total row count
SELECT COUNT(*) FROM order_history;
-- Latest 5 jobs
SELECT id, order_no, menu_name, result, end_time
FROM order_history
ORDER BY id DESC
LIMIT 5;
-- Count by result
SELECT result, COUNT(*) AS cnt
FROM order_history
GROUP BY result;
-- Errors only
SELECT id, order_no, menu_name, weight_g
FROM order_history
WHERE is_error = 1;RunSqlSelect / RunSqlScalarInt in scripts take SQL that works on this tab as is.
Get into the habit of moving only SQL that passed here into scripts and debugging time drops sharply.
Result Area
| Area | Content |
|---|---|
| Result table | SELECT result rows — column names and values |
| Status message | N row(s) returned. (ms ms) for SELECT, N row(s) affected. (ms ms) for other commands (INSERT / UPDATE / DELETE etc.) |
| Execution time | Check the response time from (ms ms) in the message above |
Data Tab — Row View (Read-only)
Shows the rows of the table selected in Tables on the left as a grid. This tab is read-only; narrow the rows with the fields below.
- WHERE — filter condition (e.g.
is_error = 1). Empty = all rows - Page Size — maximum number of rows to read at once (default 100)
- [Load] — rereads the rows with the conditions above and shows them
The bottom of the tab shows the note "(Data editing is read-only in this version. Use SQL tab for INSERT/UPDATE/DELETE.)". Run every INSERT / UPDATE / DELETE on the SQL tab.
Recommended uses of this tab:
- Quickly check only the rows that match a WHERE filter
- Visually confirm that a script result (e.g. after
DB_UpdateSelected) actually reached the DB - Check whether a table is empty or whether data has arrived
Validation Flow — Recommended Order
- In Database Connections, check that
localis registered and that [Test Connection] passes (Chapter 2) - In Database Studio, [Open]
localand check thatorder_historyappears in Tables on the left (Chapter 3) - On the Data tab, read the current rows with [Load] (filter with WHERE if needed)
- On the SQL tab, run the 4 queries above and check the results
- If the table is empty, run the following SQL on the SQL tab to add one row
INSERT INTO order_history(order_no, menu_name, start_time, end_time, weight_g, result, is_error)
VALUES('O0001', 'Americano', '2026-01-01 09:00:00', '2026-01-01 09:00:30', 250, 'Done', 0);Once these five steps are done, it is the script's turn.