Closed ghost closed 3 years ago
This query works:
-- name: FindAllArticles :many select * from articles where name = pggen.arg('Name')
This one, generated by our formatter with the default settings, does not work (notice the space between arg and ()
arg
(
-- name: FindAllArticles :many select * from articles where name = pggen.arg ('Name')
I think, this is related to this line, although I am not sure. https://github.com/jschaf/pggen/blob/44c162198f6e49750389d9b0befbc66d741ac6da/internal/parser/parser.go#L222
And btw, thanks for this project, I love it! 💜
Thanks for reporting! I added hardcoded support for 1 space after pggen.arg. The correct approach is to use an expression parser, but the hardcoded matching logic is probably good enough.
pggen.arg
This query works:
This one, generated by our formatter with the default settings, does not work (notice the space between
arg
and(
)I think, this is related to this line, although I am not sure. https://github.com/jschaf/pggen/blob/44c162198f6e49750389d9b0befbc66d741ac6da/internal/parser/parser.go#L222
And btw, thanks for this project, I love it! 💜