Skip to content

Add async option to PSQLRowStream #206

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 10 commits into from
Feb 17, 2022

Conversation

fabianfett
Copy link
Collaborator

@fabianfett fabianfett commented Dec 1, 2021

Motivation

To allow async/await querying we need to support AsyncSequences.

Changes

  • Adds PSQLRowSequence
  • Adjusts PSQLRowStream to support PSQLRowSequence

Result

  • Internal async/await support added.

@fabianfett fabianfett force-pushed the ff-3.1-psqlrowstream-async branch from bad047c to b3e425e Compare February 1, 2022 11:55
@fabianfett fabianfett requested a review from gwynne February 1, 2022 12:19
@fabianfett fabianfett marked this pull request as ready for review February 1, 2022 12:19
@codecov-commenter
Copy link

codecov-commenter commented Feb 2, 2022

Codecov Report

Merging #206 (135c5bd) into main (e61d43c) will increase coverage by 7.12%.
The diff coverage is 89.38%.

@@            Coverage Diff             @@
##             main     #206      +/-   ##
==========================================
+ Coverage   39.99%   47.12%   +7.12%     
==========================================
  Files         118      119       +1     
  Lines        7693     8238     +545     
==========================================
+ Hits         3077     3882     +805     
+ Misses       4616     4356     -260     
Flag Coverage Δ
unittests 47.12% <89.38%> (+7.12%) ⬆️

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

Impacted Files Coverage Δ
Sources/PostgresNIO/New/PSQLRowStream.swift 84.54% <87.64%> (+13.71%) ⬆️
Sources/PostgresNIO/New/PSQLRowSequence.swift 89.73% <89.73%> (ø)
...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%) ⬆️
... and 18 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.

Aside from some minor nits, what amount of the state machine my brain can keep in its working set at one time seems fine, I have no issue with it.

@fabianfett fabianfett requested a review from gwynne February 4, 2022 11:12
@fabianfett fabianfett force-pushed the ff-3.1-psqlrowstream-async branch from c8b8114 to 2a427b1 Compare February 17, 2022 20:46
fabianfett and others added 3 commits February 17, 2022 22:07
Co-authored-by: Gwynne Raskind <gwynne@darkrainfall.org>
Co-authored-by: Gwynne Raskind <gwynne@darkrainfall.org>
@fabianfett fabianfett requested a review from gwynne February 17, 2022 22:37
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 suppose I'll have to live with it like this 🤣

@fabianfett fabianfett merged commit 3ee1245 into vapor:main Feb 17, 2022
@fabianfett fabianfett deleted the ff-3.1-psqlrowstream-async branch February 17, 2022 22:53
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