-
Notifications
You must be signed in to change notification settings - Fork 2
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
Replace the bind method with named parameter #3
Comments
If this this pull request is accepted, it will be easy to add any bindings engine as named placeholder. |
Having thought about it, I wonder what would be the point of making a binding when it would be enough to write down the named parameter yourself… |
You don't know beforehand which query params are to be expected, due to potential if-statements/conditionals in the template. We cannot deduce which query parameters the generated query expects without the bind method. |
OK, I understand, you expect a universal binding engine. I don't think the actual bind engine should be replaced by a named bind because this will introduce a strong dependency with sqlx or other ORM-like. Note that it will be impossible that Why the binding engine will not replace |
It might be a good idea to replace the current
{{bind .Id}}
method with typical named parameters e.g.:id
.sqlx
supports it https://github.com/jmoiron/sqlx/blob/a62bc6088664eb854c3d5ebbd08a1ffd59662ef1/named.go#L331It would probably increase the memory usage as well as cpu utilization, but it might be worth with.
The text was updated successfully, but these errors were encountered: