From efcadc4c5a368f57740085f84697d463f33ddc85 Mon Sep 17 00:00:00 2001 From: Ilya Gurov Date: Fri, 18 Sep 2020 13:50:45 +0300 Subject: [PATCH 1/3] docs: add a querying example into the main readme --- README.rst | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 9b411d1510..f0c6f21421 100644 --- a/README.rst +++ b/README.rst @@ -74,11 +74,9 @@ Format }, } -Example +Database configurations ~~~~~~~ -For example: - .. code:: python DATABASES = { @@ -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 ----------- From d3fe7c2c4ea8af3e5803400f589f8cf057955449 Mon Sep 17 00:00:00 2001 From: Ilya Gurov Date: Fri, 18 Sep 2020 14:04:28 +0300 Subject: [PATCH 2/3] Update README.rst --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index f0c6f21421..8e5061c6ac 100644 --- a/README.rst +++ b/README.rst @@ -75,7 +75,7 @@ Format } Database configurations -~~~~~~~ +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .. code:: python From a2ea7cdb9a3acadb5cffed79357d7d511deeea5f Mon Sep 17 00:00:00 2001 From: Ilya Gurov Date: Tue, 29 Sep 2020 21:56:18 +0300 Subject: [PATCH 3/3] Update README.rst --- README.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.rst b/README.rst index 69c4d03b53..41b024443a 100644 --- a/README.rst +++ b/README.rst @@ -99,9 +99,9 @@ Execute a query cursor = connection.cursor() cursor.execute( - "SELECT *" - "FROM Singers" - "WHERE SingerId = 15" + "SELECT *" + "FROM Singers" + "WHERE SingerId = 15" ) results = cur.fetchall()