Skip to content

Validate attributes key names at compile time #133

@Veetaha

Description

@Veetaha

💡 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions