# SQL Editor

## Overview

The **SQL Editor** is a tool designed for database management, allowing users to execute SQL commands and manage data. It provides an interface to connect to multiple databases, run queries, and view results.

## Installation

To access the SQL Editor, you need to install the SQL Explorer plugin. The installation process follows the standard procedure for Eclipse plugins:

1. Navigate to the menu and select *Help > Install New Software.*
2. Select the *SQL Explorer Updates* location

   <figure><img src="https://3933488479-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjpWd52BKwABWxF2lScUK%2Fuploads%2Fgit-blob-483896569b3503dbc069075d3f2a55a3c579bdb7%2Fsql-install.png?alt=media" alt="sql-install-trust.png"><figcaption><p>SQL Editor</p></figcaption></figure>
3. Click **Next**, accept the license agreement, and then click **Finish**.
4. Trusting Certificates:

* During the installation process, a dialog will appear asking you to trust certificates from the update site.

<figure><img src="https://3933488479-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjpWd52BKwABWxF2lScUK%2Fuploads%2Fgit-blob-767d1a848e23b8233608221490be33d13d8c404b%2Fsql-install-trust.png?alt=media" alt="sql-install-trust.png"><figcaption><p>Trusting certificates</p></figcaption></figure>

* Accept other certificates which will appear in the process
* Once the installation is complete, you will be prompted to restart *Servoy Developer*.

## Using SQL Editor

The SQL editor can be accessed through the context menu of any database of table.

<figure><img src="https://3933488479-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjpWd52BKwABWxF2lScUK%2Fuploads%2Fgit-blob-722fb12d17bc41e59ac67830b83271e8592e4810%2Fopen-sql-editor.png?alt=media" alt="open-sql-editor.png" width="375"><figcaption><p>Open SQL Editor</p></figcaption></figure>

## SQL Editor overview

The SQL Editor in Servoy Developer is designed for managing and interacting with SQL databases directly within the IDE.

<figure><img src="https://3933488479-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjpWd52BKwABWxF2lScUK%2Fuploads%2Fgit-blob-2cda95b3ceb4b3219f02a02e4be2c8f2db9943cf%2Fsql-editor.png?alt=media" alt="sql-editor.png"><figcaption><p>SQL Editor</p></figcaption></figure>

#### SQL Editor Area

Each SQL connection is displayed in its own tab, allowing you to work on multiple SQL scripts simultaneously. For example, the screenshot shows tabs for user\_data.sql and example\_data.sql. Write the SQL query in the SQL input area and use the Execute button in the toolbar to run it. The query results will be displayed at the bottom.

#### Database Connection Selector

This dropdown allows you to select the database connection for the query. In the image, the selected value, **example\_data/anonymous**, shows the selected database and the connection type.

#### Limit Rows Option

This option allows you to limit the number of rows returned by the query.

#### Connections Panel

The Connections panel on the right side lists all available database connections, highlighting the databases with active SQL sessions (next to the connection name). In the image, we see that example\_data and user\_data both have active sessions. Various operations are available in this panel from the context menu.

<figure><img src="https://3933488479-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FjpWd52BKwABWxF2lScUK%2Fuploads%2Fgit-blob-df3e9ba0f1e757773571fa45487b0f7702e3b50e%2Fsql-conn-context.png?alt=media" alt="sql-editor.png" width="375"><figcaption><p>SQL Editor</p></figcaption></figure>

You may use any SQL editor to interact with the Servoy database; however, the integrated SQL Editor provides a faster and more convenient way to manage your databases directly within the Servoy Developer environment. This eliminates the need to install a third-party tool, streamlining the workflow and enhancing productivity.
