Skip to content

Latest commit

 

History

History
executable file
·
48 lines (38 loc) · 1.71 KB

README.md

File metadata and controls

executable file
·
48 lines (38 loc) · 1.71 KB

README

Project Summary

In this tutorial, we'll learn how to use Google Cloud Spanner by following the examples provided in the documentation.

Requirements

  • If you haven't already, you may sign-up for the free GCP trial credit.
    Before you begin, set-up your project and enable billing.
  • (optional, but recommended) Set-up a Python virtual environment:
    $ pyenv virtualenv gcp_env
    $ pyenv activate gcp_env
  • Install the Spanner Python API:
$ pip install -r requirements.txt

Run Code

  1. Create a Spanner instance and create a Singers table in the UI as shown here. (You may also run the spanner-setup.sh script to take care of this step.
$ chmod +x spanner-setup.sh
$ ./spanner-setup.sh

)
2. Write to the Singers table.

$ python write-to-table.py

These values are now visible in the UI.

Clean-up

$ pyenv deactivate

Reference

GCP Spanner repo