Skip to content

Commit f790e8e

Browse files
authored
Docs: fix examples with wrong driver creation call (#1092)
1 parent d9643f3 commit f790e8e

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

docs/source/api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -895,7 +895,7 @@ To construct a :class:`neo4j.Session` use the :meth:`neo4j.Driver.session` metho
895895
from neo4j import GraphDatabase
896896
897897
898-
with GraphDatabase(uri, auth=(user, password)) as driver:
898+
with GraphDatabase.driver(uri, auth=(user, password)) as driver:
899899
session = driver.session()
900900
try:
901901
result = session.run("MATCH (a:Person) RETURN a.name AS name")

docs/source/async_api.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ To construct a :class:`neo4j.AsyncSession` use the :meth:`neo4j.AsyncDriver.sess
556556
557557
558558
async def main():
559-
async with AsyncGraphDatabase(uri, auth=(user, password)) as driver:
559+
async with AsyncGraphDatabase.driver(uri, auth=(user, password)) as driver:
560560
session = driver.session()
561561
try:
562562
result = await session.run("MATCH (a:Person) RETURN a.name AS name")

docs/source/breaking_changes.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ The driver configuration argument :code:`encrypted` is by default set to :code:`
4444
4545
from neo4j import GraphDatabase
4646
47-
driver = GraphDatabase("bolt://localhost:7687", auth=("neo4j", "password"), encrypted=True)
47+
driver = GraphDatabase.driver(
48+
"bolt://localhost:7687",
49+
auth=("neo4j", "password"),
50+
encrypted=True,
51+
)
4852
driver.close()
4953
5054

0 commit comments

Comments
 (0)