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

Validate attributes key names at compile time #133

Open
Veetaha opened this issue Sep 9, 2020 · 0 comments
Open

Validate attributes key names at compile time #133

Veetaha opened this issue Sep 9, 2020 · 0 comments

Comments

@Veetaha
Copy link
Contributor

Veetaha commented Sep 9, 2020

💡 Feature description

Dynamodb has rules for naming the attributes keys defined here. It also includes quite a long list of arguably common words as reserved names (which I think are unjustifiably common, but anyway...).
These rules are enforced by Dynamodb at runtime (it returns an error response IIRC). It would be cool if dynomite could validate these rules at compile time instead.

💻 Basic example

#[derive(Attributes)]
struct MyTable {
     // Nope, column is a reserved word, `dynomite` issues a compile-error here,
     // This should also work with `rename = "foo"`
     column: String,
}

There may also be an option like #[dynomite(escape_reserved_key)] to explicitly opt in to escaping the reserved words

@Veetaha Veetaha changed the title Validate attrobites key names at compile time Validate attributes key names at compile time Sep 9, 2020
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

1 participant