sql

command
v0.0.0-...-e560ebb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2021 License: BSD-3-Clause Imports: 13 Imported by: 0

README

Stats UI SQL Scripts

SQL statements to materialize the data shown in the stats UI.

These scripts are run as BigQuery scheduled queries under the chrome-trooper-analytics project.

Deploying

./deploy.sh

This will run the script and compare the SQL locally to the SQL in GCP. If they do not match, the local version will be uploaded.

Alternatives considered

This tool was created because of a lack of other options to run these materialization scripts. Here are the alternative approaches considered and what the issues were

  • BQ command-line tool: While this tool can create BigQuery scheduled queries, it always creates new ones and cannot replace existing queries.
  • Internal workflows: Currently does not support the merge statement.
  • Terraform: Terraform is probably a viable option. It does require the team to adopt new tools and workflows however. We could migrate to terraform in the future as Terraform is much better supported.

TODO

Explore some form of templating with deploy.go (CL Discussion)

Documentation

Overview

The deploy command deploys Scheduled Queries into BigQuery

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL