Dynamic SQL generation #1782
Dynamic SQL generation
#1782
-
Hi, fairly new gopher here :) How can i achieve something like this:
and then will pass this args I manage to get Thank you! |
Beta Was this translation helpful? Give feedback.
Answered by
jackc
Oct 27, 2023
Replies: 1 comment 3 replies
-
This is a PostgreSQL issue.
If you whitelist safe values for the variable holding |
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
omi-donlimit
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is a PostgreSQL issue.
ASC
andDESC
are not values, they are part of the SQL statement. Bound parameters must be values, they cannot be part of the SQL statement.If you whitelist safe values for the variable holding
ASC
orDESC
you could build the SQL string.