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

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

Open
stephencelis opened this issue Nov 5, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@stephencelis
Copy link

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
@stephencelis stephencelis added the bug Something isn't working label Nov 5, 2023
@stephencelis
Copy link
Author

(@MahdiBM Helped debug this for me on this Discord.)

@MahdiBM
Copy link
Contributor

MahdiBM commented Nov 5, 2023

I think it's more like a problem on postgres-kit side that we're not properly supporting the new APIs 😅

I'm working on some updates luckily, as mentioned in the conversation: #253

@gwynne
Copy link
Member

gwynne commented Nov 6, 2023

I updated PostgresKit to the new APIs a long time ago.

@gwynne gwynne closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2023
@stephencelis
Copy link
Author

@gwynne Can you explain why this was closed outright when my core issue is unresolved? If the issue I opened doesn't explain things well or isn't categorized well we can certainly update it.

@gwynne gwynne transferred this issue from vapor/postgres-nio Nov 6, 2023
@gwynne gwynne reopened this Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants