https://github.com/cloudspannerecosystem/sampledb
Quickly get a sample database into Cloud Spanner
https://github.com/cloudspannerecosystem/sampledb
Last synced: 5 months ago
JSON representation
Quickly get a sample database into Cloud Spanner
- Host: GitHub
- URL: https://github.com/cloudspannerecosystem/sampledb
- Owner: cloudspannerecosystem
- License: apache-2.0
- Created: 2020-01-13T05:38:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-08-13T00:29:19.000Z (almost 6 years ago)
- Last Synced: 2023-11-14T00:37:23.172Z (over 2 years ago)
- Language: Python
- Homepage:
- Size: 1.88 MB
- Stars: 5
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: docs/contributing.md
- License: LICENSE
- Code of conduct: docs/code-of-conduct.md
Awesome Lists containing this project
README
# SampleDB
[](https://circleci.com/gh/cloudspannerecosystem/sampledb)
This application allows you to quickly get a sample database into Cloud Spanner.
It does so by loading data from a CSV file into a new Cloud Spanner database.
The data contained in the CSV file is sourced from the "Hacker News - Y
Combinator" BigQuery
[public dataset](https://cloud.google.com/bigquery/public-data/).
Please feel free to report issues and send pull requests, but note that this
application is not officially supported as part of the Cloud Spanner product.
## Setup
### Create an instance
[Create a Cloud Spanner instance](https://cloud.google.com/spanner/docs/quickstart-console)
if you haven't already done so. Remember the instance name, as you'll need it
when running the application.
### Authentication
This sample requires you to have authentication set up. Refer to the
[Authentication Getting Started Guide](https://cloud.google.com/docs/authentication/getting-started)
for instructions on setting up credentials for applications.
### Install Dependencies
* Install [`pip`](https://pip.pypa.io/) and
[`virtualenv`](https://virtualenv.pypa.io/) if you do not already have them.
You may want to refer to the [Python Development Environment Setup
Guide](https://cloud.google.com/python/setup) for Google Cloud Platform for
instructions.
* Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+.
virtualenv env
source env/bin/activate
* Install the dependencies needed to run the samples.
pip install -r requirements.txt
## Run the application
python batch_import.py
* ``: your Cloud Spanner instance ID.
* ``: the Cloud Spanner database ID; the application will create
and populate this database.