# Inspect BigQuery Schemas with the bq CLI

BigQuery exploration can expose sensitive data or consume excessive resources. This skill provides cautious bq patterns for schema inspection, table discovery, row counts, and cost checks.

## Install

```bash
npx skillstore add bfdcampos/bigquery
```

## Metadata

- Status: approved
- Slug: bfdcampos-bigquery
- Skillstore revision: r2
- Version status: missing
- Tree hash: b968e4b4dd082779f4fe9fd09d0fa114f708d03c7db8eba9a7667459d4eaf6b0
- Author: BfdCampos
- GitHub username: BfdCampos
- License: MIT
- Repository: https://github.com/BfdCampos/dotfiles/tree/main/claude/skills/bigquery
- Ref: 8c3e20bba512c392d9b02ee748b18e0b09d4982c
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, filesystem
- Quality score: 70
- Public page: https://skillstore.pages.dev/skills/bfdcampos-bigquery
- Manifest: https://skillstore.pages.dev/api/skills/bfdcampos-bigquery/manifest

## Capabilities

- Creates bq query patterns for column, table, and schema inspection through INFORMATION\_SCHEMA.
- Shows row-count checks that avoid returning table contents.
- Lists tables and searches names with configurable project, dataset, and pattern placeholders.
- Explains CSV, JSON, quiet, and row-limit output options.
- Supports cautious table sampling, dry runs, and dbt source validation workflows.

## Use Cases

- Inspect source schemas: Review column names and types before creating or updating dbt source models.
- Discover warehouse tables: Find relevant tables by name while avoiding access to stored row content.
- Investigate pipeline failures: Verify source existence, schema changes, and table size before deeper debugging.

## Prompt Templates

### Inspect a table schema

```
Show how to inspect columns and types for [PROJECT].[DATASET].[TABLE] using Standard SQL. Do not query table rows.
```

### Find matching tables

```
Create a bq command that lists tables in [PROJECT].[DATASET] matching [PATTERN]. Explain placeholders and keep the query metadata-only.
```

### Diagnose a warehouse error

```
Help diagnose this BigQuery or dbt error: [ERROR]. Verify table existence and schema, then suggest the least invasive next check.
```

### Plan a controlled investigation

```
Design a cautious investigation for [DATA_ISSUE] in [PROJECT].[DATASET]. Include permission checks, cost estimation, metadata queries, and approval before sampling rows.
```

## Limitations

- Requires an installed, authenticated bq CLI and sufficient Google Cloud permissions.
- Includes Monzo-specific examples that must be replaced for other organizations.
- Cannot guarantee query cost, data classification, or authorization decisions.
- Sampling guidance must not be used for sensitive tables without explicit approval.

## Best Practices

- Confirm the project, dataset, permissions, and data classification before running any query.
- Start with INFORMATION\_SCHEMA, row counts, and dry runs before accessing table contents.
- Use fully qualified identifiers, Standard SQL, explicit limits, and approved output destinations.

## Anti Patterns

- Do not query PII, employee, credential, or financial rows without explicit authorization.
- Do not treat metadata access as universally safe or free.
- Do not write query results to predictable shared temporary paths.

## Security Audit

- Audited at: 2026-07-23T11:42:54.83\+00:00
- Summary: All 81 Ruby or shell backtick alerts are false positives caused by Markdown and BigQuery identifier syntax, and both reconnaissance alerts are benign guidance. Two fixed /tmp writes remain confirmed, while semantic review found overbroad metadata authorization and disclosure of organization-specific cloud identifiers.

## Stats

- Views: 298
- Downloads: 9
- Favorites: 0
- Popularity score: 0
