{"record":{"id":"6133f4b04ad44968","repo":"diesel-rs/diesel","slug":"unexpected-end-of-input-expected-parentheses-6133f4","errorCode":null,"errorMessage":"unexpected end of input, expected parentheses","messagePattern":"unexpected end of input, expected parentheses","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"diesel_attribute_parser/src/deprecated/primary_key.rs","lineNumber":8,"sourceCode":"use syn::parse::{Parse, ParseStream, Result};\nuse syn::punctuated::Punctuated;\nuse syn::token::Comma;\nuse syn::{Ident, parenthesized};\n\npub fn parse_primary_key(name: Ident, input: ParseStream) -> Result<Punctuated<Ident, Comma>> {\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    content.parse_terminated(Ident::parse, syn::Token![,])\n}\n","sourceCodeStart":1,"sourceCodeEnd":19,"githubUrl":"https://github.com/diesel-rs/diesel/blob/6fa6ed01b24b24248ab2a611698d0a7c6a2e9120/diesel_attribute_parser/src/deprecated/primary_key.rs#L1-L19","documentation":"The deprecated `primary_key` attribute requires a parenthesized list of column identifiers; the attribute was given with empty or no parentheses, so the parser errors with `unexpected end of input, expected parentheses`.","triggerScenarios":"Writing `#[diesel(primary_key)]` without `(col1, col2)` on a table/struct in `QueryableByName`/`Identifiable` derives.","commonSituations":"Declaring a custom primary key but forgetting the column list, or deleting the list during refactoring.","solutions":["Add the key columns: `#[diesel(primary_key(id))]` or `#[diesel(primary_key(a, b))]` for composite keys","Remove the attribute to fall back to the default `id` primary key"],"exampleFix":"// before\n#[diesel(primary_key)]\n// after\n#[diesel(primary_key(id))]","handlingStrategy":"validation","validationCode":"// compile-time: #[diesel(primary_key(id))] or #[diesel(primary_key(a, b))]","typeGuard":null,"tryCatchPattern":null,"preventionTips":["List the key columns explicitly whenever overriding the primary key","Rely on the default `id` key when no override is needed"],"tags":["rust","proc-macro","diesel-derive","attribute-syntax"],"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"}