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

Allow dynamic schema_names #2110

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Xervon
Copy link

@Xervon Xervon commented Feb 14, 2024

PR Info

I'd like to be able to switch schema_names at runtime to switch between development and production environments.

This PR changes the schema_name parameter of the DeriveEntityModel and DeriveEntity macros to take a syn::Expr instead of a syn::Lit. As far as I can tell this shouldn't break any existing code.

Since I haven't done much work with derive macros before, I couldn't quite tell how to integrate the change into the test suite. I'd appreciate hints on how to add them.

New Features

  • Accept syn::Expr as a schema_name

@tyt2y3
Copy link
Member

tyt2y3 commented Feb 28, 2024

Thanks for the contribution. Can you add some tests illustrating the behaviour you wanted to achieve? i.e.

schema_name parameter of the DeriveEntityModel and DeriveEntity macros to take a syn::Expr

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.

None yet

2 participants