Skip to content

Add PSQLRow multi decode #222

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 2 commits into from
Feb 18, 2022

Conversation

fabianfett
Copy link
Collaborator

Follow up to #221 and required to make #219 easier to review.

Motivation

We want to efficiently parse Postgres types back into Swift types. The best way to do this is by iterating the ByteBuffer exactly once and calling decode for every row.

Changes

  • Add a bash script that does the code generation for PSQLRow decode methods for us.

Result

It becomes very cheap to decode a complete PSQLRow.

@fabianfett fabianfett requested a review from gwynne February 18, 2022 08:39
@codecov-commenter
Copy link

codecov-commenter commented Feb 18, 2022

Codecov Report

Merging #222 (c453ac1) into main (4937286) will decrease coverage by 0.72%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main     #222      +/-   ##
==========================================
- Coverage   43.19%   42.46%   -0.73%     
==========================================
  Files         119      120       +1     
  Lines        8210     9252    +1042     
==========================================
+ Hits         3546     3929     +383     
- Misses       4664     5323     +659     
Flag Coverage Δ
unittests 42.46% <0.00%> (-0.73%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
Sources/PostgresNIO/New/PSQLRow-multi-decode.swift 0.00% <0.00%> (ø)
...urces/PostgresNIO/New/Data/Array+PSQLCodable.swift 94.68% <0.00%> (+1.06%) ⬆️
...rces/PostgresNIO/New/Extensions/Logging+PSQL.swift 19.60% <0.00%> (+1.42%) ⬆️
Sources/PostgresNIO/New/PSQLConnection.swift 31.68% <0.00%> (+1.98%) ⬆️
...s/PostgresNIO/Message/PostgresMessageDecoder.swift 95.45% <0.00%> (+2.27%) ⬆️
...es/PostgresNIO/New/PSQLBackendMessageDecoder.swift 93.28% <0.00%> (+2.98%) ⬆️
...urces/PostgresNIO/New/Messages/ErrorResponse.swift 32.30% <0.00%> (+3.07%) ⬆️
...urces/PostgresNIO/New/Data/Float+PSQLCodable.swift 76.66% <0.00%> (+3.33%) ⬆️
Sources/PostgresNIO/New/PSQLBackendMessage.swift 96.63% <0.00%> (+3.36%) ⬆️
...ources/PostgresNIO/Data/PostgresData+Numeric.swift 70.44% <0.00%> (+3.64%) ⬆️
... and 19 more

@fabianfett fabianfett force-pushed the ff-add-psqlrow-multi-decode branch from dc83fb2 to c453ac1 Compare February 18, 2022 10:10
Copy link
Member

@gwynne gwynne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll let the bash script pass 😉

@fabianfett fabianfett merged commit f588870 into vapor:main Feb 18, 2022
@fabianfett fabianfett deleted the ff-add-psqlrow-multi-decode branch February 18, 2022 10:30
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