Skip to content

Latest commit

 

History

History
60 lines (42 loc) · 1.82 KB

README.md

File metadata and controls

60 lines (42 loc) · 1.82 KB

spannerbox

spannerbox is a set of tools to work with Spanner locally, distributed as docker image.

WARNING!!

spannerbox MUST NOT be used in production.

Batteries Included

  • emulator
  • spanner-cli
  • spanner-dump
  • spanner-truncate

Usage

The following environment variables can be used to customize spannerbox container:

  • SPANNER_PROJECT_ID: Google project ID (default to test-project)
  • SPANNER_INSTANCE_ID: Spanner instance ID (default to test-instance)
  • SPANNER_DATABASE_ID: Spanner Database ID (default to test-database)

Example of running spannerbox using docker:

export SPANNER_PROJECT_ID=test-project
export SPANNER_INSTANCE_ID=test-instance
export SPANNER_DATABASE_ID=test-database

docker run \
    -p 9010:9010 \
    --name spanner \
    -e SPANNER_PROJECT_ID=$SPANNER_PROJECT_ID \
    -e SPANNER_INSTANCE_ID=$SPANNER_INSTANCE_ID \
    -e SPANNER_DATABASE_ID=$SPANNER_DATABASE_ID \
    iromli/spannerbox:$VERSION emulator
NOTE about $VERSION

See Releases for available $VERSION. The v prefix must be omitted when using tag, for example: spannerbox:1.0.0 instead of spannerbox:v1.0.0.

The database can be accessed using command as seen below:

docker exec -ti spanner spanner-cli

Credits

Disclaimer

This is not an official Google product.