{"record":{"id":"44a853ed73d9c6ca","repo":"diesel-rs/diesel","slug":"field-not-found","errorCode":null,"errorMessage":"Field not found","messagePattern":"Field not found","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"diesel_dynamic_schema/src/dynamic_value.rs","lineNumber":530,"sourceCode":"        &self.values[index]\n    }\n}\n\nimpl<I> IndexMut<usize> for DynamicRow<I> {\n    fn index_mut(&mut self, index: usize) -> &mut Self::Output {\n        &mut self.values[index]\n    }\n}\n\nimpl<'a, I> Index<&'a str> for DynamicRow<NamedField<I>> {\n    type Output = I;\n\n    fn index(&self, field_name: &'a str) -> &Self::Output {\n        self.values\n            .iter()\n            .find(|f| f.name == field_name)\n            .map(|f| &f.value)\n            .expect(\"Field not found\")\n    }\n}\n\nimpl<'a, I> IndexMut<&'a str> for DynamicRow<NamedField<I>> {\n    fn index_mut(&mut self, field_name: &'a str) -> &mut Self::Output {\n        self.values\n            .iter_mut()\n            .find(|f| f.name == field_name)\n            .map(|f| &mut f.value)\n            .expect(\"Field not found\")\n    }\n}\n\nimpl<'a, I> Index<&'a String> for DynamicRow<NamedField<I>> {\n    type Output = I;\n\n    fn index(&self, field_name: &'a String) -> &Self::Output {\n        self.index(field_name as &str)","sourceCodeStart":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/diesel-rs/diesel/blob/6fa6ed01b24b24248ab2a611698d0a7c6a2e9120/diesel_dynamic_schema/src/dynamic_value.rs#L512-L548","documentation":"Runtime panic from the Index<&str> impl for DynamicRow<NamedField<I>> in diesel_dynamic_schema. The row is indexed by field name via a linear search over the named values; when no field's name equals the requested key the Option is unwrapped with expect, so a typo'd or absent column name panics with this generic sentinel. Fix: index with a name that exists in the row, or look up the field fallibly before indexing.","triggerScenarios":"Thrown at diesel_dynamic_schema/src/dynamic_value.rs:530 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use an existing field name from the row","Inspect the row's field list before indexing","Add the missing field to the dynamic schema"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}