alloydb-postgres-data
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseUsage
使用方法
All scripts can be executed using Node.js. Replace and with actual values.
<param_name><param_value>Bash:
node <skill_dir>/scripts/<script_name>.js '{"<param_name>": "<param_value>"}'PowerShell:
node <skill_dir>/scripts/<script_name>.js '{\"<param_name>\": \"<param_value>\"}'Note: The scripts automatically load the environment variables from various .env files. Do not ask the user to set vars unless skill executions fails due to env var absence.
所有脚本均可通过Node.js执行。将和替换为实际值。
<param_name><param_value>Bash:
node <skill_dir>/scripts/<script_name>.js '{"<param_name>": "<param_value>"}'PowerShell:
node <skill_dir>/scripts/<script_name>.js '{\"<param_name>\": \"<param_value>\"}'注意:脚本会自动从多个.env文件加载环境变量。除非因缺少环境变量导致技能执行失败,否则不要要求用户设置变量。
Scripts
脚本
execute_sql
execute_sql
Use this tool to execute a single SQL statement.
使用此工具执行单个SQL语句。
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| sql | string | The sql to execute. | Yes |
| 名称 | 类型 | 描述 | 是否必填 | 默认值 |
|---|---|---|---|---|
| sql | string | 要执行的SQL语句。 | 是 |
list_indexes
list_indexes
Lists available user indexes in the database, excluding system schemas (pg_catalog, information_schema). For each index, the following properties are returned: schema name, table name, index name, index type (access method), a boolean indicating if it's a unique index, a boolean indicating if it's for a primary key, the index definition, index size in bytes, the number of index scans, the number of index tuples read, the number of table tuples fetched via index scans, and a boolean indicating if the index has been used at least once.
列出数据库中可用的用户索引,排除系统模式(pg_catalog、information_schema)。对于每个索引,返回以下属性:模式名称、表名称、索引名称、索引类型(访问方法)、是否为唯一索引的布尔值、是否为主键索引的布尔值、索引定义、索引大小(字节)、索引扫描次数、读取的索引元组数量、通过索引扫描获取的表元组数量,以及索引是否至少被使用过一次的布尔值。
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| schema_name | string | Optional: a text to filter results by schema name. The input is used within a LIKE clause. | No | `` |
| table_name | string | Optional: a text to filter results by table name. The input is used within a LIKE clause. | No | `` |
| index_name | string | Optional: a text to filter results by index name. The input is used within a LIKE clause. | No | `` |
| only_unused | boolean | Optional: If true, only returns indexes that have never been used. | No | |
| limit | integer | Optional: The maximum number of rows to return. Default is 50 | No | |
| 名称 | 类型 | 描述 | 是否必填 | 默认值 |
|---|---|---|---|---|
| schema_name | string | 可选:用于按模式名称过滤结果的文本。输入将用于LIKE子句中。 | 否 | `` |
| table_name | string | 可选:用于按表名称过滤结果的文本。输入将用于LIKE子句中。 | 否 | `` |
| index_name | string | 可选:用于按索引名称过滤结果的文本。输入将用于LIKE子句中。 | 否 | `` |
| only_unused | boolean | 可选:如果为true,仅返回从未被使用过的索引。 | 否 | |
| limit | integer | 可选:返回的最大行数。默认值为50 | 否 | |
list_schemas
list_schemas
Lists all schemas in the database ordered by schema name and excluding system and temporary schemas. It returns the schema name, schema owner, grants, number of functions, number of tables and number of views within each schema.
列出数据库中所有按名称排序的模式,排除系统和临时模式。返回每个模式的名称、所有者、权限、函数数量、表数量和视图数量。
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| schema_name | string | Optional: A specific schema name pattern to search for. | No | `` |
| owner | string | Optional: A specific schema owner name pattern to search for. | No | `` |
| limit | integer | Optional: The maximum number of schemas to return. | No | |
| 名称 | 类型 | 描述 | 是否必填 | 默认值 |
|---|---|---|---|---|
| schema_name | string | 可选:要搜索的特定模式名称匹配模式。 | 否 | `` |
| owner | string | 可选:要搜索的特定模式所有者名称匹配模式。 | 否 | `` |
| limit | integer | 可选:返回的最大模式数量。 | 否 | |
list_sequences
list_sequences
Lists sequences in the database. Returns sequence name, schema name, sequence owner, data type of the sequence, starting value, minimum value, maximum value of the sequence, the value by which the sequence is incremented, and the last value generated by the sequence in the current session
列出数据库中的序列。返回序列名称、模式名称、序列所有者、序列的数据类型、起始值、最小值、最大值、序列的增量值,以及当前会话中序列生成的最后一个值。
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| schema_name | string | Optional: A specific schema name pattern to search for. | No | `` |
| sequence_name | string | Optional: A specific sequence name pattern to search for. | No | `` |
| limit | integer | Optional: The maximum number of rows to return. Default is 50 | No | |
| 名称 | 类型 | 描述 | 是否必填 | 默认值 |
|---|---|---|---|---|
| schema_name | string | 可选:要搜索的特定模式名称匹配模式。 | 否 | `` |
| sequence_name | string | 可选:要搜索的特定序列名称匹配模式。 | 否 | `` |
| limit | integer | 可选:返回的最大行数。默认值为50 | 否 | |
list_stored_procedure
list_stored_procedure
Retrieves stored procedure metadata returning schema name, procedure name, procedure owner, language, definition, and description, filtered by optional role name (procedure owner), schema name, and limit (default 20).
检索存储过程元数据,返回模式名称、过程名称、过程所有者、语言、定义和描述,可按可选的角色名称(过程所有者)、模式名称和限制数量(默认20)进行过滤。
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| role_name | string | Optional: The owner name to filter the stored procedures by. Defaults to NULL. | No | |
| schema_name | string | Optional: The schema name to filter the stored procedures by. Defaults to NULL. | No | |
| limit | integer | Optional: The maximum number of stored procedures to return. Defaults to 20. | No | |
| 名称 | 类型 | 描述 | 是否必填 | 默认值 |
|---|---|---|---|---|
| role_name | string | 可选:用于过滤存储过程的所有者名称。默认值为NULL。 | 否 | |
| schema_name | string | 可选:用于过滤存储过程的模式名称。默认值为NULL。 | 否 | |
| limit | integer | 可选:返回的最大存储过程数量。默认值为20。 | 否 | |
list_tables
list_tables
Lists detailed schema information (object type, columns, constraints, indexes, triggers, owner, comment) as JSON for user-created tables (ordinary or partitioned). Filters by a comma-separated list of names. If names are omitted, lists all tables in user schemas.
以JSON格式列出用户创建的表(普通表或分区表)的详细模式信息(对象类型、列、约束、索引、触发器、所有者、注释)。可按逗号分隔的名称列表进行过滤。如果未指定名称,则列出用户模式中的所有表。
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| table_names | string | Optional: A comma-separated list of table names. If empty, details for all tables will be listed. | No | `` |
| output_format | string | Optional: Use 'simple' for names only or 'detailed' for full info. | No | |
| 名称 | 类型 | 描述 | 是否必填 | 默认值 |
|---|---|---|---|---|
| table_names | string | 可选:逗号分隔的表名称列表。如果为空,将列出所有表的详细信息。 | 否 | `` |
| output_format | string | 可选:使用'simple'仅返回名称,使用'detailed'返回完整信息。 | 否 | |
list_triggers
list_triggers
Lists all non-internal triggers in a database. Returns trigger name, schema name, table name, whether its enabled or disabled, timing (e.g BEFORE/AFTER of the event), the events that cause the trigger to fire such as INSERT, UPDATE, or DELETE, whether the trigger activates per ROW or per STATEMENT, the handler function executed by the trigger and full definition.
列出数据库中所有非内部触发器。返回触发器名称、模式名称、表名称、触发器是否启用、触发时机(例如事件之前/之后)、触发触发器的事件(如INSERT、UPDATE或DELETE)、触发器是按行还是按语句激活、触发器执行的处理函数以及完整定义。
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| trigger_name | string | Optional: A specific trigger name pattern to search for. | No | `` |
| schema_name | string | Optional: A specific schema name pattern to search for. | No | `` |
| table_name | string | Optional: A specific table name pattern to search for. | No | `` |
| limit | integer | Optional: The maximum number of rows to return. | No | |
| 名称 | 类型 | 描述 | 是否必填 | 默认值 |
|---|---|---|---|---|
| trigger_name | string | 可选:要搜索的特定触发器名称匹配模式。 | 否 | `` |
| schema_name | string | 可选:要搜索的特定模式名称匹配模式。 | 否 | `` |
| table_name | string | 可选:要搜索的特定表名称匹配模式。 | 否 | `` |
| limit | integer | 可选:返回的最大行数。 | 否 | |
list_views
list_views
Lists views in the database from pg_views with a default limit of 50 rows. Returns schemaname, viewname, ownername and the definition.
从pg_views中列出数据库中的视图,默认限制返回50行。返回模式名称、视图名称、所有者名称和视图定义。
Parameters
参数
| Name | Type | Description | Required | Default |
|---|---|---|---|---|
| view_name | string | Optional: A specific view name to search for. | No | `` |
| schema_name | string | Optional: A specific schema name to search for. | No | `` |
| limit | integer | Optional: The maximum number of rows to return. | No | |
| 名称 | 类型 | 描述 | 是否必填 | 默认值 |
|---|---|---|---|---|
| view_name | string | 可选:要搜索的特定视图名称。 | 否 | `` |
| schema_name | string | 可选:要搜索的特定模式名称。 | 否 | `` |
| limit | integer | 可选:返回的最大行数。 | 否 | |