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

Utility to replace numbered sql parameters #135

Closed
patriknw opened this issue Nov 8, 2021 · 2 comments · Fixed by #170
Closed

Utility to replace numbered sql parameters #135

patriknw opened this issue Nov 8, 2021 · 2 comments · Fixed by #170
Assignees

Comments

@patriknw
Copy link
Member

patriknw commented Nov 8, 2021

To improve the code readability we can implement a small string search and replace utility that replaces $ with numbered $1, $2, $3.

@johanandren
Copy link
Member

Is it up to the r2dbc plugin to support named parameter to start with and the postgres one doesn't (if so, could we contribute that perhaps)?

@patriknw
Copy link
Member Author

patriknw commented Nov 8, 2021

In the end I want to bind with index because that is less lookups when binding parameters. Probably a very minor performance difference, but anyway.

@patriknw patriknw self-assigned this Dec 4, 2021
patriknw added a commit that referenced this issue Dec 4, 2021
* Replaces `?` with numbered `$1`, `$2` for bind parameters.
* Trims whitespace, including line breaks.
patriknw added a commit that referenced this issue Dec 8, 2021
* Replaces `?` with numbered `$1`, `$2` for bind parameters.
* Trims whitespace, including line breaks.
* internal because of suggestion of also supporting named parameters and that
  wouldn't be possible to add in a compatible way
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 a pull request may close this issue.

2 participants