You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`postgres-database-overview` fetches the current state of the PostgreSQL server This tool does not take any input parameters.
20
+
21
+
## Example
22
+
23
+
```yaml
24
+
tools:
25
+
database_overview:
26
+
kind: postgres-database-overview
27
+
source: cloudsql-pg-source
28
+
description: |
29
+
fetches the current state of the PostgreSQL server. It returns the postgres version, whether it's a replica, uptime duration, maximum connection limit, number of current connections, number of active connections and the percentage of connections in use.
30
+
```
31
+
32
+
The response is a JSON object with the following elements:
33
+
```json
34
+
{
35
+
"pg_version": "PostgreSQL server version string",
36
+
"is_replica": "boolean indicating if the instance is in recovery mode",
37
+
"uptime": "interval string representing the total server uptime",
38
+
"max_connections": "integer maximum number of allowed connections",
39
+
"current_connections": "integer number of current connections",
40
+
"active_connections": "integer number of currently active connections",
41
+
"pct_connections_used": "float percentage of max_connections currently in use"
`postgres-list-triggers` lists detailed information as JSON for triggers. The tool takes the following input parameters:
20
+
21
+
-`trigger_name` (optional): A text to filter results by trigger name. The input is used within a LIKE clause. Default: `""`
22
+
-`schema_name` (optional): A text to filter results by schema name. The input is used within a LIKE clause. Default: `""`
23
+
-`table_name` (optional): A text to filter results by table name. The input is used within a LIKE clause. Default: `""`
24
+
-`limit` (optional): The maximum number of triggers to return. Default: `50`
25
+
26
+
27
+
## Example
28
+
29
+
```yaml
30
+
```yaml
31
+
tools:
32
+
list_triggers:
33
+
kind: postgres-list-triggers
34
+
source: postgres-source
35
+
description: |
36
+
Lists all non-internal triggers in a database. Returns trigger name, schema name, table name, wether 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.
37
+
```
38
+
39
+
The response is a json array with the following elements:
40
+
```json
41
+
{
42
+
"trigger_name": "trigger name",
43
+
"schema_name": "schema name",
44
+
"table_name": "table name",
45
+
"status": "Whether the trigger is currently active (ENABLED, DISABLED, REPLICA, ALWAYS).",
46
+
"timing": "When it runs relative to the event (BEFORE, AFTER, INSTEAD OF).",
47
+
"events": "The specific operations that fire it (INSERT, UPDATE, DELETE, TRUNCATE)",
48
+
"activation_level": "Granularity of execution (ROW vs STATEMENT).",
49
+
"function_name": "The function it executes",
50
+
"definition": "Full SQL definition of the trigger"
0 commit comments