Skip to content

Introduce Connection.isValid() method #54

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

Closed
mp911de opened this issue Feb 28, 2019 · 2 comments
Closed

Introduce Connection.isValid() method #54

mp911de opened this issue Feb 28, 2019 · 2 comments
Assignees
Labels
type: enhancement A general enhancement
Milestone

Comments

@mp911de
Copy link
Member

mp911de commented Feb 28, 2019

We should provide a method to test connection validity (connection is open and functional) on the Connection level. This is useful to test connection liveness without the need to specify a validation-query that might be vendor-specific SQL. Drivers might have a better option to test connection validity than using pure SQL.

The method would look like:

Publisher<Void> isValid()

We could also include a notion of validation depth (is connected, is the server working) to run validation on two different levels.

This would result in a method signature like:

Publisher<Void> isValid(ValidationDepth) where ValidationDepth is an enum.

@mp911de mp911de added the type: enhancement A general enhancement label Feb 28, 2019
@mp911de
Copy link
Member Author

mp911de commented Mar 1, 2019

Cross-reference in the mailing list: https://groups.google.com/forum/#!topic/r2dbc/5SKbQwaQ3Gw

@nebhale
Copy link
Member

nebhale commented Apr 12, 2019

Looks good and necessary.

@mp911de mp911de self-assigned this May 23, 2019
mp911de added a commit that referenced this issue Sep 2, 2019
Connection exposes with validate(ValidationDepth) a method for driver-side connection validation. ValidationDepth signals whether it is a local-only validation without incorporating remote communication or whether a full remote validation should be performed.

Drivers typically either check the local connection state or send a database message, query or any other mechanism, to validate the connection.

Resolves #54.
@mp911de mp911de changed the title Proposal: Introduce Connection.isValid() method Introduce Connection.isValid() method Sep 26, 2019
@mp911de mp911de added this to the 0.8.0.RC1 milestone Sep 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants