@pgplex/pgconsole 1.1.0 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -11
- package/dist/client/assets/index-B1uc7R-v.css +2 -0
- package/dist/client/assets/{index-C305YA-a.js → index-DLrdBtEm.js} +3 -3
- package/dist/client/assets/{sql-BNBEVQmM.js → sql-DVaK0rL7.js} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/server.mjs +23 -13
- package/dist/server.mjs.map +2 -2
- package/package.json +1 -1
- package/dist/client/assets/index-C8bwjbrl.css +0 -2
package/README.md
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
> [!NOTE]
|
|
2
|
+
> pgplex: Modern Developer Stack for Postgres - **pgconsole** · [pgtui](https://github.com/pgplex/pgtui) · [pgschema](https://github.com/pgplex/pgschema) · [pgparser](https://github.com/pgplex/pgparser)
|
|
3
|
+
|
|
1
4
|
<p align="center">
|
|
2
5
|
<a href="https://www.pgconsole.com">
|
|
3
6
|
<picture>
|
|
@@ -7,6 +10,12 @@
|
|
|
7
10
|
</a>
|
|
8
11
|
</p>
|
|
9
12
|
|
|
13
|
+
<table align="center"><tr><td>
|
|
14
|
+
<img src="https://raw.githubusercontent.com/pgplex/pgconsole/main/website/public/sql-editor-overview.webp" alt="pgconsole SQL editor" />
|
|
15
|
+
</td></tr></table>
|
|
16
|
+
|
|
17
|
+
**pgconsole** is a web-based PostgreSQL editor. Single binary, single config file, no database required. Connect your team to PostgreSQL with access control and audit logging built in.
|
|
18
|
+
|
|
10
19
|
<a href="https://www.star-history.com/#pgplex/pgconsole&Date">
|
|
11
20
|
<picture>
|
|
12
21
|
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=pgplex/pgconsole&type=Date&theme=dark" />
|
|
@@ -15,19 +24,10 @@
|
|
|
15
24
|
</picture>
|
|
16
25
|
</a>
|
|
17
26
|
|
|
18
|
-
`pgconsole` is web-based PostgreSQL editor. Single binary, single config file, no database required. Connect your team to PostgreSQL with access control and audit logging built in.
|
|
19
|
-
|
|
20
|
-
## Features
|
|
21
|
-
|
|
22
|
-
- Full PostgreSQL parser powers realtime autocomplete, syntax highlighting, and error detection
|
|
23
|
-
- Query, edit results, stage changes, and apply — all in one view
|
|
24
|
-
- AI assistant generates SQL, explains queries, fixes errors, and assesses change risk
|
|
25
|
-
- Fine-grained IAM controls who can read, write, or administer each connection
|
|
26
|
-
- Every query and login is recorded in the audit log
|
|
27
|
-
- Everything is in `pgconsole.toml` — connections, users, groups, access rules, AI providers
|
|
28
|
-
|
|
29
27
|
## Installation
|
|
30
28
|
|
|
29
|
+
Visit https://docs.pgconsole.com/getting-started/quickstart
|
|
30
|
+
|
|
31
31
|
### Prerequisites
|
|
32
32
|
|
|
33
33
|
- Node.js 20+
|
|
@@ -50,3 +50,143 @@ npx @pgplex/pgconsole --config pgconsole.toml
|
|
|
50
50
|
```bash
|
|
51
51
|
docker run -p 9876:9876 -v /path/to/pgconsole.toml:/etc/pgconsole.toml pgplex/pgconsole
|
|
52
52
|
```
|
|
53
|
+
|
|
54
|
+
Run without `--config` to start in demo mode with a bundled sample database.
|
|
55
|
+
|
|
56
|
+
## Features
|
|
57
|
+
|
|
58
|
+
### SQL Editor
|
|
59
|
+
|
|
60
|
+
A full-featured SQL workspace with real-time intelligence powered by a PostgreSQL parser — not regex.
|
|
61
|
+
|
|
62
|
+
- **Autocomplete** — context-aware suggestions for tables, columns, joins, and CTEs
|
|
63
|
+
- **Formatting** — pretty-print or collapse SQL to one line
|
|
64
|
+
- **Error detection** — red underlines with hover tooltips
|
|
65
|
+
- **Code folding** — collapse `SELECT`, `WITH`, and other blocks
|
|
66
|
+
- **Function signature help** — parameter hints as you type
|
|
67
|
+
|
|
68
|
+
<table><tr><td>
|
|
69
|
+
<img src="https://raw.githubusercontent.com/pgplex/pgconsole/main/docs/images/features/sql-editor/sql-editor-autocomplete.webp" alt="Autocomplete" />
|
|
70
|
+
</td></tr></table>
|
|
71
|
+
|
|
72
|
+
### Data Grid & Inline Editing
|
|
73
|
+
|
|
74
|
+
Query results appear in a virtual-scrolling grid. With `write` permission, you can edit data directly — all changes are staged locally and previewed before execution.
|
|
75
|
+
|
|
76
|
+
- Double-click a cell to edit, or use the row detail panel
|
|
77
|
+
- Add, delete, and duplicate rows
|
|
78
|
+
- Staged changes are color-coded: green (INSERT), amber (UPDATE), red (DELETE)
|
|
79
|
+
- Preview generated SQL and optionally run an AI risk assessment before executing
|
|
80
|
+
|
|
81
|
+
<table><tr><td>
|
|
82
|
+
<img src="https://raw.githubusercontent.com/pgplex/pgconsole/main/docs/images/features/sql-editor/sql-editor-staged-changes.webp" alt="Staged changes preview" />
|
|
83
|
+
</td></tr></table>
|
|
84
|
+
|
|
85
|
+
### Schema Browser
|
|
86
|
+
|
|
87
|
+
Browse and inspect database objects — tables, views, materialized views, functions, and procedures — with full metadata, indexes, constraints, triggers, and grants.
|
|
88
|
+
|
|
89
|
+
<table><tr><td>
|
|
90
|
+
<img src="https://raw.githubusercontent.com/pgplex/pgconsole/main/docs/images/features/sql-editor/sql-editor-schema-tab.webp" alt="Schema browser" />
|
|
91
|
+
</td></tr></table>
|
|
92
|
+
|
|
93
|
+
### AI Assistant
|
|
94
|
+
|
|
95
|
+
Generate, explain, fix, and rewrite SQL with an AI assistant that understands your schema context. Supports OpenAI, Anthropic, and Google providers.
|
|
96
|
+
|
|
97
|
+
- **Text-to-SQL** — describe a query in natural language, get SQL back
|
|
98
|
+
- **Explain SQL** — get plain-language explanations of any query
|
|
99
|
+
- **Fix SQL** — AI-powered error correction from inline linting
|
|
100
|
+
- **Rewrite SQL** — optimize queries for performance or readability
|
|
101
|
+
- **Risk assessment** — analyze staged changes for potential risks before execution
|
|
102
|
+
|
|
103
|
+
<table><tr><td>
|
|
104
|
+
<img src="https://raw.githubusercontent.com/pgplex/pgconsole/main/docs/images/features/ai-assistant/ai-text-to-sql.webp" alt="AI Text-to-SQL" />
|
|
105
|
+
</td></tr></table>
|
|
106
|
+
|
|
107
|
+
<table><tr><td>
|
|
108
|
+
<img src="https://raw.githubusercontent.com/pgplex/pgconsole/main/docs/images/features/ai-assistant/ai-risk-assessment.webp" alt="AI risk assessment" />
|
|
109
|
+
</td></tr></table>
|
|
110
|
+
|
|
111
|
+
### Database Access Control
|
|
112
|
+
|
|
113
|
+
Fine-grained IAM controls who can read, write, or administer each connection. Permissions are enforced at the application layer — no database roles needed.
|
|
114
|
+
|
|
115
|
+
- **Default deny** — users have no access unless a rule explicitly grants it
|
|
116
|
+
- **Connection-scoped** — permissions are granted per connection, not globally
|
|
117
|
+
- **Disjoint permissions** — `read`, `write`, `ddl`, `admin`, `explain`, `execute`, `export` are independent
|
|
118
|
+
|
|
119
|
+
<table><tr><td>
|
|
120
|
+
<img src="https://raw.githubusercontent.com/pgplex/pgconsole/main/docs/images/features/database-access-control/iam-permission-denied.webp" alt="Permission denied" />
|
|
121
|
+
</td></tr></table>
|
|
122
|
+
|
|
123
|
+
<table><tr><td>
|
|
124
|
+
<img src="https://raw.githubusercontent.com/pgplex/pgconsole/main/docs/images/features/database-access-control/iam-permission-badge.webp" alt="Permission badge" />
|
|
125
|
+
</td></tr></table>
|
|
126
|
+
|
|
127
|
+
### Audit Log
|
|
128
|
+
|
|
129
|
+
Every query and login is recorded as structured JSON to stdout. Filter and forward to your log infrastructure.
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"type": "audit",
|
|
134
|
+
"ts": "2024-01-15T10:32:15.456Z",
|
|
135
|
+
"action": "sql.execute",
|
|
136
|
+
"actor": "alice@example.com",
|
|
137
|
+
"connection": "prod-db",
|
|
138
|
+
"sql": "SELECT * FROM users WHERE active = true",
|
|
139
|
+
"duration_ms": 45,
|
|
140
|
+
"row_count": 150
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### Single-File Configuration
|
|
145
|
+
|
|
146
|
+
Everything lives in `pgconsole.toml` — connections, users, groups, access rules, AI providers. No database required.
|
|
147
|
+
|
|
148
|
+
```toml
|
|
149
|
+
[[connections]]
|
|
150
|
+
id = "production"
|
|
151
|
+
name = "Production"
|
|
152
|
+
host = "db.example.com"
|
|
153
|
+
port = 5432
|
|
154
|
+
database = "myapp"
|
|
155
|
+
username = "readonly"
|
|
156
|
+
password = "..."
|
|
157
|
+
|
|
158
|
+
[[iam]]
|
|
159
|
+
connection = "production"
|
|
160
|
+
permissions = ["read", "explain", "export"]
|
|
161
|
+
members = ["*"]
|
|
162
|
+
|
|
163
|
+
[[iam]]
|
|
164
|
+
connection = "production"
|
|
165
|
+
permissions = ["*"]
|
|
166
|
+
members = ["group:dba"]
|
|
167
|
+
|
|
168
|
+
[[ai.providers]]
|
|
169
|
+
id = "claude"
|
|
170
|
+
vendor = "anthropic"
|
|
171
|
+
model = "claude-sonnet-4-20250514"
|
|
172
|
+
api_key = "sk-ant-..."
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
## Getting Help
|
|
176
|
+
|
|
177
|
+
- [Docs](https://www.pgconsole.com)
|
|
178
|
+
- [GitHub Issues](https://github.com/pgplex/pgconsole/issues)
|
|
179
|
+
|
|
180
|
+
## Development
|
|
181
|
+
|
|
182
|
+
> [!NOTE]
|
|
183
|
+
> **For external contributors**: If you want to request a feature, please create a GitHub issue to discuss first instead of creating a PR directly.
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
git clone https://github.com/pgplex/pgconsole.git
|
|
187
|
+
cd pgconsole
|
|
188
|
+
pnpm install
|
|
189
|
+
pnpm dev # Start dev server (frontend + backend)
|
|
190
|
+
pnpm build # Production build
|
|
191
|
+
pnpm test # Run all tests
|
|
192
|
+
```
|