Skip to content
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

disconnect #78

Merged
merged 1 commit into from
Dec 24, 2024
Merged

disconnect #78

merged 1 commit into from
Dec 24, 2024

Conversation

jraymakers
Copy link
Contributor

Implement connection.disconnect() (and the synonym connection.close()).

The challenge was dealing with the automatic disconnect during finalization and also double-disconnect. To make this work I had to add another layer of indirection around the connection object, so it can be nulled out. Luckily this wasn't too bad.

Added some error handling with helpful exception messages for trying to do things (query, prepare, etc.) on a disconnected connection. Some C API functions don't initialize their out parameters in some error conditions, so I added some defense-in-depth against that. Added several unit tests, at both the bindings and api layers.

@jraymakers jraymakers merged commit 7898d26 into main Dec 24, 2024
5 checks passed
@jraymakers jraymakers deleted the jray/disconnect branch December 24, 2024 00:48
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