@@ -39,9 +39,9 @@ def hydrate(self, values):
39
39
40
40
41
41
class GraphDatabase (object ):
42
- """ The :class:`. GraphDatabase` class provides access to all graph
43
- database functionality. This is primarily used to construct a driver
44
- instance, using the :meth:`.driver` method.
42
+ """ The ` GraphDatabase` class provides access to all graph
43
+ database functionality. This class is primarily used to construct a
44
+ :class:`.Driver` instance, using the :meth:`.driver` method.
45
45
"""
46
46
47
47
uri_schemes = {}
@@ -50,31 +50,33 @@ class GraphDatabase(object):
50
50
51
51
@classmethod
52
52
def driver (cls , uri , ** config ):
53
- """ Acquire a :class:`.Driver` instance for the given URL and
54
- configuration:
53
+ """ Acquire a :class:`.Driver` instance for the given URI and
54
+ configuration. The URI scheme determines the Driver implementation
55
+ that will be returned. Options are:
55
56
56
- >>> from neo4j.v1 import GraphDatabase
57
- >>> driver = GraphDatabase.driver("bolt://localhost:7687")
57
+ ``bolt``
58
+ Returns a :class:`.DirectDriver`.
58
59
59
- :param uri: URI for a graph database
60
+ ``bolt+routing``
61
+ Returns a :class:`.RoutingDriver`.
62
+
63
+ :param uri: URI for a graph database service
60
64
:param config: configuration and authentication details (valid keys are listed below)
61
65
62
66
`auth`
63
67
An authentication token for the server, for example
64
- ``basic_auth ("neo4j", "password")``.
68
+ ``("neo4j", "password")``.
65
69
66
70
`der_encoded_server_certificate`
67
71
The server certificate in DER format, if required.
68
72
69
73
`encrypted`
70
- Encryption level: one of :attr:`.ENCRYPTION_ON`, :attr:`.ENCRYPTION_OFF`
71
- or :attr:`.ENCRYPTION_NON_LOCAL`. The default setting varies
72
- depending on whether SSL is available or not. If it is,
73
- :attr:`.ENCRYPTION_NON_LOCAL` is the default.
74
+ A boolean flag to determine whether encryption should be used.
75
+ Defaults to :const:`True`.
74
76
75
77
`trust`
76
- Trust level: one of :attr:`.TRUST_ON_FIRST_USE ` (default) or
77
- :attr:`.TRUST_SIGNED_CERTIFICATES `.
78
+ Trust level: one of :attr:`.TRUST_ALL_CERTIFICATES ` (default) or
79
+ :attr:`.TRUST_SYSTEM_CA_SIGNED_CERTIFICATES `.
78
80
79
81
`user_agent`
80
82
A custom user agent string, if required.
@@ -90,12 +92,12 @@ def driver(cls, uri, **config):
90
92
91
93
92
94
class Driver (object ):
93
- """ A : class:`. Driver` is an accessor for a specific graph database
94
- resource . It is thread-safe, acts as a template for sessions and hosts
95
- a connection pool.
95
+ """ The base class for all ` Driver` implementations. A Driver is an accessor for
96
+ a specific graph database . It is typically thread-safe, acts as a template for
97
+ :class:`.Session` creation and hosts a connection pool.
96
98
97
99
All configuration and authentication settings are held immutably by the
98
- ` Driver` . Should different settings be required, a new ` Driver` instance
100
+ Driver. Should different settings be required, a new Driver instance
99
101
should be created via the :meth:`.GraphDatabase.driver` method.
100
102
"""
101
103
@@ -118,10 +120,16 @@ def session(self, access_mode=None):
118
120
pool. Session creation is a lightweight operation and sessions are
119
121
not thread safe, therefore a session should generally be short-lived
120
122
within a single thread.
123
+
124
+ :param access_mode:
125
+ :return: new :class:`.Session` object
121
126
"""
122
127
pass
123
128
124
129
def close (self ):
130
+ """ Shut down, closing any open connections that were spawned by
131
+ this Driver.
132
+ """
125
133
if self .pool :
126
134
self .pool .close ()
127
135
self .pool = None
0 commit comments