Skip to content

Files

Latest commit

73e34e2 · Feb 14, 2023

History

History
This branch is 1 commit ahead of, 83 commits behind firebase/functions-samples:main.

bigquery-import

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Feb 14, 2023
Feb 21, 2017

Import Data to Big Query

This template shows how to copy data from the Realtime Database (such as logs being written there) to Google Cloud's BigQuery.

Function Code

See file functions/index.js for the code.

The dependencies are listed in functions/package.json.

Sample Database Structure

As an example we'll be using a simple logs database structure:

/functions-project-12345
    /logs
        /key-123456
            text: "User signed in."
        /key-123457
            text: "Error: Could not connect to Database"

Setting up the sample

Set the bigquery.datasetName and bigquery.tableName Google Cloud environment variables to match the Dataset name and the Table name where you want the logs written to. For this use:

firebase functions:config:set bigquery.datasetName="bar" bigquery.tableName="baz"