|
| 1 | +--- |
| 2 | +title: The Query Editor of the Arango Data Platform |
| 3 | +menuTitle: Query Editor |
| 4 | +weight: 30 |
| 5 | +description: >- |
| 6 | + Write, run, and analyze AQL queries using an IDE-like interface |
| 7 | +--- |
| 8 | +## Features |
| 9 | + |
| 10 | +The Query Editor of the Arango Data Platform offers the following features: |
| 11 | + |
| 12 | +- **Tabbed interface**: |
| 13 | + Work on multiple queries concurrently via tabs. |
| 14 | + |
| 15 | +- **Query and results side by side**: |
| 16 | + View the results of running, explaining, and profiling a query in a separate |
| 17 | + tab, with one results tab for each query tab. |
| 18 | + |
| 19 | +- **Result history**: |
| 20 | + A results tab shows the previous run, explain, and profile outputs. |
| 21 | + You can individually collapse and expand the entries, as well as clear the |
| 22 | + entire history. |
| 23 | + |
| 24 | +- **Saved queries**: |
| 25 | + You can save frequently used queries to add them to a sidebar for all users |
| 26 | + in the current database. |
| 27 | + |
| 28 | +- **Remembered queries and results**: |
| 29 | + The Query Editor remembers its state including unsaved queries as well as |
| 30 | + results across sessions using your local browser storage. |
| 31 | + |
| 32 | +- **Re-organizable viewport**: |
| 33 | + You can drag and drop tabs to re-order them and move them between existing |
| 34 | + panels, as well as split panels vertically and horizontally into more panels. |
| 35 | + |
| 36 | +- **Ask AI for AQL Queries (AQLizer)**: |
| 37 | + Describe what you want in natural language and generate AQL queries right |
| 38 | + from the Query Editor. This feature is only available in the |
| 39 | + Arango AI Data Platform. |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | +{{< info >}} |
| 44 | +The Query Editor of the Data Platform is not feature-complete. It currently |
| 45 | +lacks features like syntax highlighting and a way to set query options. |
| 46 | +Use the query editor of ArangoDB instead if you need these features. |
| 47 | +You can find it under **Management** in the Data Platform web interface, and |
| 48 | +then **Queries** in the second-level navigation. |
| 49 | +{{< /info >}} |
| 50 | + |
| 51 | +## Work with queries |
| 52 | + |
| 53 | +You can enter your AQL query code into the default tab, or open more query tabs |
| 54 | +at any point by clicking the button at the top of a panel to the right of the |
| 55 | +tabs ({{< icon "add" >}}). |
| 56 | + |
| 57 | +You can close tabs with the button next to the tab name ({{< icon "close" >}}). |
| 58 | +When you close all tabs, the viewport opens the **Welcome** tab. |
| 59 | + |
| 60 | +A floating panel in the top right corner lets you enter values for |
| 61 | +**Bind variables** if there are any such placeholders in the query. You can |
| 62 | +minimize this panel to a button. |
| 63 | + |
| 64 | +The following buttons are available at the bottom of a query tab: |
| 65 | + |
| 66 | +- **Save**: Store the query and the bind variables under a name you provide. |
| 67 | + The saved queries of the current database are listed in the sidebar on the |
| 68 | + left-hand side under **Saved**, where you can also clone, rename, and delete them. |
| 69 | +- **AQLizer**: This button is only visible if you use the AI Data Platform. |
| 70 | + See [Generate queries (AQLizer)](#generate-queries-aqlizer). |
| 71 | +- **Run query**: Execute the AQL query normally. |
| 72 | +- **Explain**: Show the execution plan for the query. |
| 73 | +- **Profile**: Run the query with detailed tracking of its performance. |
| 74 | + |
| 75 | +The sidebar on the left-hand side allows you to manage queries: |
| 76 | + |
| 77 | +- **Search queries**: Filter the list of **Saved** queries by name. |
| 78 | +- **Saved**: Open previously saved queries by clicking the name, or click the |
| 79 | + small button ({{< icon "ellipsis" >}}) to duplicate, rename, or delete |
| 80 | + saved queries. |
| 81 | +- **Running**: Open a tab with an overview over the currently executing queries. |
| 82 | + You can also kill a query from this view. |
| 83 | +- **Slow Queries**: Open a tab with a list of past queries that ran longer than |
| 84 | + a server-configured threshold. |
| 85 | + |
| 86 | +## Generate queries (AQLizer) |
| 87 | + |
| 88 | +{{< tag "AI Data Platform" >}} |
| 89 | + |
| 90 | +For an introduction to the AQLizer, see |
| 91 | +[The AQLizer feature of the Arango AI Data Platform](../ai-suite/aqlizer.md). |
| 92 | + |
| 93 | +Before you can generate AQL queries, you need to set up the AQLizer feature. |
| 94 | + |
| 95 | +1. Click the **AQLizer** button to open the panel for generating AQL queries |
| 96 | + with AI. |
| 97 | +2. On first use, you are asked for an **OpenAPI API Key** and you can select the |
| 98 | + desired **OpenAI Model**. |
| 99 | +3. Click **Start Service**. |
| 100 | +4. You can check the status of the service as well as stop it from the |
| 101 | + **Manage Services** dialog. |
| 102 | + |
| 103 | +Once the AQLizer service is ready, you can generate queries. |
| 104 | + |
| 105 | +1. In the AQLizer tab, enter a self-contained question or instructions in |
| 106 | + natural language, like "List all distinct surnames of characters older than 30". |
| 107 | +2. Click **Ask** or press {{< kbd "Return" >}} to use GenAI for generating an AQL query. |
| 108 | +3. Click **Open in Editor** for a new query tab, where you can verify, refine, |
| 109 | + and run the query. |
| 110 | + |
| 111 | +{{< warning >}} |
| 112 | +Always verify AI-generated queries. |
| 113 | +AI can make mistakes or produce unexpected results. |
| 114 | +{{< /warning >}} |
| 115 | + |
| 116 | + |
| 117 | + |
| 118 | +## Adjust the viewport |
| 119 | + |
| 120 | +The following options for re-organizing how tabs and panels are arranged in the |
| 121 | +Query Editor are available: |
| 122 | + |
| 123 | +- You can drag a tab with your mouse to a different place in the tab list to |
| 124 | + change the order of the tabs or move a tab to a different panel. |
| 125 | +- You can drag a tab to the left or right side of a panel to split it |
| 126 | + horizontally, or to the top or bottom to split it vertically. |
| 127 | + If you move or close the last remaining tab of panel elsewhere, the space is |
| 128 | + automatically reclaimed. |
0 commit comments