Skip to content

PostgresCodable should be a typealias #321

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
Nov 10, 2022

Conversation

fabianfett
Copy link
Collaborator

Motivation

PostgresCodable only marks a type as PostgresEncodable and PostgresDecodable. For this reason this should not be an extra protocol. Instead it should be a typealias. (See same pattern in Codable – which also is just a typealias).

Lucky for us we never made PostgresCodable public so far.

Changes

  • PostgresCodable is a typealias

@codecov-commenter
Copy link

codecov-commenter commented Nov 10, 2022

Codecov Report

Merging #321 (f583f2e) into main (ee024b7) will not change coverage.
The diff coverage is n/a.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #321   +/-   ##
=======================================
  Coverage   41.62%   41.62%           
=======================================
  Files         115      115           
  Lines        9377     9377           
=======================================
  Hits         3903     3903           
  Misses       5474     5474           
Flag Coverage Δ
unittests 41.62% <ø> (ø)

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

Impacted Files Coverage Δ
...es/PostgresNIO/New/Data/Bool+PostgresCodable.swift 95.34% <ø> (ø)
...s/PostgresNIO/New/Data/Bytes+PostgresCodable.swift 64.70% <ø> (ø)
...es/PostgresNIO/New/Data/Date+PostgresCodable.swift 89.28% <ø> (ø)
...PostgresNIO/New/Data/Decimal+PostgresCodable.swift 74.19% <ø> (ø)
...s/PostgresNIO/New/Data/Float+PostgresCodable.swift 76.66% <ø> (ø)
...ces/PostgresNIO/New/Data/Int+PostgresCodable.swift 36.60% <ø> (ø)
...es/PostgresNIO/New/Data/JSON+PostgresCodable.swift 100.00% <ø> (ø)
...IO/New/Data/RawRepresentable+PostgresCodable.swift 82.35% <ø> (ø)
.../PostgresNIO/New/Data/String+PostgresCodable.swift 100.00% <ø> (ø)
...es/PostgresNIO/New/Data/UUID+PostgresCodable.swift 96.96% <ø> (ø)
... and 1 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.

Nice!!! I didn't even notice that. (Not that Codable has much track record for getting things right, but this is one case where it definitely makes more sense this way.)

@fabianfett fabianfett merged commit 607279d into vapor:main Nov 10, 2022
@fabianfett fabianfett deleted the ff-postgrescodable-typealias branch November 10, 2022 13:54
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