Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

INSERT INTO statements now place the column list on an indented new line instead of inline with the table name.

Changes

  • Modified InsertStmt.FormatSQL() to insert break and indentation before column names in beautify mode
  • Updated golden test fixtures to reflect new formatting

Example

Before:

INSERT INTO t0 (user_id, message, timestamp, metric)
VALUES
  (?, ?, ?, ?);

After:

INSERT INTO t0
  (user_id, message, timestamp, metric)
VALUES
  (?, ?, ?, ?);

Compact format mode unchanged.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add an ident break for INSERT INTO</issue_title>
<issue_description>The current beautiful format is:

INSERT INTO t0 (user_id, message, timestamp, metric)
VALUES
  (?, ?, ?, ?),
  (?, ?, ?, ?),
  (?, ?, ?, ?),
  (?, ?, ?, ?);

And expected to be:

INSERT INTO t0
  (user_id, message, timestamp, metric)
VALUES
  (?, ?, ?, ?),
  (?, ?, ?, ?),
  (?, ?, ?, ?),
  (?, ?, ?, ?);
```</issue_description>

## Comments on the Issue (you are @copilot in this section)

<comments>
</comments>


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Modified InsertStmt.FormatSQL() to add a line break and indentation
before the column names list in beautify mode. This matches the
expected formatting where column names appear on a new line with
proper indentation after the table name.

Co-authored-by: git-hulk <4987594+git-hulk@users.noreply.github.com>
Copilot AI changed the title [WIP] Add ident break for INSERT INTO statements Add line break before column list in INSERT INTO formatting Feb 13, 2026
Copilot AI requested a review from git-hulk February 13, 2026 03:16
@git-hulk git-hulk marked this pull request as ready for review February 13, 2026 03:27
Copilot AI review requested due to automatic review settings February 13, 2026 03:27
@coveralls
Copy link

Pull Request Test Coverage Report for Build 21973256174

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 3 of 3 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.006%) to 51.146%

Totals Coverage Status
Change from base Build 21971919969: 0.006%
Covered Lines: 8077
Relevant Lines: 15792

💛 - Coveralls

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request modifies the SQL formatter for INSERT INTO statements to place the column list on an indented new line in beautify mode, improving readability for statements with many columns. The change aligns with the formatting request in issue #240.

Changes:

  • Modified InsertStmt.FormatSQL() to add line break and indentation before column names in beautify mode
  • Updated 5 golden test fixtures to reflect the new formatting pattern

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.

Show a summary per file
File Description
parser/format.go Added Break(), Indent(), and Dedent() calls around column name formatting to create indented newline
parser/testdata/dml/format/beautify/insert_with_placeholder.sql Updated expected beautified output with column list on indented new line
parser/testdata/dml/format/beautify/insert_with_keyword_placeholder.sql Updated expected beautified output with column list on indented new line
parser/testdata/dml/format/beautify/insert_with_format.sql Updated expected beautified output with column list on indented new line
parser/testdata/dml/format/beautify/insert_values.sql Updated expected beautified output with column list on indented new line
parser/testdata/dml/format/beautify/insert_select_without_from.sql Updated expected beautified output with column list on indented new line

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@git-hulk git-hulk merged commit 1cf1e3d into master Feb 13, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an ident break for INSERT INTO

3 participants