Skip to content

fix(go/adbc): Forward SQLSTATE and vendor code #2801

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

felipecrv
Copy link
Contributor

Closes #2800

@felipecrv felipecrv requested a review from zeroshade as a code owner May 8, 2025 19:34
@felipecrv felipecrv requested review from lidavidm and removed request for zeroshade May 8, 2025 19:34
@github-actions github-actions bot modified the milestone: ADBC Libraries 19 May 8, 2025
@felipecrv felipecrv requested a review from zeroshade May 8, 2025 19:34
// If there are no details, but we have a `VendorCode`, let's override
// `vendor_code` and not populate `private_data` with the error details.
if numDetails == 0 && adbcError.VendorCode != 0 && adbcError.VendorCode != C.ADBC_ERROR_VENDOR_CODE_PRIVATE_DATA {
err.vendor_code = C.int(adbcError.VendorCode)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zeroshade if you are OK with this approach I will change the go.tmpl file and make regenerate.

Copy link
Member

Choose a reason for hiding this comment

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

This looks good to me. I wonder if there's any good way we could add a test for this (perhaps using the sqlite driver or otherwise?)

@felipecrv felipecrv force-pushed the sqlstate-and-vendor branch from fe717e5 to 97f831f Compare May 9, 2025 18:03
@felipecrv
Copy link
Contributor Author

I applied the fix to my fork, so this will be another issue/PR I procrastinate on because of my own prioritization requirements.

I applied the change to the template and re-generated the sources. What is missing (and is more time-consuming) is adding the tests.

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.

go: Go drivers don't forward the SQLSTATE and vendor code when they can
2 participants