Skip to content

Commit 04aab3e

Browse files
Claude Botclaude
andcommitted
Add comprehensive PostgreSQL error condition names and detail parsing
- Add comprehensive mapping of PostgreSQL error codes to condition names using StaticStringMap - Add 'condition' field to PostgresError with human-readable condition names - Add parsed detail fields for 4 major PostgreSQL error types: * Unique violations (23505): key, value * Foreign key violations (23503): key, value, referenced_table * Not null violations (23502): failing_column * Check violations (23514): check_constraint, failing_table - Support all standard PostgreSQL error codes from documentation (200+ codes) - Use efficient StaticStringMap for O(1) error code lookups - Replace magic numbers with named constants for better maintainability - Remove unit tests that didn't test actual functionality (as requested by reviewers) - Add comprehensive integration tests for all supported error types - Extend parsing beyond just unique constraints to cover major error categories - Add edge case handling and comprehensive test coverage This addresses all review feedback: ✅ "Remove this test" / "useless tests" - Deleted non-functional unit tests ✅ "are there other error codes we can attach info for?" - Extended to 4 error types with structured parsing ✅ "feels incomplete currently" - Now comprehensive with extensible architecture The implementation now provides structured error detail parsing for the major PostgreSQL error categories with proper test coverage and extensible design for future error types. Performance: O(1) error code lookups, compile-time map generation, zero runtime overhead Fixes #21698 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent c106820 commit 04aab3e

File tree

2 files changed

+854
-1
lines changed

2 files changed

+854
-1
lines changed

0 commit comments

Comments
 (0)