Skip to content

Question regarding enum backward compatibility #1023

Open
@Leulz

Description

@Leulz

First of all, thank you for the work done on this library, it has been very useful!

One thing that I would like to understand is the fact that rust-postgres apparently expects the Rust enums to have all possible variants of a Postgres enum, as seen in these tests. Is that correct?

If so, then does it mean that there is no backward compatibility? If I run a migration that adds an enum value, for example, I have to always ensure that a new deployment that has that new variant in the Rust enum will be deployed ASAP?

I wanted the behavior to be that as long as I am not trying to serialize/deserialize the value of a new enum value that does not exist on Rust's or Postgres's side, it would still work. Is it possible to have this behavior? Or is the implementation inherently not backward compatible?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions