Skip to content

How do I execute a query with tuple comparison? #224

Discussion options

You must be logged in to vote

Well, you passed a string as a parameter, and that's where the quote came from.
If you want to dynamically modify raw queries, you can't do that by modifying query parameters. You'll need to modify the SQL query string.
This line:

WHERE (push_notification_message.template_id, push_notification_message.receipient_id) IN ((#1, #2), (#3, #4));

And add as many (#f, #s) pairs as needed.

This is tedious and error-prone work and dynamic modifying sql string is best to be done with SQL builder.
For instance:

pairs := []Expression{}

// some custom logic to dynamically specify template_id, receipient_id
pairs = append(pairs, ROW(Int(1), Int(33))
pairs = append(pairs, ROW(Int(1), Int(33))

stmt := S…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@vamshiaruru-virgodesigns
Comment options

Answer selected by go-jet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants