SQLScout's SQL editor provides a complete set of features that you need from an IDE: syntax highlighting, code completion, navigation to schema and alias definition, and much more.
- Editor types
- Code completion
- Executing SQL statements
- Navigation to tables and columns in the SQLite Explorer
- Function documentation
1. Editor types
In-memory SQL Editors
The contents of an in-memory SQL editor are not in a physical file, but in-memory. The main benefit of in-memory editors is they can be opened quickly: just click the "Open SQL Editor" action ( ) in the SQLite Explorer's toolbar or context menu. Editor functions like code completion and SQL statement execution will work based on the Data Source selected in the SQLite Explorer.
Please note that the contents of in-memory SQL editors are not preserved between IDE sessions. You can save the editor's contents to disk by clicking the "Save" action ( ) on the editor's toolbar (see figure 1).
File-based SQL Editors
By default, file-based SQL editors are not associated with any Data Source from the SQLite Explorer.
Editor functions like code completion and SQL statement execution will work based on the selected Data Source. You can select a Data Source from the drop-down on the editor's toolbar (see figure 2).
If the editor does not have a selected Data Source, editor functions will work based on all Data Sources in the SQLite Explorer.
2. Code Completion
SQLScout's keyword completion is based on how SQLite understands SQL. The editor only suggests keywords based on the type of SQL statement and the cursor position within a SQL statement. In the example below (figure 3), SQLScout only suggests the keywords that can go after the tables names in a
FROM clause, in a
Keyword completion supports
Database Object Completion
The SQL editor suggests names of columns and tables based on the editor's Data Source and the the cursor position within a SQL statement. In the example below (figure 4), SQLScout only suggests the columns in the table specified in the
Code completion also understands table aliases. In the example below (figure 5), SQLScout only suggests the columns in the table with alias "alias".
The SQL editor suggest SQLite-specific function names where appropriate (e.g. where expressions are allowed in a SQL statement). Code completion supports SQLite's core functions, date & time functions, and aggregate functions.
3. Executing SQL Statements
Executing a SQL statement is as easy as selecting the statement in the editor (or placing the caret at the end of the statement) and clicking the "Execute statement" action ( ) on the editor's toolbar. To execute multiple SQL statements, simply select them in the editor and click "Execute statement".
The result of the statement execution will appear in the Data Console.
When writing a SQL statement, it can be handy to navigate to the definition of a table or column, and see its structure. SQLScout supports navigation to the database schema from the SQL editor to the SQLite Explorer.
To perform navigation, you can do one of the following:
- Place the cursor within the name of a table or column and select the action "Go To | Declaration" from the context menu
- Press and hold the Ctrl (Windows/Linux) or Command (MacOS) keys, and point to a table or column, then click on the hyperlink.
5. Function Documentation
The "quick documentation" pop-up includes a hyperlink to the online documentation.