Skip to content

How to properly prevent SQL injection? #1120

Answered by elprans
2br-2b asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, passing data in arguments is always safe.

This, on the other hand is NOT:

v = await conn.fetchrow(f"SELECT * FROM table WHERE username = '{user_provided_string}'")

Replies: 1 comment

Comment options

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