Skip to content

Added SqlDescribeColW, remove unwraps from FFI code#2

Open
adwk67 wants to merge 5 commits intomainfrom
temp/aken
Open

Added SqlDescribeColW, remove unwraps from FFI code#2
adwk67 wants to merge 5 commits intomainfrom
temp/aken

Conversation

@adwk67
Copy link
Member

@adwk67 adwk67 commented Feb 13, 2026

Added SqlDescribeColW, remove unwraps from FFI code, consistent error handling.

adwk67 and others added 5 commits February 13, 2026 13:38
- Fix all 16 clippy warnings: empty line after attr, let-and-return,
  needless borrows, uninlined format args, clone-on-copy, module
  inception, enum variant names, too-many-arguments
- Add DSN resolution to SQLDriverConnectW so connection strings with
  DSN= (but no Database=) resolve the database path from odbc.ini
- Extract impl_connect_to_database for direct database path connections,
  avoiding double DSN lookup when called from SQLDriverConnectW
- Untrack .claude/settings.local.json (already in .gitignore)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Replace 3 .unwrap() calls in FFI functions with proper error handling
  that returns SqlReturn::ERROR instead of panicking the host application
- Change allocate_stmt_handle to return Option<StatementHandle> so callers
  handle missing connections gracefully
- Implement SQLDescribeColW with column name (UTF-16), type (SQL_VARCHAR),
  size (255), decimal digits (0), and nullability (SQL_NULLABLE)
- Enable `wide` feature on odbc-api dev-dependency for proper Unicode
  ODBC client testing
- Add test_describe_columns integration test

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Per ODBC spec, SQL_INVALID_HANDLE should be returned when a handle
argument is invalid (null, wrong type, or corrupted tag). Previously
8 of 16 call sites incorrectly returned SQL_ERROR instead.

Also normalizes error messages to the consistent pattern:
  error!("Failed to get {handle_type} handle: {}", err)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lfrancke lfrancke self-requested a review February 13, 2026 14:55
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.

1 participant