Reputation: 1237
I would like to create a hello world Python app which calls a simple Google Cloud Spanner table.
I'd like an end-to-end example with population of the DB, querying a couple of tables and possibly inserting an element from App Engine endpoint. [1] provides a good initial guidance but I was hoping for some cut-and-paste code.
[1] https://cloud.google.com/spanner/docs/reference/libraries#client-libraries-usage-python
Upvotes: 0
Views: 692
Reputation: 394
If you're using App Engine standard, unfortunately you'll have to use the REST API, documented on the page you linked:
The Cloud Spanner Client Libraries mentioned on this page are supported on Google Compute Engine (GCE), Google App Engine - Flexible Environment, and Google Container Engine (GKE). If you are using Google App Engine - Standard Environment, please access Cloud Spanner using the REST Interface, instead of the client libraries.
If you use App Engine flexible environment you can reference Getting Started with Python.
Upvotes: 2