sunng87 / pgwire

PostgreSQL wire protocol implemented as a rust library.
Apache License 2.0
531 stars 40 forks source link

ClientInfo property not supported. #160

Closed KKould closed 8 months ago

KKould commented 8 months ago

I tried to run the Sqlite in Example and connect using the database gui in IDEA, but it prompted ClientInfo property not supported.

How should I make it support this?

image

ref: https://github.com/sunng87/pgwire/issues/99

sunng87 commented 8 months ago

@KKould Thank you for reporting this. I don't have an IDEA so I may need more information from you.

  1. Did you seen any panic from the server side?
  2. Could you please use wireshark to capture the traffic when you do connection test?
KKould commented 8 months ago

@KKould Thank you for reporting this. I don't have an IDEA so I may need more information from you.

  1. Did you seen any panic from the server side?
  2. Could you please use wireshark to capture the traffic when you do connection test?
  1. After fixing it, the error will no thrown. ref: https://github.com/sunng87/pgwire/pull/163
  2. I tried using WireShake but it looks like there is no message

Tips: This is my first time using this, maybe I'm using it incorrectly image

sunng87 commented 8 months ago

Thank you! Are you capturing the right net interface? If your server is listening to localhost, you need to capture loopback.

KKould commented 8 months ago

Oh, it seems I chose the wrong network card. I exported this file from wireshark.

sqlite.json

sunng87 commented 8 months ago

Fixed in #163

KKould commented 8 months ago

@sunng87 There were some misunderstandings. After I used this pr to fix them, I just prevented the server from throwing errors, but it still prompted ClientInfo property not supported.

sunng87 commented 8 months ago

Sorry, let me reopen this. I will find time to analyse your captured packets.

sunng87 commented 8 months ago

From the paccap I saw IDEA sends a query select version() via extended subprotocol under the hood. This query is not supported by sqlite so it does not reply a result that IDEA expects.

KKould commented 8 months ago

From the paccap I saw IDEA sends a query select version() via extended subprotocol under the hood. This query is not supported by sqlite so it does not reply a result that IDEA expects.

Is there a way for sqlite to support it?

sunng87 commented 8 months ago

We don't have to support it in sqlite. You can add a layer on top of statement::query to process these queries out of sqlite. If you are interested in this feature, a PR is welcomed. Also you may want to do the same thing on duckdb example.