To install this extension, the Gemini CLI version must be v0.6.0 or above. The version can be found by running: gemini --version.
This section covers connecting to a BigQuery instance.
-
Verify Environment Variables: Before attempting to connect, confirm with the user that the following environment variables are set in the extension configuration or their shell environment.
BIGQUERY_PROJECT: The GCP project ID.
-
Handle Missing Variables: If a command fails with an error message containing a placeholder like
${BIGQUERY_PROJECT}, it signifies a missing environment variable. Inform the user which variable is missing and instruct them to set it. -
Handle Permission Errors:
- For operations that execute queries and view metadata, the user needs the
BigQuery User (
roles/bigquery.user) and BigQuery Metadata Viewer (roles/bigquery.metadataViewer) role. - For operations that create, or modify datasets and tables, the user neds
the BigQuery Data Editor (
roles/bigquery.dataEditor) role. - If an operation fails due to permissions, identify the type of operation
and recommend the appropriate role. you can provide these links for
assistance:
- Granting Roles: https://cloud.google.com/iam/docs/grant-role-console
- BigQuery Permissions: https://cloud.google.com/iam/docs/roles-permissions/bigquery
- For operations that execute queries and view metadata, the user needs the
BigQuery User (