Database Manual · Chapter 4

DB Studio — Verify with SQL · Data Tabs

Before writing any script code, we recommend verifying the connection and data directly in DB Studio's two tabs. Run the same SQL twice, confirm the same result, then move it into a script.

xscript
Solution Explorer
├── Data Editor Pages
└── Database                       ← top level, peer of Data Editor Pages
    ├── Database Connections       (Ch. 2)
    ├── Database Studio            ← this chapter
    │   ├── Structure tab           (table / column tree from Ch. 3)
    │   ├── Data tab                (row-level view — read-only)
    │   └── SQL tab                 (free SQL execution)
    └── Database Events            (Ch. 8)

Pick the local connection in the left tree, then switch tabs.

SQL Tab — Free Execution

Type SQL in the top input and press the [Run] button or F5.

SQL worth trying often against the sample project:

sql
-- Total row count
SELECT COUNT(*) FROM order_history;
 
-- Last 5 jobs
SELECT id, order_no, menu_name, result, end_time
FROM   order_history
ORDER  BY id DESC
LIMIT  5;
 
-- Counts per 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;

The script-side RunSqlSelect / RunSqlScalarInt accept exactly the same SQL strings. Get the habit of only moving SQL that already works in this tab into scripts and your debugging time drops sharply.

Result area

AreaContent
Result gridSELECT result rows — column names, values, sorting
Status messageSELECT shows N row(s) returned. (ms ms); INSERT / UPDATE / DELETE shows N row(s) affected. (ms ms)
Execution timeThe (ms ms) in the message above gauges responsiveness

Data Tab — Row-Level View (Read-Only)

Picking a table in the left tree lets you view its rows as a grid. In this version the Data tab is read-only; you narrow what's shown with these controls:

  • WHERE box — a filter condition (e.g. is_error = 1). Leave empty for all rows.
  • Page Size — max rows to fetch at once (default 100).
  • [Load] button — re-reads rows with the conditions above and shows them in the grid.

A note at the bottom reads "Data editing is read-only in this version. Use SQL tab for INSERT/UPDATE/DELETE." — so do all INSERT / UPDATE / DELETE in the SQL tab.

Recommended uses:

  • Quickly inspect only the rows matching a WHERE filter
  • Verify with your own eyes that script results (after, e.g., DB_UpdateSelected) actually landed in the DB
  • Check whether a table is empty or has data
  1. Connections — confirm local is registered (Ch. 2)
  2. Structure tab — confirm order_history exists (Ch. 3)
  3. Data tab — [Load] the current rows (filter with WHERE if needed)
  4. SQL tab — run the 4 queries above and check results
  5. If empty, run the following in SQL tab to seed one row:
sql
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 5 steps pass, scripts are next.