Query Tool

💻 Query Tool

The Query Tool in ARPIA provides an environment to write, execute, and analyze SQL queries directly against datasets stored in repositories. It combines a SQL editor with a real-time results viewer, supporting both ad-hoc data exploration and validation of Data Objects before deployment.

Query Tool interface showing the SQL editor on the left with a sample query against a repository, and the tabular results viewer on the right displaying returned rows.

The Query Tool combines a SQL editor with an integrated results viewer.


✅ Prerequisites

Access to the Query Tool is governed by the user's assigned Security Profile. Before using the Query Tool, confirm the following:

  • A workspace administrator has assigned you a Security Profile that grants access to the Query Tool and to at least one repository in your ARPIA workspace.
  • Your Security Profile grants the appropriate level of access on the target repository's Knowledge Grid nodes. Read-only versus read/write entitlements determine which result row cap applies (see Query Execution).

If you cannot access the Query Tool or a specific repository, contact your workspace administrator or follow the node access request flow.

To open the Query Tool: Navigate to ARPIA → Query Tool. The breadcrumb at the top of the page will read ARPIA / Query Tool once the tool is open.


🌟 Key Features

📝 SQL Editor

The editor is designed for productive query authoring and includes:

  • Query tabs — work on multiple queries in parallel. Each tab (e.g., Query 1) can be closed with the × icon, and a + button opens a new tab. Tabs persist within the current session.
  • Status indicator — a status bar below the editor shows the current state (e.g., ● Ready) so you always know whether a query is active.
  • Syntax highlighting for SQL keywords, identifiers, and literals.
  • Auto-complete and query suggestions for table names, columns, and common SQL constructs.

Editor toolbar

The toolbar above the editor exposes the following actions, left to right:

ButtonActionShortcut
Query tips (ⓘ)Opens a popover with usage guidance, including the result row caps and a link to the supported SQL syntax reference
Keyboard shortcuts (⌨)Opens a popover listing all available keyboard shortcuts
▶ RunExecutes the entire query in the active tabCtrl + Enter
SelectionExecutes only the highlighted portion of the queryCtrl + Shift + Enter
Format (✨)Reformats the active query for readability (indentation, line breaks, keyword casing)Ctrl + Shift + F
Save Query (💾)Saves the current query for reuse across sessions
Load Query (📂)Opens the saved-queries picker to load a previously saved query
AI Assistant (🪄)Opens the Arpia Codex Assistant dialog for query generation and code-aware Q&A
Query tips popover displaying 'Results capped at 1,000 rows (5,000 for read-only queries)' and a link to the supported SQL syntax reference.

The Query tips popover summarizes execution limits and links to the SQL reference.

Keyboard shortcuts

ShortcutAction
Ctrl + EnterRun the entire query
Ctrl + Shift + EnterRun only the highlighted selection
Ctrl + Shift + FFormat the active query
Keyboard shortcuts popover listing Ctrl+Enter to Run, Ctrl+Shift+Enter to Run Selection, and Ctrl+Shift+F to Format.

All keyboard shortcuts available in the editor.


⚡ Query Execution

  • Run the entire query with the ▶ Run button or Ctrl + Enter.
  • Run only a highlighted portion with the Selection button or Ctrl + Shift + Enter.
  • Result row caps:
    • 1,000 rows for standard queries
    • 5,000 rows for read-only queries
  • The Query Tool supports ANSI SQL commands. A link to the supported syntax reference is available from the Query tips (ⓘ) popover in the editor toolbar.

📊 Results Viewer

Query results render in a tabular view with the following capabilities:

  • Column sorting by clicking column headers.
  • Copy — copy the result set to the clipboard.
  • CSV download — export the result set as a CSV file for offline analysis.

🔗 Repository & Connection Management

Use the repository selector at the top of the side panel to choose which repository's tables are loaded into the editor for querying.

  • The dropdown lists every repository available to your account, along with its size allocation (for example, ARPIA_DEMO_REPO_BETA - 1G).
  • Selecting a repository loads its tables and columns into the panel below the selector. Each column displays its data type as a badge (varchar, decimal, date, enum, etc.) for quick reference while writing queries.
  • You can switch repositories at any time without leaving the editor; the table panel refreshes to match the new selection.
  • Use the Reload schema button (circular-arrow icon above the table panel) to refresh the schema view. This is useful when the repository has been updated outside the current session — for example, when objects have been added, removed, or modified — so the editor reflects the latest tables and columns.
  • Use the Collapse pane button (« double-chevron) to hide the schema panel and give the editor full width. When collapsed, a Show schema button (» double-chevron) appears in its place to restore the panel.
Repository selector dropdown showing available repositories with their size allocations, and the selected repository's table columns and data types displayed below.

The repository selector lists every accessible repository with its size allocation.


💾 Saved Queries

Saved queries let you reuse SQL across sessions without retyping or re-pasting it.

To save a query:

  1. Click the 💾 Save Query button in the editor toolbar.
  2. In the Save Query dialog, enter a name in the Label for Query field.
  3. Click Save to persist the query, or Cancel to dismiss.
Save Query dialog with a 'Label for Query' text field and Cancel and Save buttons.

The Save Query dialog persists the active query under a label for later reuse.

To load or delete a saved query:

  1. Click the 📂 Load Query button in the editor toolbar.
  2. In the Load Saved Query dialog, open the Query to load dropdown and select a query.
  3. Click Load Query to load it into the active editor tab.
  4. To remove a saved query, select it in the dropdown and click Delete.
  5. Click Cancel to dismiss the dialog without changes.
Load Saved Query dialog with a 'Query to load' dropdown and Cancel, Delete, and Load Query buttons.

The Load Saved Query dialog handles both loading and deleting saved queries.

📘

Tip: The Delete button removes the selected saved query immediately. Re-save the query if you remove it by mistake.


🤖 Arpia Codex Assistant

Open the AI Assistant from the 🪄 AI Assistant button in the editor toolbar. The assistant — Arpia Codex Assistant — generates code with awareness of your knowledge grid and loaded tools, and can answer questions about a selected portion of code.

Using the assistant:

  1. Click the 🪄 AI Assistant button to open the AI Assistant dialog.
  2. In the prompt field, describe the code you want generated, or the question you want answered about your selected code.
  3. (Optional) Check Include selected code. to send the currently highlighted SQL from the editor to the assistant for context.
  4. Click ▶ Ask Codex to submit.
  5. Click Close to dismiss the dialog.

What the assistant can do:

  • Generate SQL from a natural-language description of the desired result.
  • Answer questions about a selected portion of code.
  • Provide insights on existing queries with context from your knowledge grid and loaded tools.

The Include selected code. checkbox controls whether highlighted SQL is sent to the model along with your prompt. The prompt itself is always submitted when you click Ask Codex.

Arpia Codex Assistant dialog with a multi-line prompt field, an 'Include selected code' checkbox, an Ask Codex button, and a Close button.

The Arpia Codex Assistant dialog generates SQL and answers questions about selected code.

For more on the Arpia Codex Assistant beyond the Query Tool, see Arpia Codex Assistant.


⚠️ Limitations

  • Result row caps: 1,000 rows for standard queries, 5,000 rows for read-only queries.
  • SQL dialect: ANSI SQL.

🎯 Common Use Cases

The Query Tool is typically used to:

  • Explore datasets to understand structure and content before building Data Objects.
  • Validate logic for views and transformations prior to deployment.
  • Export results to CSV for reporting, sharing, or downstream analysis.
  • Generate and explain queries using the integrated Arpia Codex Assistant.

🔧 Troubleshooting

SymptomLikely causeResolution
"Permission denied" on executionSecurity Profile does not grant access to the target repository or Knowledge Grid nodeContact your workspace administrator, or use the node access request flow
Query times outResult set too large or query not optimizedAdd LIMIT, narrow the WHERE clause, or review indexes
Auto-complete shows no tablesRepository not selected, or schema not yet loadedSelect a repository from the dropdown and refresh
New or modified tables don't appear in the schema panelSchema view is cached from when the repository was first openedClick Reload schema (circular-arrow icon) above the table panel
Saved query is missing after using the Load dialogQuery may have been deleted via the Delete button in the Load Saved Query dialogRe-save the query
CSV download is emptyQuery returned zero rows, or export was triggered before execution completedRe-run the query and wait for completion before exporting

🔗 Related Topics