Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

support `Cursor` attribute to provide ANSI SQL State Code

Đang mở
#220 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

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

Hướng nghiên cứu

Issue này nêu ConnectionManager.get_response() trong dbt và thông báo CommandComplete của PostgreSQL, nhưng không có tệp hoặc test nào trong repository. Hãy bắt đầu bằng cách xác định phần triển khai cursor và cách xử lý metadata của các command đã hoàn tất, sau đó so sánh hành vi của các driver hiện có với các thuộc tính statusmessage và sqlstate được liệt kê. Công việc được xem là hoàn tất khi cursor cung cấp thông tin trạng thái SQL và các chi tiết của operation bị ảnh hưởng được giữ lại đối với các command được hỗ trợ.

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

Mô tả

While a Cursor attribute providing SQL State Code is not officially a part of PEP 249: Python DB API 2.0 spec, there is an ANSI-standardized "SQL state code".

Many database drivers provide this as a Cursor attribute, dbt was able to depend on these drivers to provide it for ConnectionManager.get_response() method, which will report to users after successful queries the kind of operation performed (SELECT, INSERT, CREATE) and the numbers of rows affected. Originally the Redshift adapter for dbt, was supported by the psycopg2 driver, which provides this information in statusmessage.

As reported in https://github.com/dbt-labs/dbt-redshift/issues/785, after migrating the driver dependency to redshift-connector, users are in a degraded state and receive less information than previously due to the SQL state not being available.

Support for SQL state amongst popular analytics database drivers
Driver Cursor attribute (docs)
psycopg2 statusmessage
snowflake-connector-python sqlstate
Ideal implementation

Postgres's CommandComplete message

Command Tag rows indicates the number of rows
INSERT INSERT 0 rows inserted
DELETE DELETE rows deleted
UPDATE UPDATE rows updated
MERGE MERGE rows inserted, updated, or deleted
SELECT / CREATE TABLE AS SELECT rows retrieved
MOVE MOVE rows ursor's position has been changed by
FETCH FETCH rows that have been retrieved from the cursor
COPY COPY rows copied, only in PostgreSQL 8.2 and later
Ngôn ngữ chính
Python
Star
220
Fork
89
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của aws/amazon-redshift-python-driver

Tất cả issue của aws/amazon-redshift-python-driver

Issue tương tự

Thêm issue về Python

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.