MagicStack / MagicStack/asyncpg
feat: allow connection with pre-configured socket
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Python
- Star
- 8.1k
- Fork
- 468
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
I'd like to add support for creating a postgres connection over an existing socket like object. In this approach startTLS can or cannot be used depending on the caller. This lines up similarly with what we have in Java ([socketFactory connection param](https://jdbc.postgresql.org/documentation/use/#connection-parameters), [driver code](https://github.com/pgjdbc/pgjdbc/blob/aff581fe806f1c1cdc8bcd9e5a981e37691b44b5/pgjdbc/src/main/java/org/postgresql/core/SocketFactoryFactory.java#L25-L47)), Go ([pgx DialFunc](https://pkg.go.dev/github.com/jackc/pgconn#DialFunc)) (these two are slightly different as they allow specifying a creator/generator func that creates the socket, while here we could just pass in the socket directly but the extent of the feat is the same), and other Python libraries ([pymysql](https://github.com/PyMySQL/PyMySQL/blob/main/pymysql/connections.py#L626), and [pg8000](https://github.com/tlocke/pg8000/pull/136))
The equivalent pymysql PR that introduced this change explains the feature really well https://github.com/PyMySQL/PyMySQL/pull/355
The benefit of this feature is that it allows the user to specify their own secure tunnel to connect over (such as ssh).
Is this sort of feat possible for asyncpg?
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách lần theo quá trình thiết lập kết nối của asyncpg và so sánh các tham chiếu đến socketFactory, DialFunc và PyMySQL được liên kết trong issue. Xác định socket hiện có và startTLS tùy chọn sẽ phù hợp với API như thế nào, sau đó xác minh việc hoàn tất bằng coverage cho cả hai lựa chọn TLS và các kết nối qua tunnel.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- postgresql, python
- Lĩnh vực
- databases
- 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
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 38/100