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

Derive helper alternative #1555

Closed
augustocdias opened this issue Nov 24, 2021 · 3 comments
Closed

Derive helper alternative #1555

augustocdias opened this issue Nov 24, 2021 · 3 comments

Comments

@augustocdias
Copy link

So rust is deprecating derive helpers, which mean that eventually the sqlx::Type macro will stop working at some point...

Is there an alternative planned to that already?

@jplatte
Copy link
Contributor

jplatte commented Nov 24, 2021

Rust is not deprecating derive helpers. The only thing being deprecated is the usage of them before the usage of the derive macro that "registers" them. That is

#[sqlx(type_name = "foo")]
#[derive(sqlx::Type)]
enum Foo { ... }

will raise a deprecation warning, but

#[derive(sqlx::Type)]
#[sqlx(type_name = "foo")]
enum Foo { ... } 

won't.

@abonander
Copy link
Collaborator

I'm still not entirely certain on the impact of this deprecation but it seems that it just doesn't allow the attribute to be declared before the #[derive] attribute that introduces it, which is a style I don't like anyway.

@augustocdias
Copy link
Author

Yes you're right. My mistake/misunderstanding.

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

No branches or pull requests

3 participants