Skip to content

Commit 3f109bc

Browse files
authored
feat: update context file to recommend full table name (#27)
1 parent a336478 commit 3f109bc

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

POSTGRESQL.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,26 @@ This section covers connecting to a PostgreSQL database instance.
2828
likely that the user do not have the correct privileges on the PostgreSQL
2929
database. Database-level permissions (e.g., `SELECT`, `INSERT`) are required
3030
to execute queries.
31+
32+
---
33+
34+
# Usage Guidelines
35+
36+
## Reusing Project Values
37+
38+
Users may have set project environment variables:
39+
40+
* `POSTGRES_HOST`: The hostname or IP address of the PostgreSQL server.
41+
* `POSTGRES_PORT`: The port number of the PostgreSQL server.
42+
* `POSTGRES_DATABASE`: The name of the database to connect to.
43+
* `POSTGRES_USER`: The username for authentication.
44+
* `POSTGRES_PASSWORD`: The password for authentication.
45+
46+
Instead of prompting the user for these values for specific tool calls, prompt the user to verify reuse a specific value.
47+
Make sure to not use the environment variable name like `POSTGRES_HOST`, `${POSTGRES_HOST}`, or `$POSTGRES_HOST`. The value can be found by using command: `echo $POSTGRES_HOST`.
48+
49+
## Use Full Table Name Format "DATABASE_NAME.SCHEMA_NAME.TABLE_NAME"
50+
51+
**ALWAYS** use the full table name format, `DATABASE_NAME.SCHEMA_NAME.TABLE_NAME` in the generated SQL when using the `execute_sql` or `postgres__execute_sql` tool.
52+
* Default to using "public" for the schema name.
53+
* Use command `echo $POSTGRES_DATABASE` to get the current database value.

0 commit comments

Comments
 (0)