Skip to content

Commit bbbf527

Browse files
committed
chore: add initial docs
0 parents  commit bbbf527

File tree

3 files changed

+95
-0
lines changed

3 files changed

+95
-0
lines changed

POSTGRESQL.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# PostgreSQL Extension
2+
3+
This document provides instructions for the Gemini agent to assist users with the PostgreSQL extension.
4+
5+
## PostgreSQL MCP Server (Data Plane: Connecting and Querying)
6+
7+
This section covers connecting to a PostgreSQL database instance.
8+
9+
1. **Verify Environment Variables**: Before attempting to connect, confirm with the user that the following environment variables are set in the extension configuration or their shell environment.
10+
11+
* `POSTGRES_HOST`: The hostname or IP address of the PostgreSQL server.
12+
* `POSTGRES_PORT`: The port number of the PostgreSQL server.
13+
* `POSTGRES_DATABASE`: The name of the database to connect to.
14+
* `POSTGRES_USER`: The username for authentication.
15+
* `POSTGRES_PASSWORD`: The password for authentication.
16+
17+
2. **Handle Missing Variables**: If a command fails with an error message containing a placeholder like `${POSTGRES_HOST}`, it signifies a missing environment variable. Inform the user which variable is missing and instruct them to set it.
18+
19+
3. **Handle Permission Errors**: If you encounter permission errors, ensure the user has the correct privileges on the PostgreSQL database.

README.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Gemini CLI Extension - PostgreSQL
2+
3+
This Gemini CLI extension provides a set of tools to interact with [PostgreSQL](https://www.postgresql.org/docs/) instances. It allows you to manage your databases, execute queries, and explore schemas directly from the [Gemini CLI](https://google-gemini.github.io/gemini-cli/), using natural language prompts.
4+
5+
## Features
6+
7+
* **Integrated with Gemini CLI:** As a Google-developed extension, it integrates seamlessly into the Gemini CLI environment, making security an accessible part of your workflow.
8+
* **Connect to PostgreSQL:** Securely connect to your PostgreSQL instances.
9+
* **Explore Database Schema:** List databases, tables, views, and schemas.
10+
* **Query your Database:** Execute SQL queries against your database.
11+
12+
## Supported Tools
13+
14+
* list-tables: Use this tool to list tables and descriptions.
15+
* execute-sql: Use this tool to execute any SQL statement.
16+
17+
## Prerequisites
18+
19+
Before you begin, ensure you have the following:
20+
21+
* [Gemini CLI](https://github.com/google-gemini/gemini-cli) installed.
22+
* A running PostgreSQL instance.
23+
24+
## Installation
25+
26+
To install the extension, use the `gemini extensions install` command:
27+
28+
```bash
29+
gemini extensions install github.com/gemini-cli-extensions/postgresql.git
30+
```
31+
32+
## Configuration
33+
34+
* `POSTGRES_HOST`: The hostname or IP address of the PostgreSQL server.
35+
* `POSTGRES_PORT`: The port number of the PostgreSQL server.
36+
* `POSTGRES_DATABASE`: The name of the database to connect to.
37+
* `POSTGRES_USER`: The username for authentication.
38+
* `POSTGRES_PASSWORD`: The password for authentication.
39+
40+
41+
## Usage
42+
43+
* Explore Schemas and Data
44+
* Generate code
45+
46+
47+
## Security
48+
49+
This extension executes commands against your PostgreSQL database. Always review the generated SQL queries before execution, especially for write operations.
50+
51+
## Disclaimer
52+
53+
This is not an officially supported Google product. This extension is under active development, and breaking changes may be introduced.

gemini-extension.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "PostgreSQL",
3+
"version": "0.1.0",
4+
"description": "Connect to PostgreSQL",
5+
"mcpServers": {
6+
"PostgreSQL": {
7+
"command": "${extensionPath}${/}toolbox",
8+
"args": [
9+
"--prebuilt",
10+
"postgres",
11+
"--stdio"
12+
],
13+
"env": {
14+
"POSTGRES_HOST": "${POSTGRES_HOST}",
15+
"POSTGRES_PORT": "${POSTGRES_PORT}",
16+
"POSTGRES_DATABASE": "${POSTGRES_DATABASE}",
17+
"POSTGRES_USER": "${POSTGRES_USER}",
18+
"POSTGRES_PASSWORD": "${POSTGRES_PASSWORD}"
19+
}
20+
}
21+
},
22+
"contextFileName": "POSTGRESQL.md"
23+
}

0 commit comments

Comments
 (0)