Docs & Code Guide

BigQuery schema diagram: per-dataset INFORMATION_SCHEMA, authorized views as edges

Ask BigQuery what it contains and it answers a dataset at a time: INFORMATION_SCHEMA.TABLES is scoped to the dataset you qualify it with, and the project-wide view hides behind a region qualifier that trips up most first attempts. Once you can script the inventory, the diagram falls out of three sources: datasets for zones, authorized views for the edges that cross them, and scheduled queries for the pipeline nodes in between.

7 min readFor analytics engineers mapping a BigQuery project that grew organically

See it as a diagram

Everything below, as a diagram you can edit. Describe yours and see it in seconds.

215/20003 credits left
Try:

No account needed · Editable canvas, not a picture

INFORMATION_SCHEMA is dataset-scoped, and the region qualifier is the escape hatch

The quirk to learn first: myproject.analytics.INFORMATION_SCHEMA.TABLES lists tables in the analytics dataset and nothing else. There is no unqualified project-wide TABLES view. The escape hatch is the region qualifier: querying INFORMATION_SCHEMA through a region prefix such as region-eu covers every dataset in that region at once, at the price that the region must be named and a single query can never span two regions. A project with US and EU datasets needs one inventory query per region, and the results stitched together.

-- One dataset at a time: the default scope
SELECT table_name, table_type
FROM `myproject.analytics`.INFORMATION_SCHEMA.TABLES;

-- Every dataset in a region, one query (note the qualifier)
SELECT schema_name
FROM `myproject`.`region-eu`.INFORMATION_SCHEMA.SCHEMATA;

bq ls when SQL is the wrong hammer

For a script that walks the project, the bq CLI is often simpler than SQL: list datasets, then loop, with JSON output that feeds a generator or an agent without parsing acrobatics. The same CLI is also the practical way to enumerate scheduled queries, which live in the Data Transfer Service rather than in any dataset, and so never appear in INFORMATION_SCHEMA.TABLES no matter how you qualify it.

# Datasets, then tables, as JSON
bq ls --project_id=myproject --format=json
bq ls --format=json myproject:analytics

# Scheduled queries live in the Data Transfer Service
bq ls --transfer_config --transfer_location=eu --project_id=myproject

Authorized views cross the zones; scheduled queries move the data

An authorized view is BigQuery's way of letting readers of one dataset query results computed from another they cannot touch. That grant is an architectural fact: a deliberate, access-controlled edge across a dataset boundary, and exactly the kind of edge a diagram should promote. The grants live in the dataset's access configuration, which bq show --format=prettyjson exposes as access entries referencing views.

Scheduled queries are the other invisible layer. Each one is a recurring job with source SQL and a destination table: in diagram terms, a pipeline node with an input edge you recover by reading its query text and an output edge to its destination. A BigQuery project drawn without its scheduled queries shows shelves of tables and none of the machinery that fills them.

Datasets as zones, and the redraw loop

Datasets map cleanly to zones, and most projects already layer them: raw, staging, marts, plus a sharing dataset where the authorized views live. For the first diagram, the BigQuery diagram generator turns a described or scripted inventory into an editable canvas; the wider platform picture around it has its own guide in GCP data platform diagrams.

For every diagram after the first: an agent connected to Datadef's MCP server, registry name io.datadef/mcp, reruns the inventory queries and updates the diagram in place. BigQuery's own scheduler cannot invoke it, and Datadef does not poll your project; the regeneration runs where your automation lives, a CI cron, a Cloud Scheduler target, or the tail of the pipeline that changed the datasets. One command, with an API key from settings, on paid plans.

The regional fine print

Edges between plain views and their source tables are not handed to you as rows: INFORMATION_SCHEMA.VIEWS returns the SQL text of each view, and extracting referenced tables means parsing it, which an agent does tolerably and a regex does not. When the transformations are managed by dbt or Dataform, their manifests are a cleaner edge source than parsed SQL, and the agent should prefer them.

The live-embed caveat applies here as everywhere: an embedded diagram URL exists only for projects shared public, and a private project's embed 404s. For a confidential warehouse layout, export a static image and accept the staleness trade.

FAQ

How do I list all tables across every dataset in a BigQuery project?

Either loop over datasets with bq ls and query each dataset's INFORMATION_SCHEMA.TABLES, or use the region-qualified form, such as region-eu prefixed INFORMATION_SCHEMA, which covers all datasets in one region per query. There is no single query spanning regions, so multi-region projects need one pass per region.

How do authorized views show up when diagramming BigQuery?

As cross-dataset edges. An authorized view lets readers of its dataset query data from source tables they cannot access directly, and that grant, visible in the source dataset's access entries via bq show, is a deliberate boundary crossing worth drawing as a first-class arrow.

Why do my scheduled queries not appear in INFORMATION_SCHEMA?

Because they are not dataset objects: scheduled queries belong to the Data Transfer Service. List them with bq ls --transfer_config --transfer_location=<region>. On a diagram they are pipeline nodes, with edges from the tables their SQL reads to the destination table they write.

How do I keep a BigQuery architecture diagram up to date?

Rerun the inventory and hand it to an agent that updates the existing diagram: with Datadef, an MCP-connected agent does this in one call, triggered by CI cron, Cloud Scheduler, or the end of the pipeline that changed the datasets. Nothing watches the project by itself; the trigger is yours, the redraw is one command.

Can I get table-level lineage for BigQuery views automatically?

Partially. INFORMATION_SCHEMA.VIEWS gives each view's SQL, from which referenced tables must be parsed, and an agent handles that better than string matching. If dbt or Dataform manages the transformations, their manifests state the dependencies directly and are the better source.