Skip to content

fix(rust): Simplify SQLSTATE handling: pass through server SQLSTATEs#352

Merged
vikrantpuppala merged 2 commits intoadbc-drivers:mainfrom
vikrantpuppala:sqlstate-simplify
Mar 16, 2026
Merged

fix(rust): Simplify SQLSTATE handling: pass through server SQLSTATEs#352
vikrantpuppala merged 2 commits intoadbc-drivers:mainfrom
vikrantpuppala:sqlstate-simplify

Conversation

@vikrantpuppala
Copy link
Collaborator

@vikrantpuppala vikrantpuppala commented Mar 15, 2026

Summary

  • Remove ODBC-specific SQLSTATE mapping (map_error_code_to_sqlstate) from ADBC layer
  • ADBC now passes through server-provided SQL-standard SQLSTATEs faithfully
  • ODBC-specific translation (e.g., 42P01→42S02) does not belong in ADBC

Test plan

  • cargo test passes
  • cargo clippy -- -D warnings clean
  • Verify SQLSTATE extraction from error messages still works

This pull request was AI-assisted by Isaac.

ADBC is a general-purpose interface and should not map to ODBC-specific
SQLSTATEs (42S02, 42S22, etc.). The server provides proper SQL-standard
SQLSTATEs in error messages (42P01, 42703) which the driver now passes
through faithfully. ODBC-specific translation belongs in the ODBC bridge.

Co-authored-by: Isaac
@vikrantpuppala vikrantpuppala changed the title Simplify SQLSTATE handling: pass through server SQLSTATEs fix(rust): Simplify SQLSTATE handling: pass through server SQLSTATEs Mar 15, 2026
@vikrantpuppala vikrantpuppala merged commit a602b6a into adbc-drivers:main Mar 16, 2026
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants