Query Editor (Reference) provides SQL script writing capabilities with syntax highlighting, auto-completion, and advanced text manipulation features. The Query Editor enables:
- SQL syntax highlighting
- Auto-completion support
- Search and replace
- Code formatting
- Whitespace management
- Visual customization
Access via double-clicking SqlStatement in Dataset Queries or through the dedicated editor button.
In
Overview
The Query Editor allow the user to write scripts in SQL.
this page:
Table of Contents maxLevel
2 minLevel 2 indent 10px exclude Steps style none
Edit Actions
Basic Operations
Action | Shortcut | Description |
---|---|---|
Undo | Ctrl+Z | Revert last action |
Redo | Ctrl+Y | Reapply undone action |
Cut | Ctrl+X | Remove and copy to clipboard |
Copy | Ctrl+C | Copy to clipboard |
Paste | Ctrl+V | Insert from clipboard |
Delete | Delete | Remove without copying |
Select All | Ctrl+A | Highlight entire content |
Advanced Operations
Action | Description |
---|---|
Cut/Append | Cut and append to existing clipboard |
Copy/Append | Copy and append to existing clipboard |
Insert Example | Insert predefined SQL template |
Is Document Read-only | Check edit permissions |
Search Functions
Function | Shortcut | Description |
---|---|---|
Find | Ctrl+F | Open search dialog |
Find Next | F3 | Next occurrence |
Incremental Search | Ctrl+I | Search while typing |
View Options
Margin Controls
Option | Purpose |
---|---|
Indicator Margin | Error/warning indicators |
Line Number Margin | Line numbering display |
Outlining Margin | Code folding controls |
Ruler Margin | Horizontal ruler |
Selection Margin | Click-to-select lines |
Display Settings
Option | Purpose |
---|---|
Word Wrap | Wrap long lines |
Word Wrap Glyphs | Show wrap indicators |
Whitespace Visible | Display spaces/tabs |
Indentation Guides | Vertical indent lines |
Line Modification Marks | Show changed lines |
Highlighting Options
Option | Purpose |
---|---|
Current Line Highlighting | Highlight cursor line |
Delimiter Highlighting | Match brackets/parentheses |
Search Result Highlighting | Highlight found text |
Navigation Settings
Option | Purpose |
---|---|
Can Scroll Past Document End | Allow scrolling beyond text |
Virtual Space at Line End | Cursor beyond line end |
Auto-Correct Enabled | Automatic corrections |
Edit Actions
The "Edit" manages text manipulation within a Query. Users can undo and redo actions, cut, copy, paste, and delete text. It also includes commands for incremental search, selecting all content, and checking if a document is read-only.
Action | Description |
Undo | Reverts the last action taken. |
Redo | Reapplies the last undone action. |
Cut | Removes the selected content and places it on the clipboard. |
Cut/Append | Cuts the selected content and appends it to existing clipboard content. |
Copy | Copies the selected content to the clipboard. |
Copy/Append | Copies the selected content and appends it to existing clipboard content. |
Paste | Inserts content from the clipboard. |
Delete | Removes the selected content without copying it to the clipboard. |
Find (Ctrl+F) | Opens a search dialog to locate text. |
Find Next (F3) | Finds the next occurrence of the last searched text. |
Incremental Search | Searches as the user types, updating results incrementally. |
Select All | Highlights the entire document content. |
Insert Example | Inserts a predefined example or template. |
Is Document Read-only | Checks if the document is in a read-only state. |
View Options
The "View” allows users to customize the visibility of various interface elements. Users can toggle the visibility of margins, line numbers, word wrap, whitespace, and different types of highlighting. These options enhance the user's control over the document's visual presentation.
Option
Description
Indicator Margin Visible
Toggles the visibility of the indicator margin.
Line Number Margin Visible
Shows or hides the line number margin.
Outlining Margin Visible
Controls the visibility of the outlining margin.
Ruler Margin Visible
Toggles the visibility of the horizontal ruler margin.
Selection Margin Visible
Shows or hides the selection margin.
Word Wrap
Enables or disables word wrapping.
Word Wrap Glyphs Visible
Toggles the visibility of glyphs indicating wrapped lines.
Whitespace Visible
Shows or hides whitespace characters like spaces and tabs.
Can Scroll Past Document End
Allows or disallows scrolling beyond the end of the document.
Virtual Space at Line End
Enables positioning the cursor in virtual space beyond the line end.
Indentation Guides Visible
Toggles the visibility of vertical guides indicating indentation levels.
Line Modification Marks Visible
Shows or hides markers for lines modified since the last save.
Current Line Highlighting Enabled
Highlights the line where the cursor is currently located.
Delimiter Highlighting Enabled
Highlights matching delimiters, such as brackets or parentheses.
Search Result Highlighting Enabled
Highlights search results within the document.
Auto-Correct Enabled
Toggle Token Info in Status Bar |
SQL token information |
Advanced Options
The "Advanced" provides tools for formatting and text editing. Users can convert tabs to spaces, change character casing, and manage whitespace. It also includes commands for tabifying lines, deleting blank lines, and trimming trailing whitespace, enabling precise text adjustments within the document.
Whitespace Management
Operation |
---|
Description | |
---|---|
Convert Tabs to Spaces |
Replace tabs with spaces |
Convert Spaces to Tabs |
Replace spaces with tabs |
Tabify Selected Lines |
Leading spaces |
to tabs |
Untabify Selected Lines |
Leading tabs to spaces | |
Delete Horizontal Whitespace | Remove inline spaces |
Trim All Trailing Whitespace | Clean all line endings |
Trim Trailing Whitespace | Clean selected lines |
Delete Blank Lines | Remove empty lines |
Text Transformation
Operation | Description |
---|---|
Make Uppercase |
Convert to UPPER |
Make Lowercase |
Convert to lower |
Toggle Character Casing |
Switches the case of the selected text between uppercase and lowercase.
Capitalize
Capitalizes the first character of each word in the selected text.
Delete Horizontal Whitespace
Removes spaces and tabs on a line without affecting content.
Trim All Trailing Whitespace
Removes trailing spaces and tabs from all lines in the document.
Trim Trailing Whitespace
Removes trailing spaces and tabs from the selected lines.
Delete Blank Lines
Removes all blank lines in the selected text or document.
Switch case | |
Capitalize | First Letter Caps |
SQL Features
Syntax Highlighting
- Keywords (SELECT, FROM, WHERE)
- Functions (COUNT, SUM, AVG)
- Strings and numbers
- Comments (-- and /* */)
- Tag placeholders {{Tag.Name}}
Auto-Completion
- SQL keywords
- Table names
- Column names
- Function names
- Tag references
Code Templates
Common SQL patterns:
sql
-- Basic SELECT
SELECT * FROM TableName WHERE Condition
-- JOIN template
SELECT t1.*, t2.*
FROM Table1 t1
INNER JOIN Table2 t2 ON t1.ID = t2.ID
-- INSERT with tags
INSERT INTO TableName (Col1, Col2)
VALUES ({{Tag.Value1}}, {{Tag.Value2}})
Keyboard Shortcuts
Navigation
Shortcut | Action |
---|---|
Home | Line start |
End | Line end |
Ctrl+Home | Document start |
Ctrl+End | Document end |
Ctrl+G | Go to line |
Selection
Shortcut | Action |
---|---|
Shift+Arrow | Extend selection |
Ctrl+Shift+Arrow | Word selection |
Shift+Home/End | Line selection |
Ctrl+L | Select line |
Editing
Shortcut | Action |
---|---|
Tab | Indent |
Shift+Tab | Outdent |
Ctrl+] | Increase indent |
Ctrl+[ | Decrease indent |
Best Practices Checklist
- Enable line numbers - Easy reference
- Show whitespace - Spot formatting issues
- Use delimiter highlighting - Match parentheses
- Enable word wrap - Long queries visible
- Regular formatting - Consistent indentation
- Trim whitespace - Clean code
- Use templates - Standard patterns
Tips and Tricks
Efficient Editing
- Use incremental search for quick navigation
- Cut/Append for building complex queries
- Multi-line selection with Alt+drag
Code Organization
- Fold complex subqueries
- Use consistent indentation
- Comment complex logic
- Group related statements
Performance
- Highlight slow query patterns
- Use execution plan preview
- Monitor token complexity
In this section...
Page Tree | ||||
---|---|---|---|---|
|
In this section:
Page Tree | ||||
---|---|---|---|---|
|