ORM Studio

SQL Query Editor

Run SELECT queries directly against your database from the Studio dashboard.

2 min readDocumentationEdit this page

SQL Query Editor

The SQL Query Editor lets you run raw SQL queries against your connected database and view the results in a data grid — all from within the Studio dashboard.

Opening the Editor

  1. Navigate to the Database panel in the sidebar
  2. Click the SQL Query tab at the top

Writing Queries

Type your SQL query in the editor:

sql
SELECT * FROM users WHERE role = 'admin' ORDER BY created_at DESC LIMIT 25

Click Run or press the button to execute.

Results

Results appear in a data grid below the editor with the same formatting as the Database Browser:

  • Row numbers
  • Colour-coded cell values (NULL, boolean, number, date, string)
  • Horizontal scrolling for wide result sets

The execution time appears next to the Run button:

typescript
[ ▶ Run ]  [ Clear ]           42ms

Read-Only Mode

The SQL Query Editor is read-only. Only the following statement types are allowed:

  • SELECT
  • WITH (CTEs)
  • PRAGMA (SQLite)
  • SHOW (MySQL)
  • DESCRIBE (MySQL)
  • EXPLAIN

Attempting to run INSERT, UPDATE, DELETE, DROP, or CREATE statements returns an error:

typescript
Only SELECT queries are allowed in Studio

This protects your development database from accidental modifications.

Error Display

If your query has a syntax error or references a non-existent table, the error is shown in red below the editor:

typescript
SQLite query error: no such table: userss
SQL: SELECT * FROM userss

Example Queries

Count rows by role:

sql
SELECT role, COUNT(*) AS count FROM users GROUP BY role ORDER BY count DESC

Join tables:

sql
SELECT p.title, u.name AS author, c.name AS category
FROM posts p
JOIN users u ON u.id = p.author_id
LEFT JOIN categories c ON c.id = p.category_id
WHERE p.status = 'published'
ORDER BY p.created_at DESC
LIMIT 10

SQLite PRAGMA:

sql
PRAGMA table_info(users)

Find recent activity:

sql
SELECT action, entity_type, entity_id, created_at
FROM audit_log
ORDER BY created_at DESC
LIMIT 20

Clear Button

Click Clear to reset both the query input and the results panel.

Help improve the documentation

AxilJS is open source and documentation improvements are welcome.

AxilJS DocumentationMIT License · Built by SyntaxilitY