sqlescapy-1.0.1
توضیحات
Python module to escape SQL special characters and quotes in strings
| ویژگی | مقدار |
|---|---|
| سیستم عامل | OS Independent |
| نام فایل | sqlescapy-1.0.1 |
| نام | sqlescapy |
| نسخه کتابخانه | 1.0.1 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | Imad ElOuajib |
| ایمیل نویسنده | elouajib.im@gmail.com |
| آدرس صفحه اصلی | https://github.com/elouajib/sqlescapy |
| آدرس اینترنتی | https://pypi.org/project/sqlescapy/ |
| مجوز | - |
Python module to escape SQL special characters and quotes in strings
install:
`pip install sqlescapy`
Assuming `dangerous_input` is a variable coming from a user input, a bad actor can exploit it to start injecting your database.
```python
from sqlescapy import sqlescape
dangerous_input = "JhonWick'"
protected_raw_statement = "\"foo_table\".username='%s'" % sqlescape(dangerous_input)
protected_query = """
SELECT "foo_table".*, "bar_table".*
FROM "foo_table", "bar_table"
WHERE "foo_table".id = "bar_table".id
AND %s
""" % protected_raw_statement
```
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=2.7 | Python |
نحوه نصب
نصب پکیج whl sqlescapy-1.0.1:
pip install sqlescapy-1.0.1.whl
نصب پکیج tar.gz sqlescapy-1.0.1:
pip install sqlescapy-1.0.1.tar.gz