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 new Postgres decoding public #244

Merged
merged 4 commits into from
Mar 8, 2022

Conversation

fabianfett
Copy link
Collaborator

Motivation

After a long time in the works, we finally want to make the new Postgres decoding public.

Changes

  • Add new protocol PostgresArrayDecodable that inherits from PostgresDecodable. A type that conforms to PostgresArrayDecodable can be decoded into an array of its own type from a Postgres array.
  • Make PostgresCell decode method public
  • Make PostgresRow decode methods public (we use @_alwaysEmitIntoClient here, to keep binary sizes small)
  • Mark a number of things @usableFromInlineable to allow better perf

Result

Faster code for users!

@fabianfett fabianfett requested a review from gwynne March 6, 2022 11:04
@codecov-commenter
Copy link

codecov-commenter commented Mar 6, 2022

Codecov Report

Merging #244 (f441518) into main (2998b1c) will increase coverage by 4.07%.
The diff coverage is 66.66%.

@@            Coverage Diff             @@
##             main     #244       /-   ##
==========================================
  Coverage   39.67%   43.75%    4.07%     
==========================================
  Files         115      115              
  Lines        9497     9512       15     
==========================================
  Hits         3768     4162      394     
  Misses       5729     5350     -379     
Flag Coverage Δ
unittests 43.75% <66.66%> ( 4.07%) ⬆️

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

Impacted Files Coverage Δ
Sources/PostgresNIO/Data/PostgresRow.swift 50.00% <ø> ( 1.02%) ⬆️
...es/PostgresNIO/New/Data/Bool PostgresCodable.swift 95.34% <ø> ( 4.65%) ⬆️
...s/PostgresNIO/New/Data/Bytes PostgresCodable.swift 73.52% <ø> (ø)
...es/PostgresNIO/New/Data/Date PostgresCodable.swift 89.28% <ø> (ø)
...PostgresNIO/New/Data/Decimal PostgresCodable.swift 74.19% <ø> ( 6.45%) ⬆️
...s/PostgresNIO/New/Data/Float PostgresCodable.swift 76.66% <ø> ( 3.33%) ⬆️
...ces/PostgresNIO/New/Data/Int PostgresCodable.swift 30.71% <ø> ( 5.22%) ⬆️
.../PostgresNIO/New/Data/String PostgresCodable.swift 100.00% <ø> (ø)
...es/PostgresNIO/New/Data/UUID PostgresCodable.swift 98.30% <ø> (ø)
...s/PostgresNIO/New/Extensions/ByteBuffer PSQL.swift 100.00% <ø> (ø)
... and 37 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.

I like it 😁

@fabianfett fabianfett merged commit ba0d2bb into vapor:main Mar 8, 2022
@fabianfett fabianfett deleted the ff-make-PostgresDecodable-public branch March 8, 2022 20:26
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