Postgres
Community
Tools to query and explore a postgres database
Author:Arcade
Version:
0.6.0Auth:No authentication required
4tools
4require secrets
Postgres provider enables read-only exploration and querying of a PostgreSQL database within the Arcade toolkit. It provides schema discovery, table inspection, and constrained SELECT execution to build reliable, safe queries.
Capabilities
- Discover database schemas and table structures to drive query composition rather than guessing table/column names.
- Execute read-only SELECT queries with enforced construction rules (explicit columns, ORDER BY, LIMIT/OFFSET, JOIN/HAVING/WHERE clauses).
- Require discovery of tables and schemas before executing queries to prevent errors and ensure correct joins.
- Enforce safe query conventions: no SELECT *, case-insensitive and trimmed string matching, prefer LIKE, join only on indexed or primary-key columns.
Secrets
- Secret type: password. Example secret: POSTGRES_DATABASE_CONNECTION_STRING (e.g. postgres://user:password@host:5432/dbname) used to authenticate and connect; store and handle securely.
Available tools(4)
4 of 4 tools
Operations
Behavior
| Tool name | Description | Secrets | |
|---|---|---|---|
Discover all the schemas in the postgres database. | 1 | ||
Discover all the tables in the postgres database when the list of tables is not known.
ALWAYS use this tool before any other tool that requires a table name. | 1 | ||
You have a connection to a postgres database.
Execute a SELECT query and return the results against the postgres database. No other queries (INSERT, UPDATE, DELETE, etc.) are allowed.
ONLY use this tool if you have already loaded the schema of the tables you need to query. Use the <GetTableSchema> tool to load the schema if not already known.
The final query will be constructed as follows:
SELECT {select_query_part} FROM {from_clause} JOIN {join_clause} WHERE {where_clause} HAVING {having_clause} ORDER BY {order_by_clause} LIMIT {limit} OFFSET {offset}
When running queries, follow these rules which will help avoid errors:
* Never "select *" from a table. Always select the columns you need.
* Always order your results by the most important columns first. If you aren't sure, order by the primary key.
* Always use case-insensitive queries to match strings in the query.
* Always trim strings in the query.
* Prefer LIKE queries over direct string matches or regex queries.
* Only join on columns that are indexed or the primary key. Do not join on arbitrary columns. | 1 | ||
Get the schema/structure of a postgres table in the postgres database when the schema is not known, and the name of the table is provided.
This tool should ALWAYS be used before executing any query. All tables in the query must be discovered first using the <DiscoverTables> tool. | 1 |
Last updated on