Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add a querying example into the main readme #515

Merged
merged 5 commits into from Sep 29, 2020
Merged
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
25 changes: 21 additions & 4 deletions README.rst
Expand Up @@ -74,10 +74,8 @@ Format
},
}

Example
~~~~~~~

For example:
Database configurations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

Expand All @@ -90,6 +88,25 @@ For example:
}
}

Execute a query
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

from google.cloud.spanner_dbapi import connect

connection = connect("instance-id", "database-id")
cursor = connection.cursor()

cursor.execute(
"SELECT *"
"FROM Singers"
"WHERE SingerId = 15"
)
IlyaFaer marked this conversation as resolved.
Show resolved Hide resolved

results = cur.fetchall()


Limitations
-----------

Expand Down