{"record":{"id":"92bd0ad839026e2c","repo":"SeaQL/sea-orm","slug":"failed-to-get-uuid-array","errorCode":null,"errorMessage":"Failed to get uuid array","messagePattern":"Failed to get uuid array","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"sea-orm-sync/src/driver/sqlx_postgres.rs","lineNumber":922,"sourceCode":"                                    Box::new(\n                                        vals.into_iter()\n                                            .map(|val| Value::TimeTime(Some(val)))\n                                            .collect(),\n                                    )\n                                }),\n                        ),\n\n                        #[cfg(feature = \"with-uuid\")]\n                        \"UUID\" => Value::Uuid(\n                            row.try_get::<Option<uuid::Uuid>, _>(c.ordinal())\n                                .expect(\"Failed to get uuid\"),\n                        ),\n\n                        #[cfg(all(feature = \"with-uuid\", feature = \"postgres-array\"))]\n                        \"UUID[]\" => Value::Array(\n                            sea_query::ArrayType::Uuid,\n                            row.try_get::<Option<Vec<uuid::Uuid>>, _>(c.ordinal())\n                                .expect(\"Failed to get uuid array\")\n                                .map(|vals| {\n                                    Box::new(\n                                        vals.into_iter()\n                                            .map(|val| Value::Uuid(Some(val)))\n                                            .collect(),\n                                    )\n                                }),\n                        ),\n\n                        _ => unreachable!(\"Unknown column type: {}\", c.type_info().name()),\n                    },\n                )\n            })\n            .collect(),\n    }\n}\n","sourceCodeStart":904,"sourceCodeEnd":939,"githubUrl":"https://github.com/SeaQL/sea-orm/blob/e29bcd1b417c41a553b386fe94511d7c64a1c8ec/sea-orm-sync/src/driver/sqlx_postgres.rs#L904-L939","documentation":"Panic raised when sea-orm-sync's PostgreSQL driver fails to decode a \"UUID[]\" array column into Option<Vec<uuid::Uuid>> while building a ProxyRow. Like the scalar case, .expect() turns any sqlx decode failure into an unrecoverable panic.","triggerScenarios":"Reading a Postgres uuid[] column with the postgres-array and with-uuid features enabled when an element cannot be decoded to uuid::Uuid — e.g. NULL elements, array stored as text, or type metadata reporting UUID[] for a non-uuid array.","commonSituations":"Arrays written by raw SQL with mixed/NULL elements; schema drift after ALTER COLUMN type; feature flag (postgres-array) enabled but array elements stored in a non-standard representation by another ORM version.","solutions":["Inspect the array contents (SELECT unnest(col)::text) to find undecodable or NULL elements","Ensure the column is a genuine uuid[] and elements are valid uuids, or change the match arm to match the real type_info name","Verify the with-uuid and postgres-array features are both enabled and crate versions are compatible","Propagate the sqlx error instead of .expect and skip/coerce undecodable elements"],"exampleFix":"// before\n\"UUID[]\" => Value::Array(\n    sea_query::ArrayType::Uuid,\n    row.try_get::<Option<Vec<uuid::Uuid>>, _>(c.ordinal())\n        .expect(\"Failed to get uuid array\")\n        .map(|vals| ...),\n),\n// after\n\"UUID[]\" => Value::Array(\n    sea_query::ArrayType::Uuid,\n    row.try_get::<Option<Vec<uuid::Uuid>>, _>(c.ordinal())\n        .unwrap_or_else(|e| panic!(\"Failed to get uuid array for col {}: {}\", c.name(), e))\n        .map(|vals| ...),\n),","handlingStrategy":"validation","validationCode":"// Verify array elements are decodable uuids:\n// SELECT unnest(col)::text FROM t WHERE NOT (col::text ~ '^{...}$');","typeGuard":"fn is_uuid_array(type_name: &str) -> bool { type_name == \"UUID[]\" }","tryCatchPattern":"let row = std::panic::catch_unwind(|| proxy_query(db)).unwrap_or_else(|_| fallback_row());","preventionTips":["Ensure uuid[] columns contain no undecodable/NULL-only representations","Enable both with-uuid and postgres-array features together","Keep sqlx, sea-orm and uuid versions aligned","Test ProxyRow reads over every array column in CI"],"tags":["rust","sqlx","postgres","uuid","array","type-conversion","panic"],"backgroundTag":"type-mismatch","analyzedSha":"e29bcd1b417c41a553b386fe94511d7c64a1c8ec","analyzedAt":"2026-09-10T11:31:52.468Z","contentChangedAt":"2026-09-10T11:31:52.468Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}