-
-
Notifications
You must be signed in to change notification settings - Fork 40
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
Transactions support #79
Comments
At the moment, pgwire only parses the wire protocol and developer has to implement those sql commands sent over the protocol. You can create a struct that implement both I might add an additional helper layer on top of current API layer for transaction support in future. |
Hi @sunng87 I also encountered a similar issue while trying to implement a server with transaction support and have a question. In a transaction, a processor must process e.g. 1. I expected something like connection ID to associate those queries but I couldn't find any. Is it currently impossible? |
I think you can use socket address for connection, it can be fetched from Also there is a metadata hashmap in |
I noticed transactions are not supported, at least when testing with
tokio-postgres
.My
pgwire
handler receives aBEGIN
statement and it's handled by theSimpleQueryHandler
implementation. Then the single statement I have in the transaction is handled by theExtendedQueryHandler
. When I finally get totx.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:
The text was updated successfully, but these errors were encountered: