Skip to main content
Settings > Editor covers typing and how SQL is displayed. Grid, page size, result limit and JSON viewer settings are on the Data pane instead. The font here is set per Mac, not per theme, and is not synced.
Editor pane with the Font, Display, Gutter and Editing sectionsEditor pane with the Font, Display, Gutter and Editing sections

Editor settings

Font

Display

Gutter

Editing

Autocomplete is always on; see Autocomplete. Editor shortcuts are listed and customized on Keyboard Shortcuts.

SQL formatting

Query > Format Query (Cmd+Shift+L) follows these rules. Click SQL Formatting at the bottom of the Editor pane to open them. The preview at the top of the page formats a sample statement with them, in the editor theme. The defaults produce the layout shown under Formatting.
SQL Formatting page with a preview of a formatted SELECT statement above the Indentation, Case and Line Breaks sectionsSQL Formatting page with a preview of a formatted SELECT statement above the Indentation, Case and Line Breaks sections

Each change shows in the preview at once

Restore Defaults, at the bottom of the page, puts every formatting rule back.

Share the rules

Click Export… on the Rules file row to save the rules as sql-formatter.json. The file holds the resolved values: a width that follows Tab width is written as the number, and Same as editor as the case it means, so the file formats the same on every Mac. Click Import… on another Mac to load it into Settings. To apply the rules to a linked SQL folder instead, save the file in that folder as .sql-formatter.json. A file opened from the folder then formats with it rather than with Settings. The nearest .sql-formatter.json wins, from the file’s own folder up to the linked folder; nothing above the linked folder is read. A rules file that cannot be read stops Format Query with an error naming it. The npm sql-formatter package reads the same file, so one .sql-formatter.json drives both tools.
A key the file leaves out takes the default shown in the example, not your Settings value. For keywordCase that is upper, where sql-formatter keeps the case as written. A key only sql-formatter has, such as language or expressionWidth, is ignored. indentStyle takes sql-formatter’s values, standard, tabularLeft and tabularRight, and changes nothing here. Any value TablePro cannot read is an error that names its key.

A rules file from TablePro 0.83

A file exported by 0.83 uses older key names. Format Query and Import… refuse it with “The value of “indentStyle” is not valid.” Export it again from Settings, or rename the keys: The other keys keep their names.