Skip to content

DOC: Add docs for read_sql to avoid sql injection #56546

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

Merged
merged 9 commits into from
Jan 17, 2024
Merged
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pandas/io/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,6 +652,14 @@ def read_sql(
read_sql_table : Read SQL database table into a DataFrame.
read_sql_query : Read SQL query into a DataFrame.

Notes
-----
``pandas`` does not attempt to sanitize SQL statements;
instead it simply forwards the statement you are executing
to the underlying driver, which may or may not sanitize from there.
Please refer to the underlying driver documentation for any details.
Generally, be wary when accepting statements from arbitrary sources.

Examples
--------
Read data from SQL via either a SQL query or a SQL tablename.
Expand Down