{"record":{"id":"1f628be38139bf64","repo":"diesel-rs/diesel","slug":"expected-treat-none-as-null","errorCode":null,"errorMessage":"expected `treat_none_as_null`","messagePattern":"expected `treat_none_as_null`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"diesel_attribute_parser/src/deprecated/changeset_options.rs","lineNumber":22,"sourceCode":"use crate::deprecated::utils::parse_eq_and_lit_str;\nuse crate::notes::TREAT_NONE_AS_NULL_NOTE;\n\npub fn parse_changeset_options(name: Ident, input: ParseStream) -> Result<(Ident, LitBool)> {\n    if input.is_empty() {\n        return Err(syn::Error::new(\n            name.span(),\n            \"unexpected end of input, expected parentheses\",\n        ));\n    }\n\n    let content;\n    parenthesized!(content in input);\n\n    let name: Ident = content.parse()?;\n    let name_str = name.to_string();\n\n    if name_str != \"treat_none_as_null\" {\n        return Err(syn::Error::new(\n            name.span(),\n            \"expected `treat_none_as_null`\",\n        ));\n    }\n\n    Ok((name.clone(), {\n        let lit_str = parse_eq_and_lit_str(name, &content, TREAT_NONE_AS_NULL_NOTE)?;\n        lit_str.parse()?\n    }))\n}\n","sourceCodeStart":4,"sourceCodeEnd":33,"githubUrl":"https://github.com/diesel-rs/diesel/blob/6fa6ed01b24b24248ab2a611698d0a7c6a2e9120/diesel_attribute_parser/src/deprecated/changeset_options.rs#L4-L33","documentation":"Compile-time error from the deprecated changeset option parser used by #[derive(Insertable/AsChangeset)]. The first identifier inside the parentheses must be `treat_none_as_null`; any other option name in that position hits this guard. It validates the legacy `#[changeset_options(treat_none_as_null = true)]` style input. Fix: spell the option exactly as `treat_none_as_null`.","triggerScenarios":"Writing something like `#[diesel(treat_none_as_null_option(true))]` or misspelling the key inside `#[diesel(...)]` handled by the deprecated parser.","commonSituations":"Typos such as `treat_none_as_nul`, copying naming from other ORMs, or mixing up with newer attribute names.","solutions":["Use `treat_none_as_null = true` inside the parentheses","Remove any other option keys","Migrate to the current attribute syntax"],"exampleFix":"// before\n#[diesel(treat_none_as_null = true)]\n// after\n#[diesel(treat_none_as_null(true))]","handlingStrategy":"validation","validationCode":"// exact key required: treat_none_as_null","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy attribute names from diesel docs verbatim","Let the compiler catch typos early via CI builds"],"tags":["rust","proc-macro","diesel-derive","attribute-syntax"],"backgroundTag":"invalid-argument-value","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"}