aws / aws/amazon-redshift-python-driver

[Feature] Support SQL string composition

Đang mở
#168 1 bình luận 5 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Python
Star
220
Fork
86
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

The redshift connector currently supports parameterised queries (aka bind variables) which is great.

However some of our use cases require other parts of a Redshift SQL query to be dynamically created. These include components such as the table name, the schema... and are commonly referred to as Identifiers. For example ``` f"SELECT * FROM {schema}.{table}"```

Other libraries such as [pg8000](https://github.com/tlocke/pg8000#many-sql-statements-can-t-be-parameterized) and [psycopg](https://www.psycopg.org/docs/sql.html) have developed modules to escape these variables via identifiers.

Beyond usability, the main advantage of this approach is that it helps with SQL injection attacks.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start by reviewing the connector's existing parameterised-query support, then compare the identifier-composition approaches documented by pg8000 and psycopg. Done means users can safely compose dynamic Redshift identifiers such as schemas and table names, with protection against SQL injection.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python, sql
Lĩnh vực
databases, security
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.