Skip to content

Make sqlc.embed compatible with pgFormatter #3907

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

Open
alexstuckey opened this issue Mar 29, 2025 · 1 comment
Open

Make sqlc.embed compatible with pgFormatter #3907

alexstuckey opened this issue Mar 29, 2025 · 1 comment
Labels
📚 postgresql bug Something isn't working

Comments

@alexstuckey
Copy link

Version

1.28.0

What happened?

Similar to issue #2130, some SQL formatters including pgFormatter and sql-formatter insert a space between the function name and the opening bracket, causing an issue for sqlc.

This was resolved for sqlc.arg and sqlc.slice in #2250, but it appears the implementation of sqlc.embed is distinct and hasn't benefit from the fix.

Relevant log output

query.sql:6:7: edited query syntax is invalid: syntax error at or near ")"

Database schema

SQL queries

sqlc.embed (authors)

Configuration

Playground URL

https://play.sqlc.dev/p/1bfbe9499152c12cb4127f077004899333dd1eba3970c398c62fba063a33894e

What operating system are you using?

No response

What database engines are you using?

PostgreSQL

What type of code are you generating?

Go

@alexstuckey alexstuckey added the bug Something isn't working label Mar 29, 2025
@yunx-lee
Copy link

yunx-lee commented Apr 1, 2025

there is a space between "sqlc.embed" and "(authors)", remove the space then sqlc work.
but, when we write and save sql in ide, ide will insert a space between the function name and the next left parenthesis automatically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📚 postgresql bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants