@proteinjs/db-driver-spanner
v1.1.2
Published
Db driver for Google Spanner
Downloads
779
Readme
Test Environment Setup
- Install Docker
- Install gcloud cli
- Setup the Spanner Emulator on your local machine
- Setup emulator in Docker
docker pull gcr.io/cloud-spanner-emulator/emulator docker run -p 9010:9010 -p 9020:9020 gcr.io/cloud-spanner-emulator/emulator
- Create gcloud config to use when connecting to the emulator
gcloud config configurations create emulator gcloud config set auth/disable_credentials true gcloud config set project proteinjs-test gcloud config set api_endpoint_overrides/spanner http://localhost:9020/
- Note: to switch between configs
gcloud config configurations activate [emulator | default]
- Note: to switch between configs
- Create instance
gcloud spanner instances create proteinjs-test \ --config=emulator-config --description="Protein JS Test Instance" --nodes=1
- Create database
gcloud spanner databases create test --instance=proteinjs-test
- Execute cli query
gcloud spanner databases execute-sql test \ --instance='proteinjs-test' \ --sql='select table_name from information_schema.tables'
- Setup emulator in Docker
- Note: every time you restart the emulator, you need to re-create state (like the instance and the db)