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

Run recursively on directory #309

Open
kevinmichaelchen opened this issue Mar 23, 2023 · 1 comment
Open

Run recursively on directory #309

kevinmichaelchen opened this issue Mar 23, 2023 · 1 comment

Comments

@kevinmichaelchen
Copy link

Is it possible to run this recursively on all SQL files under a directory?

@darold
Copy link
Owner

darold commented Mar 24, 2023

Something like that should do the work:

find mydir/ -name '*.sql' | xargs -i pg_format -o {}.out {}

the formatted files will have the extension .out or if you want to override the existing SQL files you can do something like that:

find mydir/ -name '*.sql' | xargs -i pg_format -i {}

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

No branches or pull requests

2 participants