Created
January 24, 2015 02:08
-
-
Save nickretallack/e7288159f115f4c386be to your computer and use it in GitHub Desktop.
Unfortunately, value1 gets clobbered by value2 because they both bind to value. Is there a general purpose solution to this? My real query is much more complex and dynamically constructed than this and can't be simplified by any tricks. What I want is unique parameter names that never clobber each other.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
db.session.query(MyTable).filter( | |
db.or_( | |
db.text("(my_table.json_field ->> key)::text = :value").bindparams(value=value1), | |
db.text("(my_table.json_field ->> key)::text = :value").bindparams(value=value2), | |
) | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment