Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass multiple filenames and --inplace to pgFormatter #50

Conversation

grantcox
Copy link
Contributor

pgFormatter supports passing multiple filenames, and the --inplace argument to update these directly. With these two changes, we can process many files in each pgFormatter execution, which is somewhat faster:

When using my local project with 480 SQL files (approx 1.1MB total)

  • The current "one at a time" takes 38 seconds
  • Doing in chunks of 10 takes 19.2 seconds
  • Doing in chunks of 25 (default in this PR) takes 17.8 seconds
  • Doing in chunks of 100 takes 17.3 seconds

@grantcox grantcox changed the title Pass multiple filenames inplace to pgformatter Pass multiple filenames and --inplace to pgFormatter Oct 10, 2023
Copy link
Owner

@bradymholt bradymholt left a comment

Choose a reason for hiding this comment

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

Thanks @grantcox - looks great 👍

@bradymholt bradymholt merged commit 7c0a87e into bradymholt:main Oct 11, 2023
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.

2 participants