22Driver Objects
33==============
44
5- Every Neo4j-backed application will require a :class: `.Driver ` object.
5+ Every Neo4j-backed application will require a :class: `neo4j .Driver ` object.
66This object holds the details required to establish connections with a Neo4j database, including server URIs, credentials and other configuration.
7- :class: `.Driver ` objects hold a connection pool from which :class: `.Session ` objects can borrow connections.
7+ :class: `neo4j .Driver ` objects hold a connection pool from which :class: `neo4j .Session ` objects can borrow connections.
88Closing a driver will immediately shut down all connections in the pool.
99
1010Construction
1111============
1212
13- :class: `.Driver ` construction can either be carried out directly or via a `classmethod ` on the :class: `.GraphDatabase ` class.
13+ :class: `neo4j .Driver ` construction can either be carried out directly or via a `classmethod ` on the :class: `neo4j .GraphDatabase ` class.
1414
1515.. autoclass :: neo4j.GraphDatabase
1616 :members: driver
1717
18- .. autoclass :: neo4j.Driver(uri, **config )
18+ .. autoclass :: neo4j.Driver()
1919 :members: session, close, closed
2020
2121
2222URI
2323===
2424
25- On construction, the scheme of the URI determines the type of :class: `.Driver ` object created.
26- Each supported scheme maps to a particular :class: `.Driver ` subclass that implements a specific behaviour.
27- The remainder of the URI should be considered subclass-specific.
25+ On construction, the `scheme ` of the URI determines the type of :class: `neo4j.Driver ` object created.
26+
27+ Example URI::
28+
29+ uri = bolt://localhost:7676
30+
31+ Example URI::
32+
33+ uri = neo4j://localhost:7676
34+
35+ Each supported scheme maps to a particular :class: `neo4j.Driver ` subclass that implements a specific behaviour.
2836
2937The alternative behaviours are described in the subsections below.
3038
3139
32- Bolt Direct
33- -----------
40+ BoltDriver
41+ ----------
3442
35- URI scheme :
36- ``bolt ``
43+ URI schemes :
44+ ``bolt ``, `` bolt+ssc ``, `` bolt+s ``
3745Driver subclass:
38- :class: `.BoltDriver `
46+ :class: `neo4j .BoltDriver `
3947
4048.. autoclass :: neo4j.BoltDriver
4149
4250
43- Bolt Routing
51+ Neo4jDriver
4452------------
4553
46- URI scheme :
47- ``neo4j ``
54+ URI schemes :
55+ ``neo4j ``, `` neo4j+ssc ``, `` neo4j+s ``
4856Driver subclass:
49- :class: `.Neo4jDriver `
57+ :class: `neo4j .Neo4jDriver `
5058
5159.. autoclass :: neo4j.Neo4jDriver
5260
5361
5462Configuration
5563=============
5664
57- Additional configuration, including authentication details, can be provided via the :class: `.Driver ` constructor.
65+ Additional configuration, including authentication details, can be provided via the :class: `neo4j .Driver ` constructor.
5866
5967``auth ``
6068--------
@@ -71,14 +79,18 @@ Alternatively, one of the auth token functions can be used.
7179-------------
7280
7381A boolean indicating whether or not TLS should be used for connections.
74- Defaults to :py:const: `True ` if TLS is available.
82+
83+ :Type: ``bool ``
84+ :Default: :py:const: `True `
85+
7586
7687``trust ``
7788---------
7889
7990The trust level for certificates received from the server during TLS negotiation.
8091This setting does not have any effect if ``encrypted `` is set to :py:const: `False `.
8192
93+
8294.. py :attribute :: neo4j.TRUST_ALL_CERTIFICATES
8395
8496 Trust any server certificate (default). This ensures that communication
@@ -92,6 +104,8 @@ This setting does not have any effect if ``encrypted`` is set to :py:const:`Fals
92104 certificate authority. This option is primarily intended for use with
93105 full certificates.
94106
107+ :Default: ``neo4j.TRUST_SYSTEM_CA_SIGNED_CERTIFICATES ``.
108+
95109``user_agent ``
96110--------------
97111
@@ -149,7 +163,7 @@ For example::
149163Object Lifetime
150164===============
151165
152- For general applications, it is recommended to create one top-level :class: `.Driver ` object that lives for the lifetime of the application.
166+ For general applications, it is recommended to create one top-level :class: `neo4j .Driver ` object that lives for the lifetime of the application.
153167For example:
154168
155169.. code-block :: python
@@ -164,10 +178,10 @@ For example:
164178 def close (self ):
165179 self .driver.close()
166180
167- Connection details held by the :class: `.Driver ` are immutable.
168- Therefore if, for example, a password is changed, a replacement :class: `.Driver ` object must be created.
181+ Connection details held by the :class: `neo4j .Driver ` are immutable.
182+ Therefore if, for example, a password is changed, a replacement :class: `neo4j .Driver ` object must be created.
169183More than one :class: `.Driver ` may be required if connections to multiple databases, or connections as multiple users, are required.
170184
171- :class: `.Driver ` objects are thread-safe but cannot be shared across processes.
185+ :class: `neo4j .Driver ` objects are thread-safe but cannot be shared across processes.
172186Therefore, ``multithreading `` should generally be preferred over ``multiprocessing `` for parallel database access.
173- If using ``multiprocessing `` however, each process will require its own :class: `.Driver ` object.
187+ If using ``multiprocessing `` however, each process will require its own :class: `neo4j .Driver ` object.
0 commit comments