Skip to content

Commit 9ad75ca

Browse files
Improve the session pool documentation. (#4049)
1 parent a35d84a commit 9ad75ca

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

docs/spanner/database-usage.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -220,12 +220,15 @@ constructor:
220220

221221
.. code-block:: python
222222
223-
from google.cloud.spanner import Client
224-
from google.cloud.spanner import FixedSizePool
225-
client = Client()
226-
instance = client.instance(INSTANCE_NAME)
227-
pool = FixedSizePool(size=10, default_timeout=5)
228-
database = instanc.database(DATABASE_NAME, pool=pool)
223+
from google.cloud import spanner
224+
225+
# Instantiate the Spanner client, and get the appropriate instance.
226+
client = spanner.Client()
227+
instance = client.instance(INSTANCE_NAME)
228+
229+
# Create a database with a pool of a fixed size.
230+
pool = spanner.FixedSizePool(size=10, default_timeout=5)
231+
database = instance.database(DATABASE_NAME, pool=pool)
229232
230233
Note that creating a database with a pool may presume that its database
231234
already exists, as it may need to pre-create sessions (rather than creating

0 commit comments

Comments
 (0)