Answer the question
In order to leave comments, you need to log in
How to escape characters before inserting in sql query?
Hello! There is a rather large raw sql query in a flask application. There is an ORM SQLAlchemy, but, as I said, the query is too large to write it using orms, and besides, the query text is collected on the fly, depending on various conditions. To avoid SQL injection, characters contained in variables must be escaped before being inserted into a query. How can I do that? Perhaps there are some other options on how to collect and execute the request? Variables are inserted into the query by normal string concatenation.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question