{"record":{"id":"be99c4901335a83b","repo":"diesel-rs/diesel","slug":"unexpected-option-name-str","errorCode":null,"errorMessage":"unexpected option `{name_str}`","messagePattern":"unexpected option `(.+?)`","errorType":"exception","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"diesel_derives/src/sql_function.rs","lineNumber":1845,"sourceCode":"                    out.push_sql(\")\");\n                    Ok(())\n                }\n            }\n        }\n    }\n}\n\nimpl Parse for BackendRestriction {\n    fn parse(input: ParseStream) -> Result<Self> {\n        let name: syn::Ident = input.parse()?;\n        let name_str = name.to_string();\n        let content;\n        parenthesized!(content in input);\n        match &*name_str {\n            \"backends\" => Self::parse_backends(&content, name),\n            \"dialect\" => Self::parse_sql_dialect(&content, name),\n            \"backend_bounds\" => Self::parse_backend_bounds(&content, name),\n            _ => Err(syn::Error::new(\n                name.span(),\n                format!(\"unexpected option `{name_str}`\"),\n            )),\n        }\n    }\n}\n\n#[derive(Debug, Clone)]\nenum SqlFunctionAttribute {\n    Aggregate {\n        ident: Ident,\n    },\n    Window {\n        ident: Ident,\n        restrictions: BackendRestriction,\n        require_order: Option<bool>,\n        wrap_macro: Option<Path>,\n    },","sourceCodeStart":1827,"sourceCodeEnd":1863,"githubUrl":"https://github.com/diesel-rs/diesel/blob/6fa6ed01b24b24248ab2a611698d0a7c6a2e9120/diesel_derives/src/sql_function.rs#L1827-L1863","documentation":"The `#[sql_function]` macro accepts only a fixed set of attribute options: `backends`, `dialect`, and `backend_bounds`. Any other option name inside the attribute parentheses triggers this error at the option's span.","triggerScenarios":"Writing `#[sql_function(foo = ...)]` or `#[sql_function(unknown_option)]` with any name not in {backends, dialect, backend_bounds}, e.g. a misspelled `backend_bound` or an option from another macro.","commonSituations":"Typos in option names; carrying over options from other derive macros; guessing at macro capabilities not supported by the installed diesel version.","solutions":["Replace the option with one of `backends`, `dialect`, or `backend_bounds`","Fix typos (e.g. `backend_bounds` not `backend_bound`)","Remove the unsupported option and configure the behavior in code instead"],"exampleFix":"// before\n#[sql_function(unknown = true)]\nfn my_fn(x: Integer) -> Text;\n// after\n#[sql_function(backend_bounds(...))]\nfn my_fn(x: Integer) -> Text;","handlingStrategy":"validation","validationCode":"const ALLOWED_OPTIONS: [&str; 3] = [\"backends\", \"dialect\", \"backend_bounds\"];\nfn is_valid_sql_function_option(name: &str) -> bool { ALLOWED_OPTIONS.contains(&name) }","typeGuard":"fn is_valid_sql_function_option(name: &str) -> bool {\n    matches!(name, \"backends\" | \"dialect\" | \"backend_bounds\")\n}","tryCatchPattern":null,"preventionTips":["Only use backends, dialect, or backend_bounds inside #[sql_function(...)]","Check the installed diesel version's macro docs before adding options","Don't reuse option names from other derive/attribute macros"],"tags":["proc-macro","rust","attribute-parsing","diesel"],"backgroundTag":"unsupported-config-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"}