0

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

PrecariousJimi
  • 1,503
  • 8
  • 20
Riccardo
  • 1,104
  • 13
  • 22

1 Answers1

2

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.

Albert Cui
  • 394
  • 1
  • 4