Skip to content

Configurable SQL formatter rules #2529

Closed

Description

@datlechin

Problem

The formatter has one style. Settings > Editor > Keyword case decides the case it writes keywords in (customization/editor-settings.mdx:45), and everything else is fixed: two-space indent, a line per clause, one SELECT column per line, trailing commas, and each JOIN on its own line (features/sql-editor.mdx:183-204). The formatter already has an indent size option, but no setting reaches it and it ignores the editor's Tab width (apple/TablePro/Core/Services/Formatting/SQLFormatterTypes.swift:48-54).

A team whose house style differs on indent width, comma placement or where a join breaks has to reformat by hand after every use, or stop using the formatter.

Proposed solution

  • A Formatter section in Settings > Editor: indent width and character (or follow Tab width), keyword and function case, leading or trailing commas, line width, a break before or after each join, and whether to align aliases.
  • A live preview beside the options, in the current editor theme.
  • Export and import the rule set as a file, so a team can share one.
  • Read a .sql-formatter.json from a linked SQL folder when one is present, for the files opened from that folder.

Done when: each option changes the output of Format Query as the preview shows, and a rule file imported on a second Mac formats the same statement identically.

Alternatives considered

Format elsewhere and paste the result back.

Platform

macOS

Related database type

N/A / General

Activity

  1. added
    enhancement
    on Aug 26, 2026
  2. added
    platform-macos
    on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementplatform-macos

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions