Skip to content

Commit

Permalink
docs: add a querying example into the main readme (#515)
Browse files Browse the repository at this point in the history
* docs: add a querying example into the main readme

* Update README.rst

* Update README.rst

Co-authored-by: MF2199 <38331387+mf2199@users.noreply.github.com>
  • Loading branch information
Ilya Gurov and mf2199 committed Sep 29, 2020
1 parent 72096f5 commit c477cc2
Showing 1 changed file with 21 additions and 4 deletions.
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"
)
results = cur.fetchall()
Limitations
-----------

Expand Down

0 comments on commit c477cc2

Please sign in to comment.