Skip to content

PostgresFrontendMessage: refactor encoding #381

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

Merged
merged 1 commit into from
Aug 4, 2023

Conversation

fabianfett
Copy link
Collaborator

Currently we use an explicit PostgresFrontendMessage when we encode those messages into the outgoing ByteBuffer. However this can be wasteful if we need to transform the data that we have to explicitly match the PostgresFrontendMessage type. We should instead have methods on the Encoder that match the message types. This patch achieves exactly this.

@fabianfett fabianfett added the semver-patch No public API change. label Aug 4, 2023
@codecov-commenter
Copy link

codecov-commenter commented Aug 4, 2023

Codecov Report

Merging #381 (93ca9c9) into main (718d154) will decrease coverage by 0.57%.
The diff coverage is 79.79%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #381      +/-   ##
==========================================
- Coverage   44.44%   43.88%   -0.57%     
==========================================
  Files         118      107      -11     
  Lines        8639     8596      -43     
==========================================
- Hits         3840     3772      -68     
- Misses       4799     4824      +25     
Files Changed Coverage Δ
...rces/PostgresNIO/New/PostgresFrontendMessage.swift 44.94% <0.00%> (-39.01%) ⬇️
...urces/PostgresNIO/New/PostgresChannelHandler.swift 62.28% <27.27%> (+1.22%) ⬆️
Sources/PostgresNIO/New/Messages/Startup.swift 100.00% <100.00%> (ø)
...stgresNIO/New/PostgresFrontendMessageEncoder.swift 100.00% <100.00%> (ø)

@fabianfett fabianfett force-pushed the ff-refactor-encoding branch from 70eb3c8 to 93ca9c9 Compare August 4, 2023 20:46
@fabianfett fabianfett merged commit 4fd297d into vapor:main Aug 4, 2023
@fabianfett fabianfett deleted the ff-refactor-encoding branch August 4, 2023 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver-patch No public API change.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants