Skip to content

Is the library SQL injection safe? #77

Discussion options

You must be logged in to vote

redshift_connector uses parameterized statements by default, as a protector against SQL injection.

cursor.execute("select * from my_table where some_col = %s", (some_value,))

Using parameterized statements is safer than using approaches such as string concatenation, shown below

cursor.execute("select * from my_table where some_col = {}".format("'hello world'")

Please let me know if there is anything else I can clarify.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Brooke-white
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