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

Add export_keys optional param to native_db macro #246

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Grimeh
Copy link

@Grimeh Grimeh commented Oct 5, 2024

As discussed in #220, this PR adds an optional export_keys boolean param to the native_db macro which allows for table keys to be made public and thus externally accessible from the crate.

I have left a TODO in tests/macro_def/export_keys_attribute.rs:5 to note that this functionality can't be fully tested without somehow testing from an external crate. I could just remove that TODO if you're happy with how it is, not sure what your thoughts on the matter are.

This adds an optional `export_keys` bool param to the `native_db` proc macro that controls the visibility of the model's secondary key enum.

Default value is `false`, which matches the existing behaviour of setting the visibility of the secondary key enum to `pub(crate)`. Using `#[native_db(export_keys = true)]` changes this to `pub`.

See vincent-herlemont#220 for discussion.
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.

1 participant