Transactions support
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Read the SimpleQueryHandler and ExtendedQueryHandler implementations and the example using tokio_postgres::connect in the issue. Trace how a BEGIN and the subsequent query are dispatched and how connection state is shared. Done means a transaction can execute the shown query and commit successfully; the issue gives no file names or tests to start from.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
I noticed transactions are not supported, at least when testing with tokio-postgres.
My pgwire handler receives a BEGIN statement and it's handled by the SimpleQueryHandler implementation. Then the single statement I have in the transaction is handled by the ExtendedQueryHandler. When I finally get to tx.commit().await, there's no transaction to commit because all of these things are disconnected.
Is there a way to handle transactions? I figure it might be possible by keeping a record when we get a BEGIN and somehow associate it with the incoming connection and sharing that information between the simple and extended query handler. It seemed like a lot of work though.
Example test code:
let (mut pg, connection) = tokio_postgres::connect(
format!("host={} port={}", pg_addr.ip(), pg_addr.port()).as_str(),
NoTls,
)
.await?;
tokio::spawn(async move {
if let Err(e) = connection.await {
eprintln!("connection error: {e}");
}
});
let rows = {
let tx = pg.transaction().await?;
let rows = tx.query("SELECT * FROM sqlite_master;", &[]).await?;
tx.commit().await?;
rows
};
- Ngôn ngữ chính
- Rust
- Star
- 805
- Fork
- 88
- Merge trung bình
- 1 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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.
Issue khác của sunng87/pgwire
-
`chrono` is unmaintainedCó thể đã có người làm @sunng87 đã nhận 7 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
sunng87/pgwire#490 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 42/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Check RustCrypto for tls and signature facade apiCó thể đã có người làm @sunng87 đã nhận 82 ngày trước. Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
sunng87/pgwire#447 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
sunng87/pgwire#440 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của sunng87/pgwire
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
libracoder/kiri#935 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Node's `index.d.ts` declares no constructor for `VirtxError`, so TypeScript rejects its argumentsĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 90/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày