A command-line tool to fetch and document BigQuery table schemas. This tool can collect schema information for all tables in a specified project. You'll be able to pick the specific tables for which you want to collect tables.
A video on the motivations for this tool can be found here.
- You need a Google Cloud service account credentials file with BigQuery read access. The default name is
service_account_creds.json, in the same working directory as the executable. - The service account must have access to the BigQuery projects you want to query.
- Download the executable from the release page.
- Place your service account credentials JSON file in the same working directory as the executable (default name:
service_account_creds.json) - Run the executable from the command line (see Usage section below).
- Clone the repository.
- Place your service account credentials JSON file in the project directory (default name:
service_account_creds.json) - Build the project:
cargo build --release- Run the executable from the command line (see Usage section below).
# free the executable from quarantine
xattr -d com.apple.quarantine ./schema-searcher
# make the file executable
chmod +x ./schema-searcher
# run the executable
./schema-searcherYou'll be prompted to enter the:
- Path to your service account credentials JSON file
- Project ID
- Name for output file
The tool generates a text file with schema information in the following format:
=== Table: project.dataset.table ===
|- column_name (TYPE) [MODE]
|- nested_field (TYPE) [MODE] # For RECORD types