We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
.sql-formatter.json
Describe the bug
The .sql-formatter.json in the current directory is ignored, unless specified with --config:
--config
$ cat .sql-formatter.json { "language": "postgresql" } $ echo "SELECT 2 :: numeric AS foo;" | sql-formatter Error: Parse error: Unexpected ":: numeric" at line 1 column 10. This likely happens because you're using the default "sql" dialect. If possible, please select a more specific dialect (like sqlite, postgresql, etc). $ echo "SELECT 2 :: numeric AS foo;" | sql-formatter --config .sql-formatter.json SELECT 2::numeric AS foo;
I suspect that this is caused by this:
sql-formatter/bin/sql-formatter-cli.cjs
Line 102 in 2c49533
Which means it defaults to searching in the installed directory instead of the current directory.
Expected behavior .sql-formatter.json should be automatically read
Actual behavior .sql-formatter.json is not automatically read
Usage
echo "SELECT 2 :: numeric AS foo;" | sql-formatter
15.4.2
The text was updated successfully, but these errors were encountered:
Fix config file search location (#788)
c4b011e
Fix: #787
Fixed in 15.4.4
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Describe the bug
The
.sql-formatter.json
in the current directory is ignored, unless specified with--config
:I suspect that this is caused by this:
sql-formatter/bin/sql-formatter-cli.cjs
Line 102 in 2c49533
Which means it defaults to searching in the installed directory instead of the current directory.
Expected behavior
.sql-formatter.json
should be automatically readActual behavior
.sql-formatter.json
is not automatically readUsage
echo "SELECT 2 :: numeric AS foo;" | sql-formatter
PostgreSQL
15.4.2
The text was updated successfully, but these errors were encountered: