Skip to content

Latest commit

 

History

History

bhatura

Description

This is a recipe that provides an endpoint that could be used to periodically dump the data from BigQuery to a Postgres database.

This project is based on Nest framework.

Installation

$ npm install

Before you begin

  1. Select or create a Cloud Platform project.
  2. Enable the Google BigQuery API.
  3. Set up authentication with a service account so you can access the API from your local workstation.

Configuration

  • copy .env.sample to .env
    • Update BigQuery credentials
  • copy ormconfig.json.sample to ormconfig.json
    • Update database credentials

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# production mode
$ npm run start:prod

Usage

http://glific.test:3001/bq/contact

  • returns the contact data from BigQuery and saves it to local postgres database/

Test

# unit tests
$ npm run test

# e2e tests
$ npm run test:e2e

# test coverage
$ npm run test:cov

Recipe

You can find the Bhatura recipe here