Skip to content

migrations: SQL formatting#1782

Open
hdonnay wants to merge 1 commit intoquay:mainfrom
hdonnay:feature/not-affected/sql-formatting
Open

migrations: SQL formatting#1782
hdonnay wants to merge 1 commit intoquay:mainfrom
hdonnay:feature/not-affected/sql-formatting

Conversation

@hdonnay
Copy link
Member

@hdonnay hdonnay commented Mar 19, 2026

This change adds a generate directive that runs an SQL formatter via go run. It also runs the formatter over the existing SQL.

@hdonnay hdonnay requested a review from a team as a code owner March 19, 2026 21:40
return nil
}

//go:generate find . -name *.sql -exec go run github.com/wasilibs/go-sql-formatter/v15/cmd/sql-formatter@latest --language postgresql --fix {} ;
Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only "real" change, everything else is whitespace changes as a result of running go generate.

@hdonnay hdonnay added this to the Not Affected milestone Mar 19, 2026
This change adds a `generate` directive that runs an SQL formatter via
`go run`. It also runs the formatter over the existing SQL.

See-also: https://issues.redhat.com/browse/CLAIRDEV-85
Change-Id: I7ae14f596154b6f9bec66800c388bfe5ce732ca4
Signed-off-by: Hank Donnay <hdonnay@redhat.com>
@hdonnay hdonnay force-pushed the feature/not-affected/sql-formatting branch from 7172a7e to a3c8df5 Compare March 24, 2026 19:05
Copy link

@dcaravel dcaravel left a comment

Choose a reason for hiding this comment

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

LGTM - can't say I agree with all the formatting decisions made by the lib, but that's a me problem ;)

return nil
}

//go:generate find . -name *.sql -exec go run github.com/wasilibs/go-sql-formatter/v15/cmd/sql-formatter@latest --language postgresql --fix {} ;

Choose a reason for hiding this comment

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

For consideration - is it worth referencing a specific tag vs. latest here? Thinking of risk if repo is compromised, a tag + sumdb may help detect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants