You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But this is not very readable. Would be nice to support some other patterns, for example:
select*where grade >= %(grade)d
and is_allowed = %(is_allowed:true)b
I know that psycopg2 supports only string parameters, but it does not seem too difficult to manually handle simple cases (like numbers and booleans) while still caring about SQL injections.
For now, I've proposed pull request #148 to refactor the named-parameter feature within the library, so that developpers can easily extend it according to their needs. That would be usefull in any case.
I think it would also be usefull that simple cases (like those mentionned above) be part of the library. What do you think?
The text was updated successfully, but these errors were encountered:
Passing non-string parameters and default values can be achieved today using something like:
But this is not very readable. Would be nice to support some other patterns, for example:
I know that
psycopg2
supports only string parameters, but it does not seem too difficult to manually handle simple cases (like numbers and booleans) while still caring about SQL injections.For now, I've proposed pull request #148 to refactor the named-parameter feature within the library, so that developpers can easily extend it according to their needs. That would be usefull in any case.
I think it would also be usefull that simple cases (like those mentionned above) be part of the library. What do you think?
The text was updated successfully, but these errors were encountered: