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

Make sqlc.embed compatible with pgFormatter and sql-formatter #3431

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Dragon-Huang0403
Copy link

What does this PR fixed?

  • This PR addresses issues with SQL formatting tools pgFormatter and sql-formatter. These tools are used to format SQL, similar to how go fmt formats Go code.
  • Both formatters, by default, add spaces before function calls. This changes sqlc.embed(name) to sqlc.embed (name), which sqlc cannot parse correctly:
$ cd example/batch

$ sqlc generate                                                                                                                                                                                                                                   
> # package batch
> postgresql/query.sql:10:1: edited query syntax is invalid: syntax error at or near ")"

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.

1 participant