Skip to content

Commit aaf17e6

Browse files
authored
Document Driver.verify_connectivity + add experimental notes (#668)
1 parent 289ef6e commit aaf17e6

File tree

4 files changed

+22
-4
lines changed

4 files changed

+22
-4
lines changed

docs/source/api.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ This object holds the details required to establish connections with a Neo4j dat
144144
:class:`neo4j.Driver` objects hold a connection pool from which :class:`neo4j.Session` objects can borrow connections.
145145
Closing a driver will immediately shut down all connections in the pool.
146146

147+
.. note::
148+
Driver objects only open connections and pool them as needed. To verify that
149+
the driver is able to communicate with the database without executing any
150+
query, use :meth:`neo4j.Driver.verify_connectivity`.
151+
147152
.. autoclass:: neo4j.Driver()
148153
:members: session, encrypted, close, verify_connectivity, get_server_info
149154

docs/source/async_api.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,11 @@ This object holds the details required to establish connections with a Neo4j dat
127127
:class:`neo4j.AsyncDriver` objects hold a connection pool from which :class:`neo4j.AsyncSession` objects can borrow connections.
128128
Closing a driver will immediately shut down all connections in the pool.
129129

130+
.. note::
131+
Driver objects only open connections and pool them as needed. To verify that
132+
the driver is able to communicate with the database without executing any
133+
query, use :meth:`neo4j.AsyncDriver.verify_connectivity`.
134+
130135
.. autoclass:: neo4j.AsyncDriver()
131136
:members: session, encrypted, close, verify_connectivity, get_server_info
132137

neo4j/_async/driver.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ async def verify_connectivity(self, **config):
307307
connectivity problem.
308308
309309
.. versionchanged:: 5.0 the config parameters will be removed in
310-
version 6 0. It has no effect starting in version 5.0.
310+
version 6 0. It has no effect starting with version 5.0.
311311
"""
312312
if config:
313313
deprecation_warn(
@@ -342,12 +342,16 @@ async def get_server_info(self):
342342
async with self.session() as session:
343343
return await session._get_server_info()
344344

345-
@experimental("Feature support query, based on Bolt Protocol Version and Neo4j Server Version will change in the future.")
345+
@experimental("Feature support query, based on Bolt protocol version and Neo4j server version will change in the future.")
346346
async def supports_multi_db(self):
347347
""" Check if the server or cluster supports multi-databases.
348348
349349
:return: Returns true if the server or cluster the driver connects to supports multi-databases, otherwise false.
350350
:rtype: bool
351+
352+
.. note::
353+
Feature support query, based on Bolt Protocol Version and Neo4j
354+
server version will change in the future.
351355
"""
352356
async with self.session() as session:
353357
await session._connect(READ_ACCESS)

neo4j/_sync/driver.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ def verify_connectivity(self, **config):
307307
connectivity problem.
308308
309309
.. versionchanged:: 5.0 the config parameters will be removed in
310-
version 6 0. It has no effect starting in version 5.0.
310+
version 6 0. It has no effect starting with version 5.0.
311311
"""
312312
if config:
313313
deprecation_warn(
@@ -342,12 +342,16 @@ def get_server_info(self):
342342
with self.session() as session:
343343
return session._get_server_info()
344344

345-
@experimental("Feature support query, based on Bolt Protocol Version and Neo4j Server Version will change in the future.")
345+
@experimental("Feature support query, based on Bolt protocol version and Neo4j server version will change in the future.")
346346
def supports_multi_db(self):
347347
""" Check if the server or cluster supports multi-databases.
348348
349349
:return: Returns true if the server or cluster the driver connects to supports multi-databases, otherwise false.
350350
:rtype: bool
351+
352+
.. note::
353+
Feature support query, based on Bolt Protocol Version and Neo4j
354+
server version will change in the future.
351355
"""
352356
with self.session() as session:
353357
session._connect(READ_ACCESS)

0 commit comments

Comments
 (0)