Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL injections #275

Closed
petrucci89 opened this issue Mar 19, 2018 · 3 comments
Closed

SQL injections #275

petrucci89 opened this issue Mar 19, 2018 · 3 comments
Labels

Comments

@petrucci89
Copy link

Have this library any tools for protecting sql injections?

If no, maybe somebody recommends how you solve this problem

Thx!

@elprans
Copy link
Member

elprans commented Mar 20, 2018

asyncpg supports native PostgreSQL syntax for parameter substitution:

v = await conn.fetchrow("SELECT * FROM table WHERE id = $1", my_id)

As long as you pass your parameters like that and never build a query string from user inputs, you should be safe from SQL injection.

@petrucci89
Copy link
Author

Thx a lot!

@fugacityengr
Copy link

Is this possible for preprared statements?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants