Skip to content

Report local ODBC setup failures as configuration errors - #18

Merged
lovasoa merged 1 commit into
mainfrom
81reap/connecting/3b
Nov 27, 2026
Merged

lovasoa merged 1 commit into
mainfrom
81reap/connecting/3b

Conversation

@81reap

@81reap 81reap commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

An unregistered ODBC data source name (DSN) is a local setup error. The driver manager reports IM002 before it contacts a database. Callers now get sqlx::Error::Configuration with the original ODBC diagnostic as its cause.

The same rule applies to IM003 (driver cannot load), IM012 (invalid DRIVER syntax), and IM014 (driver architecture mismatch). Server connection and authentication errors continue to use Error::Database.

The missing-DSN test uses a valid-length name and requires exactly IM002. OdbcError::Configuration now carries an error source instead of a String so diagnostics remain accessible without parsing messages.

Refs #3 and #2 (2D).

@81reap

81reap commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator Author

CI failure is unrelated, I think it may be better to first fix the CI #16 and add a flake.nix dev shell to unify all of the different DB drivers. lmk your thoughts @lovasoa !

@81reap
81reap marked this pull request as ready for review November 15, 2026 06:31
@81reap 81reap linked an issue Nov 15, 2026 that may be closed by this pull request

@lovasoa lovasoa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feel free to move fast and break things in this crate :) merge pull requests without my approval, or don't make PRs at all, try multiple things and see what works best, ...

There are no users at the moment

Co-authored-by: 81reap <prayag.bhakar@gmail.com>
@lovasoa lovasoa changed the title test(connection): cover connection error reporting Report local ODBC setup failures as configuration errors Nov 27, 2026
@lovasoa
lovasoa force-pushed the 81reap/connecting/3b branch from 418e90a to f28f027 Compare November 27, 2026 16:13
@lovasoa
lovasoa merged commit 91ca532 into main Nov 27, 2026
7 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.

Connecting

2 participants