Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

PostgresDataConvertible should not be hard-deprecated till PostgresKit adopts newer APIs #254

Open
Labels
bugSomething isn't working
@stephencelis

Description

Describe the bug

Upon upgrading my dependencies I got a deprecation warning for PostgresDataConvertible, urging me to upgrade to the newer protocols, but when I attempted to upgrade, I got hit with decoding failures for typeMismatch due to SQLRow.decode no longer getting the right type.

To Reproduce

Here are the helpers I'm using, including the conformance at the bottom of the file:

https://github.com/pointfreeco/pointfreeco/blob/63db1dd9a73c6e9f240aebe4a8072b1a725ee1f0/Sources/Database/Helpers.swift

Updating the conformance to the following breaks the helpers above:

extension Tagged: PostgresDecodable where RawValue: PostgresDecodable {
 public init(
 from byteBuffer: inout ByteBuffer,
 type: PostgresDataType,
 format: PostgresFormat,
 context: PostgresDecodingContext<some PostgresJSONDecoder>
 ) throws {
 self.init(
 try RawValue(
 from: &byteBuffer,
 type: type,
 format: format,
 context: context
 )
 )
 }
}

Expected behavior

I expect a deprecation warning pushing me to adopt a new API to be compatible with the existing APIs I adopt from PostgresKit.

Environment

  • postgres-nio 1.18.0
  • postgres-kit 2.12.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /