Skip to content

Conversation

@AndrewJackson2020
Copy link

@AndrewJackson2020 AndrewJackson2020 commented Dec 23, 2024

Currently the is_valid function uses SELECT 1; to check on the health of a connection but this can be improved a bit by replacing it with an empty query. I believe this accomplishes the same thing as the current state of code and saves the query from needing to go the planning stage in the postgres server.

See psycopg's implementation for example:
psycopg/psycopg#791

@sfackler
Copy link
Collaborator

Thanks!

@sfackler sfackler merged commit e1c5f85 into rust-postgres:master Dec 23, 2024
1 check failed
@AndrewJackson2020 AndrewJackson2020 deleted the minimal_health_check branch December 23, 2024 15:59
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.

2 participants