{"record":{"id":"e9cae8bf98a5cc6a","repo":"diesel-rs/diesel","slug":"expected-attribute-name-help-the-correct-format-e9cae8","errorCode":null,"errorMessage":"expected attribute `name`\nhelp: the correct format looks like #[diesel({MYSQL_TYPE_NOTE})]","messagePattern":"expected attribute `name`\nhelp: the correct format looks like #\\[diesel\\((.+?)\\)\\]","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"diesel_attribute_parser/src/parsers/mysql_type.rs","lineNumber":43,"sourceCode":"\npub struct MysqlType {\n    pub name: LitStr,\n}\n\nimpl Parse for MysqlType {\n    fn parse(input: ParseStream) -> Result<Self> {\n        let mut name = None;\n\n        for attr in Punctuated::<Attr, Comma>::parse_terminated(input)? {\n            match attr {\n                Attr::Name(value) => name = Some(value),\n            }\n        }\n\n        if let Some(name) = name {\n            Ok(MysqlType { name })\n        } else {\n            Err(syn::Error::new(\n                input.span(),\n                format!(\n                    \"expected attribute `name`\\n\\\n                     help: the correct format looks like #[diesel({MYSQL_TYPE_NOTE})]\"\n                ),\n            ))\n        }\n    }\n}\n","sourceCodeStart":25,"sourceCodeEnd":53,"githubUrl":"https://github.com/diesel-rs/diesel/blob/6fa6ed01b24b24248ab2a611698d0a7c6a2e9120/diesel_attribute_parser/src/parsers/mysql_type.rs#L25-L53","documentation":"Compile-time error from parsing #[diesel(mysql_type(...))]. The MysqlType parser accepts a comma-separated attribute list, of which `name` is the only valid key; if no `name = \"...\"` attribute was supplied inside the parentheses, this fallback error fires naming the missing attribute and showing the correct format. Fix: pass `name = \"your_type_name\"` inside #[diesel(mysql_type(...))].","triggerScenarios":"Thrown at diesel_attribute_parser/src/parsers/mysql_type.rs:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add `name = \"...\"` to the attribute","Remove other keys and provide the required name first"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6fa6ed01b24b24248ab2a611698d0a7c6a2e9120","analyzedAt":"2026-09-07T01:50:13.074Z","contentChangedAt":"2026-09-07T01:50:13.074Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}