PUBLISHED:
CATEGORY: Stripe ▸ Analytics GUI
TAGS:

Querying Stripe data from BigQuery

BigQuery is a managed SQL based query engine that scales to petabytes.

BigQuery has an EXTERNAL_QUERY SQL function that lets you query external MySQL or Postgres based Cloud SQL instances.

The tdog CLI can write your Stripe account to MySQL or Postgres databases.

Example external query (AKA federated query)

An example federated query, run on BigQuery that queries an external SQL database:

SELECT * FROM EXTERNAL_QUERY(
    'mysql_connection_id_set_in_bigquery_admin',
    '''SELECT * FROM customers AS c''' # MySQL or Postgres SQL query
);

Note: The SQL string provided as an arg to EXTERNERAL_QUERY is in the MySQL/Postgres SQL dialect, not BigQuery

EXTERNAL_QUERY also works with Cloud Spanner. tdog writes to Cloud Spanner natively.

Try tdog for free against a Stripe test account