Description
I'm restructuring my project and have noticed that model keys are defined with pub(crate)
visibility.
I can see the motivation for this choice and generally agree with it. However it would be helpful to have the ability to make them pub
for access from sibling crates.
From a quick look (and my limited experience with proc macros) it seems like it wouldn't be too difficult to add a parameter to the native_db
macro to enable something like:
#[native_model(...)]
#[native_db(export_keys = true)]
pub struct MyTable { ... }
Then pub(crate) enum #keys_enum_name
from native_db.rs:59
could be changed to something like #keys_visibility enum #keys_enum_name
.
native_db/native_db_macro/src/native_db.rs
Lines 59 to 61 in 50063a0
I'm going to make a fork to try this out for my own purposes, would you be keen on this change if I opened a PR?