{"record":{"id":"e018e506321118fa","repo":"influxdata/influxdb","slug":"is-not-allowed-in-a-catalog-record-fields-may-be-primitives","errorCode":null,"errorMessage":"`{}` is not allowed in a catalog record. Fields may be primitives ({}), `String`, arrays, tuples, `Option`/`Vec` of those, or a wire type declared in `records::types`.","messagePattern":"`(.+?)` is not allowed in a catalog record\\. Fields may be primitives \\((.+?)\\), `String`, arrays, tuples, `Option`/`Vec` of those, or a wire type declared in `records::types`\\.","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"influxdb3_catalog_macros/src/types.rs","lineNumber":110,"sourceCode":"        }\n        PathArguments::AngleBracketed(_) | PathArguments::Parenthesized(_) => Err(unsupported(ty)),\n    }\n}\n\n/// Whether a generic argument is a const *literal*, the only generic argument\n/// permitted outside `Option`/`Vec`. See the call site for why.\nfn is_const_literal(arg: &GenericArgument) -> bool {\n    matches!(\n        arg,\n        GenericArgument::Const(syn::Expr::Lit(syn::ExprLit {\n            lit: syn::Lit::Int(_),\n            ..\n        }))\n    )\n}\n\nfn unsupported(ty: &Type) -> syn::Error {\n    syn::Error::new(\n        ty.span(),\n        format!(\n            \"`{}` is not allowed in a catalog record. Fields may be primitives ({}), `String`, \\\n             arrays, tuples, `Option`/`Vec` of those, or a wire type declared in \\\n             `records::types`.\",\n            render(ty),\n            PRIMITIVES.join(\", \"),\n        ),\n    )\n}\n\nfn render(ty: &Type) -> String {\n    use quote::ToTokens;\n    ty.to_token_stream().to_string().replace(' ', \"\")\n}\n\n#[cfg(test)]\nmod tests {","sourceCodeStart":92,"sourceCodeEnd":128,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog_macros/src/types.rs#L92-L128","documentation":"The catch-all compile-time rejection from the catalog record field-type checker (`unsupported`). A field's type is outside the allowed vocabulary: allowed are primitives, `String`, arrays, tuples, `Option`/`Vec` of allowed types, and wire types declared in `records::types`. Anything else (maps, references, trait objects, boxed types, foreign structs) is rejected because the catalog cannot guarantee a fixed bitcode encoding for it.","triggerScenarios":"Declaring a catalog record field of a disallowed type, e.g. `field: HashMap<K,V>`, `field: &str`, `field: Box<dyn Trait>`, or an arbitrary external struct. Raised by `unsupported` when reached from `check` or `check_path`.","commonSituations":"A developer tries to store a map, a timestamp type from another crate, a reference, or an enum the macro doesn't recognize directly in a record.","solutions":["Rewrite the field using allowed types: primitives, `String`, arrays, tuples, `Option`/`Vec` thereof.","For complex data, declare a wire type in `records::types` and convert to the runtime type in the record's `apply` method.","For a map-like field, use `Vec<(K, V)>` of allowed key/value types instead of a map."],"exampleFix":"// before\n#[catalog_record(shape = 0x1)]\nstruct Foo { map: HashMap<u64, String> }\n\n// after\n#[catalog_record(shape = 0x1)]\nstruct Foo { map: Vec<(u64, String)> }","handlingStrategy":"validation","validationCode":"// Pre-check record field types against the allowed vocabulary:\n// primitives, String, arrays, tuples, Option/Vec of those, records::types wire types.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep record fields within the documented allowed-type list.","Replace maps with Vec<(K, V)> of allowed types.","Convert runtime types (timestamps, dyn traits) to wire types declared in records::types.","Compile early and often — the macro rejects disallowed types at compile time."],"tags":["proc-macro","compile-time","type-system","serialization"],"backgroundTag":"invalid-argument-value","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}