{"record":{"id":"43d2a206a953311b","repo":"hasura/graphql-engine","slug":"column-column-name-is-not-defined-in-collection","errorCode":null,"errorMessage":"column {column_name} is not defined in collection {collection_name} in data connector {db_name}","messagePattern":"column (.+?) is not defined in collection (.+?) in data connector (.+?)","errorType":"validation","errorClass":"NDCValidationError","httpStatus":null,"severity":"error","filePath":"v3/crates/metadata-resolve/src/helpers/ndc_validation.rs","lineNumber":43,"sourceCode":"        collection_name: CollectionName,\n    },\n    #[error(\n        \"argument {argument_name} is not defined for collection {collection_name} in data connector {db_name}\"\n    )]\n    NoSuchArgument {\n        db_name: Qualified<DataConnectorName>,\n        collection_name: CollectionName,\n        argument_name: DataConnectorArgumentName,\n    },\n    #[error(\n        \"argument {argument_name} is not defined for function/procedure {func_proc_name} in data connector {db_name}\"\n    )]\n    NoSuchArgumentForCommand {\n        db_name: Qualified<DataConnectorName>,\n        func_proc_name: String,\n        argument_name: DataConnectorArgumentName,\n    },\n    #[error(\n        \"column {column_name} is not defined in collection {collection_name} in data connector {db_name}\"\n    )]\n    NoSuchColumn {\n        db_name: Qualified<DataConnectorName>,\n        model_name: Qualified<ModelName>,\n        field_name: FieldName,\n        collection_name: CollectionName,\n        column_name: DataConnectorColumnName,\n    },\n    #[error(\"procedure {procedure_name} is not defined in data connector {db_name}\")]\n    NoSuchProcedure {\n        db_name: Qualified<DataConnectorName>,\n        command_name: Qualified<CommandName>,\n        procedure_name: ProcedureName,\n    },\n    #[error(\"function {function_name} is not defined in data connector {db_name}\")]\n    NoSuchFunction {\n        db_name: Qualified<DataConnectorName>,","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/metadata-resolve/src/helpers/ndc_validation.rs#L25-L61","documentation":"NDCValidationError::NoSuchColumn is thrown when a field on a model maps to a column (DataConnectorColumnName) that the connector's schema does not define for the mapped collection. During NDC validation each mapped field's column is looked up in the collection's columns; a miss raises this with db_name, model_name, field_name, collection_name, and column_name.","triggerScenarios":"A field mapping referencing a column dropped/renamed in the database; column name case mismatch; connector schema stale after DDL; mapping copied from another table with different column names.","commonSituations":"Database migrations renaming columns; multiple environments with schema drift; hand-authored field mappings; connectors with case-sensitive column naming.","solutions":["Confirm the column exists on the underlying table with exact name/case","Update the field mapping's column_name in metadata to the current column","Refresh the connector's schema cache so it reflects recent DDL","If the column is gone intentionally, remove the field mapping"],"exampleFix":"// before\n\"field_mappings\": { \"name\": { \"column\": \"full_name\" } }\n// after\n\"field_mappings\": { \"fullName\": { \"column\": \"full_name\" } }","handlingStrategy":"validation","validationCode":"let coll = schema.collections.iter().find(|c| c.name == collection_name).unwrap();\nlet cols: HashSet<_> = coll.columns.keys().collect();\nfor field in field_mappings {\n    assert!(cols.contains(&field.column_name), \"column {} missing on {}\", field.column_name, collection_name);\n}","typeGuard":"fn column_exists(name: &DataConnectorColumnName, coll: &NdcCollection) -> bool {\n    coll.columns.contains_key(name)\n}","tryCatchPattern":"Match NoSuchColumn and report the model field, expected column, and the collection's available columns.","preventionTips":["Run metadata validation after DB migrations","Automate field-mapping generation from connector schema","Watch for column-name case sensitivity across databases"],"tags":["ndc","column","data-connectors","schema-validation"],"backgroundTag":"column-not-found","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}