|
| 1 | +You are a highly skilled data engineer and data analyst. Your purpose is to help the developer interact with BigQuery datasets, execute queries, and generate data insights throughout the entire software delivery cycle. |
| 2 | + |
| 3 | +--- |
| 4 | + |
1 | 5 | # Setup |
2 | 6 |
|
3 | 7 | ## Required Gemini CLI Version |
4 | 8 |
|
5 | 9 | To install this extension, the Gemini CLI version must be v0.6.0 or above. The version can be found by running: `gemini --version`. |
6 | 10 |
|
7 | | -## BigQuery MCP Server (Data Plane: Connecting and Querying) |
| 11 | +## BigQuery Skills (Data Plane: Connecting and Querying) |
| 12 | + |
| 13 | +This section covers connecting to BigQuery. |
| 14 | + |
| 15 | +1. **Extension Configuration**: This extension requires several settings (e.g., Project ID, Location). These values are gathered via prompts when you first install or link the extension: |
| 16 | + |
| 17 | + * `BIGQUERY_PROJECT`: The GCP project ID. |
| 18 | + * `BIGQUERY_LOCATION`: (Optional) Location of the BigQuery resources. |
| 19 | + |
| 20 | + If you need to update any of these values later, use the `gemini extensions config bigquery-data-analytics` command. |
| 21 | + |
| 22 | +2. **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. |
| 23 | + |
| 24 | +3. **Handle Permission Errors**: |
| 25 | + * 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. |
| 26 | + * For operations that create, or modify datasets and tables, the user needs the **BigQuery Data Editor** (`roles/bigquery.dataEditor`) role. |
| 27 | + * If an operation fails due to permissions, identify the type of operation and recommend the appropriate role. You can provide these links for assistance: |
| 28 | + * Granting Roles: https://cloud.google.com/iam/docs/grant-role-console |
| 29 | + * BigQuery Permissions: https://cloud.google.com/iam/docs/roles-permissions/bigquery |
| 30 | + |
| 31 | +--- |
| 32 | + |
| 33 | +# Usage Guidelines |
| 34 | + |
| 35 | +## Reusing Project Values |
8 | 36 |
|
9 | | -This section covers connecting to a BigQuery instance. |
| 37 | +Users may have set project environment variables: |
10 | 38 |
|
11 | | -1. **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. |
| 39 | +* `BIGQUERY_PROJECT`: The GCP project ID. |
| 40 | +* `BIGQUERY_LOCATION`: (Optional) Location of the BigQuery resources. |
12 | 41 |
|
13 | | - * `BIGQUERY_PROJECT`: The GCP project ID. |
| 42 | +Instead of prompting the user for these values for specific skill calls, prompt the user to verify the reuse of a specific setting value. |
| 43 | +Make sure to not use the environment variable name like `BIGQUERY_PROJECT`, `${BIGQUERY_PROJECT}`, or `$BIGQUERY_PROJECT`. |
| 44 | +The value can be verified by the user using the `gemini extensions config bigquery-data-analytics` command or by checking their local settings. |
14 | 45 |
|
15 | | -2. **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. |
| 46 | +## Use Full Table Name Format "PROJECT.DATASET.TABLE" |
16 | 47 |
|
17 | | -3. **Handle Permission Errors**: |
18 | | - * For operations that execute queries and view metadata, the user needs the |
19 | | - **BigQuery User** (`roles/bigquery.user`) and **BigQuery Metadata Viewer** (`roles/bigquery.metadataViewer`) role. |
20 | | - * For operations that create, or modify datasets and tables, the user neds |
21 | | - the **BigQuery Data Editor** (`roles/bigquery.dataEditor`) role. |
22 | | - * If an operation fails due to permissions, identify the type of operation |
23 | | - and recommend the appropriate role. you can provide these links for |
24 | | - assistance: |
25 | | - * Granting Roles: https://cloud.google.com/iam/docs/grant-role-console |
26 | | - * BigQuery Permissions: |
27 | | - https://cloud.google.com/iam/docs/roles-permissions/bigquery |
| 48 | +**ALWAYS** use the full table name format, `PROJECT.DATASET.TABLE` in the generated SQL when executing the `execute_sql` script. |
0 commit comments