The Editor provides IntelliSense that includes formatting, highlighting, auto-completion for keywords and data objects, code folding. Options can be configured in Settings.
Line numbering
|
|
Query editor contains line numbers for each line of text |
Context Sensitive Syntax Coloring
|
|
Keywords are color coded |
Auto Completion with Hints
|
|
Keyword autocomplete
|
Bracket Matching
|
|
Brackets such as (), [], and {} color code match
|
Embracing Selection in Brackets
|
|
Words can be embraced in brackets such as (), {}, [], “”, ‘’, and ``
|
Multiline Cursor and Selection
|
|
Multiple cursors can be made across the same and multiple lines
Multiple selections can be made across the same and multiple lines
|
Block Selection
|
|
|
Multi Query
Multiple queries can be composed in the query text area.
Construct multiple queries by separating them using ##bq
Query in focus is the query that will be selected to run. Query in focus selection can be made by highlighting text or positioning cursor between ##bq separators.
|
|
Adding multiple queries to the query text area
|
|
|
One of two ways to set query in focus is by highlighting text
|
|
|
The second of two ways to set query in focus is by placing
|
|
|
To validate a query within multiple queries set the query in focus
|
Fold/Unfold Code
When editing SQL, GoBQ and JavaScript within an editor the code is foldable.
Foldable code is indicated by arrows in the left margin next to the line numbers.
Ellipsis at the end of a line indicates folded code. Clicking an ellipsis expands the folded lines.
Clicking the arrows expands and collapses foldable lines.
Hovering over an ellipsis displays a popup with a preview of the collapsed code.
Foldable lines may also be toggled using keyboard shortcuts. CTRL+Q toggles folding for the active line. CTRL+SHIFT+Q toggles folding for all foldable lines.
Multiline Comments
To add multiline comments follow steps for Multiline Cursor and Selection (7) above and then type comments
Multiline
See Multiline Cursor and Selection and Multiline Comments above
IntelliSense for Data Objects
Project/Dataset/Table Selection
|
Shift + Ctrl and space opens projects list along with column count.
Make selection to list project datasets along with table count. The project is added to query editor.
Make selection to list dataset tables. The dataset is added to query editor.
Make selection to add table to query editor. |
A table can be selected and added to query editor by
|
Column Selection
|
Add tables to query editor
Place cursor between SELECT and FROM then Ctrl + space to bring up column selection for those tables Make a selection to view columns along with data types for that table
Select column to add it to query editor
|
Columns can be selected and added to the query editor by
|
Meta-tables
|
Shift + Ctrl and space opens projects list along with column count.
Make selection to list project datasets along with table count. The project is added to query editor.
Make selection to list dataset tables. The dataset is added to query editor. Scroll to bottom of list to see meta-tables
Make selection to add meta-table to query editor
|
A meta-table can be selected and added to query editor by
|
Pseudo Column
|
Add tables to query editor
Place cursor between SELECT and FROM then Ctrl + space to bring up column selection for those tables
Make a selection to view columns along with data types for that table. Pseudo columns are on the bottom of list
Select pseudo column to add it to query editor
|
If a table has a pseudo column such as _PARTITIONTIME for a partitioned table the pseudo column is available for selection
|
Table/view Aliases
When an aliased table/view is following by a dot, the hints column for the table will present respective columns to pick from.
Information Schema
|
Make selections to list dataset tables. The dataset is added to query editor. Scroll to bottom of list to see Information Schema options.
|
Information Schema are views that display metadata. An Information Schema view can be selected and added to query editor by
|
Find/Replace
Editor content can be searched for and replace specific text (regular expression is supported) within SQL queries, making it easier to make edits and changes.
To invoke the feature, click a combination of keyboard shortcuts while the query editor is in focus. Actions are outlined in the below table.
|
PC |
Mac |
Action |
|
CTRL + F |
⌘F |
Find |
|
SHIFT + CTRL + R |
⌥⌘R |
Replace |
|
CTRL + G |
⌘G |
Find Next |
|
SHIFT + CTRL + G |
⇧⌘G |
Find Previous |
|
ALT + F |
⌥F |
Quick Search |
|
Alt + G |
⌥G |
Jump to Line |
You can also find the list of key binds by hovering over Shortcuts in the upper right corner.
Find
Find searches the query text and highlights matches. Matches are highlighted in yellow while the current focused match is orange. To invoke Find, focus the query editor, and click Ctrl+F on a PC or ⌘F on a Mac. A dialog box will open at the bottom of the editor prompting for input.
Click enter in the Find input field to cycle through matches.
Find accepts regular expression search by using the syntax of /re/. To use regular expression, wrap the expression in ‘/’. For example, to search for digits enter /\d+/.
To close the dialog box, click ESC or mouse click outside the box. It will close, and matches will be cleared.
Replace
Replace prompts to search the query text and replace the matches with another input value. Replace contains three steps. The first step requests the value to match. The second step asks what value to replace with. The final step will prompt for Yes, No, All, or Stop. Yes will replace the current match and move to the next match. No, will skip replacement of the current match and move to the next match. All will replace all the matches. Stop will close the dialogue and stop replacing.
To invoke Replace, focus the query editor, and click SHIFT + CTRL + R on a PC or ⌥⌘R on a Mac. A dialog box will open at the bottom of the editor prompting for input.
Enter the text to be replaced and click enter. Regular expression can be used for Replace. The next dialogue will prompt for the value to be replaced with. Add the value then click enter to proceed to the next step.
A Replace? prompt will appear for each match. Yes will replace the current match and move to the next match. No, will skip replacement of the current match and move to the next match. All will replace all the matches. Stop will close the dialogue and stop replacing.
Find Next
Find Next identifies the next match in a list of matches. The match will be highlighted with orange. If Find is already invoked then Find Next will move to the next match. If Find is not invoked, Find Next will open a dialogue to enter the value to match. To invoke Find Next, focus the query editor, and click Ctrl+G on a PC or ⌘G on a Mac.
Find Previous
Find Previous identifies the previous match in a list of matches. The match will be highlighted with orange. If Find is already invoked then Find Previous will move to the previous match. If Find is not invoked, Find Previous will open a dialogue to enter the value to match. To invoke Find Previous, focus the query editor, and click SHIFT + CTRL + G on a PC or ⇧⌘G on a Mac.
Quick Search
Quick Search opens a dialogue box prompting for a value to match. Quick Search accepts regular expression search by using the syntax of /re/. Clicking enter closes the dialogue and displays all matches in yellow with the current match in orange. To clear the matches, reopen the dialogue box, either via Find or Quick Search, and click ESC or enter with no value. To invoke Quick Search, focus the query editor, and click ALT + F on a PC or ⌥F on a Mac.
Jump to Line
Jump to line moves the cursor to the entered position. The jump can be by line and column or by a scroll percentage.
The syntax for line and column is line:column where line and column are separated by a colon. Line is a number representing the line count of the query. Column is a number representing the count in position starting from the left of the line. Column is optional. If not supplied the default will be the current column position. To enter without column simply add the line number without : and column such as 9. To invoke Jump to Line, focus the query editor, and click Alt + G on a PC or ⌥G on a Mac. To move the cursor to line 9 and column 5 would be represented as 9:5.
The syntax for scroll% is #% where # is a number 0 – 100. The total line count is calculated and multiplied by the inputted value / 100. Decimals can also be added in the format of #.#% such as 14.5%. The resulting line is calculated and rounded. The line is then jumped to. For example, if there are 27 lines in the text and 50% is entered, the cursor will jump to line 14.
Matches on Scrollbar
If the scrollbar is set to persist (see your OS options), matches will appear in the scrollbar to indicate the position within the query editor. For example, if the query text exceeds the view port, a scroll bar will appear on the right. When using Find or Quick Search, matches that exists outside of the view port will have their position highlighted in the scrollbar. Scroll up or down to navigate to the locations for these matches.
A match in view, with another match outside of view as indicated on the scrollbar.
Scrolling to the other match with the previous match now outside of view but shown in the scrollbar.
Settings
IntelliSense options can be configured in settings. Configuration includes autocomplete, search style, type case, and information schema default region.
Autocomplete Mode by default
IntelliSense matches keywords via auto complete. This option can be toggled to enable and disable. When enabled, typing will trigger keyword matches and display hints. Disable will not show hints while typing. Instead autocomplete can be triggered via the shortcut CTRL+Space.
Search Style
When typing project, dataset, table, and column names in a query they can be matched anywhere in their name by text typed.
An option is available under Settings to toggle between matching start of the name or anywhere in word.
Hover over Settings, identify option Match Start of Word and check or uncheck to set behavior.
If checked, the match will be made by the start of the word.
If unchecked, words will be matched by the typed text anywhere in the word.
|
Match Start of Word |
Match Anywhere in Word |
|---|---|
|
|
|
|
|
|
Type Case
Keywords can be configured to stay in the case typed or transformed into upper or lower case. The preferred style for reserved words (keywords) can be selected in Settings by picking an option from the IntelliSense Case Type options.
Note: when query is pasted into Goliath Editor from outside sources – the query will be formatted based on selected preferences.
A keyboard shortcut, SHIFT+CTRL+U, is available to switch between upper and lower cases.
Using of this shortcut will also change respective setting.
Note: Change of preferred case (either through Settings or respective shortcut) is applied to all tabs in Editor and queries/scripts in them.
Reminder: Upper/Lower Case management happens dynamically on background and does not change actual text of query/script, thus when you will copy / paste it outside of Goliath – you might see formatting different from how it appears/displayed in Goliath Editor. To make sure copy/paste preserves displayed format – use SHIFT+CTRL+F before copying.
Lower case option selected
vs. Upper case option selected