Skip to content

Commit

Permalink
Improve the session pool documentation. (#4049)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukesneeringer authored Sep 25, 2017
1 parent 2459682 commit 24c22b2
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions docs/spanner/database-usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,15 @@ constructor:

.. code-block:: python
from google.cloud.spanner import Client
from google.cloud.spanner import FixedSizePool
client = Client()
instance = client.instance(INSTANCE_NAME)
pool = FixedSizePool(size=10, default_timeout=5)
database = instanc.database(DATABASE_NAME, pool=pool)
from google.cloud import spanner
# Instantiate the Spanner client, and get the appropriate instance.
client = spanner.Client()
instance = client.instance(INSTANCE_NAME)
# Create a database with a pool of a fixed size.
pool = spanner.FixedSizePool(size=10, default_timeout=5)
database = instance.database(DATABASE_NAME, pool=pool)
Note that creating a database with a pool may presume that its database
already exists, as it may need to pre-create sessions (rather than creating
Expand Down

0 comments on commit 24c22b2

Please sign in to comment.