-
Notifications
You must be signed in to change notification settings - Fork 855
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
Ability to use ":" instead of "@" in named args #2177
Comments
Just add ":" to here https://github.com/jackc/pgx/blob/master/named_args.go#L110 |
PR #2178 Before(bad)After (good) |
But even if the parser was fixed I'd rather there only be way to denote a named argument. However, |
@jackc I see your point, I'll make the edits according to your concerns. |
The code looks more solid now. But as I said above, I want to keep the simplicity of only having a single delimiter for named arguments. I think this support for |
@jackc Are you sure that library users will be comfortable being forced to adjust to your understanding of good? There seem to be some people who don't like it when their IDE frowns on '@' substitutions. Maybe we should pay attention to the convenience for the end user of the library? |
@KoNekoD Are you sure that library users will be comfortable being forced to adjust to your understanding of good? There seem to be some people who know the difference between |
Just check if the successor (the next character) is also a colon ':' if it is then it is a parameter so do not replace the value. Example: select id::integer as id from person where id = :id In id::integer contains '::' when it finds the first ':' you check if the next character is also a ':' so it will be a cast and not a parameter. |
Add ability to use ":" instead of "@" in named args
Sql linter in golang like this
The text was updated successfully, but these errors were encountered: