用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/GoogleCloudPlatform/codelabs --skill database-query-skill命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | database-query-skill |
| description | Query AlloyDB databases via the QueryData API. |
This skill provides instructions for querying AlloyDB databases in Google Cloud by making direct API calls to the QueryData interface.
Use the QueryData API to submit natural language prompts using environment parameters (GOOGLE_CLOUD_PROJECT, ALLOYDB_LOCATION, ALLOYDB_CLUSTER, ALLOYDB_INSTANCE, ALLOYDB_DATABASE, and QUERYDATA_CONTEXTSET):
datasourceReferences: A mapping of datasource types to their references.
alloydb: Reference to an AlloyDB datasource.
databaseReference: Database details.
projectId: Google Cloud project ID (from GOOGLE_CLOUD_PROJECT).region: Region where AlloyDB cluster is located (from ALLOYDB_LOCATION).clusterId: ID of the AlloyDB cluster (from ALLOYDB_CLUSTER).instanceId: ID of the primary AlloyDB instance (from ALLOYDB_INSTANCE).databaseId: Name of the database (from ALLOYDB_DATABASE).tableIds: List of database tables included in requests.agentContextReference: Reference to a predefined context set that describes the database schema, rules, and examples.
contextSetId: Resource name of the context set (from QUERYDATA_CONTEXTSET, formatted as projects/{project}/locations/{location}/contextSets/{contextSetId}).generationOptions: Options to customize the output.
generateNaturalLanguageAnswer: Whether to generate a conversational answer.generateQueryResult: Whether to execute the query and return the result rows.generateExplanation: Whether to generate an explanation of how the query was constructed.The QueryData API automatically translates the natural language prompt into SQL, executes it against the database, and returns the query results along with a natural language answer.
Single Execution Rule: Make EXACTLY ONE call to QueryData API per request.
Parse the JSON response from QueryData API and format the response to the user with the following sections:
generatedQuery in a Markdown SQL code block (```sql ... ```).queryResult.columns and queryResult.rows into a clean Markdown table (or indicate 0 rows if empty).naturalLanguageAnswer.roles/alloydb.admin or roles/alloydb.databaseUser).