Skip to content
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

Add text protocol based query method #14

Merged
merged 6 commits into from
May 23, 2023
Merged

Add text protocol based query method #14

merged 6 commits into from
May 23, 2023

Conversation

kelvich
Copy link

@kelvich kelvich commented May 16, 2023

Add query_raw_txt client method

It takes all the extended protocol params as text and passes them to
postgres to sort out types. With that we can avoid situations when
postgres derived different type compared to what was passed in arguments.
There is also propare_typed method, but since we receive data in text
format anyway it makes more sense to avoid dealing with types in params.

This way we also can save on roundtrip and send Parse+Bind+Describe+Execute
right away without waiting for params description before Bind.

Use text protocol for responses -- that allows to grab
postgres-provided serializations for types.

Catch command tag.

@petuhovskiy petuhovskiy self-requested a review May 18, 2023 15:33
@kelvich kelvich requested a review from jawj May 18, 2023 15:34
@kelvich kelvich force-pushed the sk/query_raw_txt branch from 1c4958a to ca16d8c Compare May 18, 2023 23:29
@kelvich kelvich marked this pull request as ready for review May 18, 2023 23:31
@kelvich kelvich changed the title Sk/query raw txt Add text protocol based query method May 18, 2023
@kelvich kelvich force-pushed the sk/query_raw_txt branch from 885c1be to 4e30c69 Compare May 19, 2023 10:38
kelvich added 3 commits May 19, 2023 16:07
It takes all the extended protocol params as text and passes them to
postgres to sort out types. With that we can avoid situations when
postgres derived different type compared to what was passed in arguments.
There is also propare_typed method, but since we receive data in text
format anyway it makes more sense to avoid dealing with types in params.

This way we also can save on roundtrip and send Parse+Bind+Describe+Execute
right away without waiting for params description before Bind.

Also use text protocol for responses -- that allows to grab
postgres-provided serializations for types.
@kelvich kelvich force-pushed the sk/query_raw_txt branch from 880728e to f898c2e Compare May 19, 2023 13:07
@petuhovskiy petuhovskiy merged commit 2e9b5f1 into neon May 23, 2023
@petuhovskiy petuhovskiy deleted the sk/query_raw_txt branch May 23, 2023 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants