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

Make PSQLDecodingContext generic #217

Merged
merged 3 commits into from
Feb 17, 2022

Conversation

fabianfett
Copy link
Collaborator

Motivation

Since we don't attach the JSONDecoder to the connection anymore and supply during decoding, we can now make the decoding generic over the supplied JSONDecoder.

Changes

  • Make PSQLDecodingContext generic over the JSONDecoder
  • Rename PSQLDecodingContext to PostgresDecodingContext

Result

  • We don't use an existential in the very hot code paths.

@codecov-commenter
Copy link

codecov-commenter commented Feb 17, 2022

Codecov Report

Merging #217 (08218a3) into main (3ee1245) will increase coverage by 4.00%.
The diff coverage is 81.81%.

@@            Coverage Diff             @@
##             main     #217      +/-   ##
==========================================
+ Coverage   43.04%   47.04%   +4.00%     
==========================================
  Files         119      119              
  Lines        8231     8226       -5     
==========================================
+ Hits         3543     3870     +327     
+ Misses       4688     4356     -332     
Flag Coverage Δ
unittests 47.04% <81.81%> (+4.00%) ⬆️

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

Impacted Files Coverage Δ
Sources/PostgresNIO/Postgres+PSQLCompat.swift 0.00% <0.00%> (ø)
Sources/PostgresNIO/New/Data/Int+PSQLCodable.swift 28.10% <40.00%> (+5.88%) ⬆️
...urces/PostgresNIO/New/Data/Array+PSQLCodable.swift 94.68% <100.00%> (+1.06%) ⬆️
...ources/PostgresNIO/New/Data/Bool+PSQLCodable.swift 95.34% <100.00%> (+4.65%) ⬆️
...urces/PostgresNIO/New/Data/Bytes+PSQLCodable.swift 73.52% <100.00%> (ø)
...ources/PostgresNIO/New/Data/Date+PSQLCodable.swift 89.28% <100.00%> (ø)
...ces/PostgresNIO/New/Data/Decimal+PSQLCodable.swift 74.19% <100.00%> (+6.45%) ⬆️
...urces/PostgresNIO/New/Data/Float+PSQLCodable.swift 76.66% <100.00%> (+3.33%) ⬆️
...ources/PostgresNIO/New/Data/JSON+PSQLCodable.swift 86.95% <100.00%> (ø)
...es/PostgresNIO/New/Data/Optional+PSQLCodable.swift 61.11% <100.00%> (-2.05%) ⬇️
... and 32 more

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.

Love it. Ship it! ❤️‍🔥

@fabianfett fabianfett merged commit e17c930 into vapor:main Feb 17, 2022
@fabianfett fabianfett deleted the ff-make-PSQLDecodingContext-generic branch February 17, 2022 23:05
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