{"record":{"id":"a75e9ba0099570a4","repo":"diesel-rs/diesel","slug":"e-the-correct-format-is-window","errorCode":null,"errorMessage":"{e}, the correct format is `#[window]`","messagePattern":"(.+?), the correct format is `#\\[window\\]`","errorType":"exception","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"diesel_derives/src/sql_function.rs","lineNumber":1393,"sourceCode":"                        .require_ident()\n                        .map_err(|e| {\n                            syn::Error::new(\n                                e.span(),\n                                format!(\"{e}, the correct format is `#[skip_return_type_helper]`\"),\n                            )\n                        })?\n                        .clone(),\n                },\n            })\n        }\n        syn::Meta::Path(path) if path.is_ident(\"window\") => Ok(AttributeSpanWrapper {\n            attribute_span: attr.span(),\n            ident_span: path.span(),\n            item: SqlFunctionAttribute::Window {\n                ident: path\n                    .require_ident()\n                    .map_err(|e| {\n                        syn::Error::new(e.span(), format!(\"{e}, the correct format is `#[window]`\"))\n                    })?\n                    .clone(),\n                restrictions: BackendRestriction::None,\n                require_order: None,\n                wrap_macro: None,\n            },\n        }),\n        syn::Meta::List(syn::MetaList {\n            path,\n            delimiter: syn::MacroDelimiter::Paren(_),\n            tokens: _,\n        }) if path.is_ident(\"variadic\") => {\n            let (count, flag) = attr\n                .parse_args_with(|input: syn::parse::ParseStream| {\n                    if input.peek(LitInt){\n                        let count = input.parse::<LitInt>()?;\n                        if !input.is_empty(){\n                            return Err(syn::Error::new(input.span(), \"unexpected token after positional `#[variadic(..)]`\"));","sourceCodeStart":1375,"sourceCodeEnd":1411,"githubUrl":"https://github.com/diesel-rs/diesel/blob/6fa6ed01b24b24248ab2a611698d0a7c6a2e9120/diesel_derives/src/sql_function.rs#L1375-L1411","documentation":"Compile-time error when processing the #[sql_function] attribute list. In the Window attribute variant, the inner attribute is required to be a bare identifier; require_ident() fails on any other meta form (e.g. `#[window(...)]` with arguments), and the original syn error is wrapped with a hint stating the correct usage `#[window]`. Fix: write the flag without arguments as `#[window]`.","triggerScenarios":"Writing `#[window(...)]`, `#[window = true]`, or a qualified path like `#[foo::window]` inside a `#[sql_function(...)]` attribute.","commonSituations":"Assuming window function configuration (partition/order) belongs in the attribute; copying other frameworks' attribute syntax.","solutions":["Use `#[window]` with no arguments","Move any options to a supported location"],"exampleFix":"// before\n#[sql_function]\n#[window(partition_by = true)]\nfn row_number() -> BigInt;\n\n// after\n#[sql_function]\n#[window]\nfn row_number() -> BigInt;","handlingStrategy":"validation","validationCode":"// Attribute must be a bare path: #[window]\nlet attr_src = \"#[window]\";\nassert!(attr_src == \"#[window]\"); // no args, no assignment","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Write `#[window]` with no arguments; configure frames via diesel's window DSL instead.","Do not invent parameters for the attribute.","Cross-check with the diesel window function documentation."],"tags":["rust","proc-macro","diesel","attributes","window-function"],"backgroundTag":"invalid-argument-format","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"}