Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@ All notable changes to the PostgreSQL Explorer extension will be documented in t
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.2] - 2026-04-28

### Added
- **Sliding-window result streaming**: Optional PostgreSQL `SCROLL` cursor execution for eligible parameter-free `SELECT` queries (`postgresExplorer.performance.slidingWindowSelects`, default on). Keeps a bounded row buffer in the grid and extension host; scrolling fetches the next/previous window. Configurable cap via `postgresExplorer.performance.slidingWindowRowCap` (10–500 rows). Dismissible streaming hint banner with optional mute for the session/workspace.
- **`bytea` display modes**: Setting `postgresExplorer.query.byteaDisplayFormat` — `hex0x` (default), PostgreSQL `\x` hex text, or JSON-oriented debug shape — applied consistently in result grids and history.
- **SQL Assistant turn controls**: Regenerate the latest assistant reply without duplicating the user turn; resend / branch from a chosen user message (truncate history after that turn and rerun). Attach-to-assistant flows can prefill the composer when a message string is supplied (toast copy updated accordingly).
- **Result grid toolbar & editing workflow**: Result identity bar, consolidated toolbar/footer, view selector, inline banners, and a commit-confirmation step for pending cell edits. Source notebook cell index is surfaced for returning focus to the executing cell.

### Changed
- **Export vs Auto-LIMIT**: Query results carry `exportQuery` (original SQL before Auto-LIMIT) so full CSV/JSON/Excel exports can rerun the unrestricted statement when the grid was limited for display.
- **Renderer & executor integration**: Server-side cursor sessions coordinate with the webview for windowed fetches; grid-derived queries and edit-commit preferences are handled in the extension host so UI actions stay consistent with execution policy.

## [1.2.0] - 2026-04-19

### Added
Expand Down
7 changes: 5 additions & 2 deletions MARKETPLACE.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
| 🤖 **AI-Powered** | GitHub Copilot, GitHub Models, OpenAI, Anthropic, and Google Gemini integration |
| ⌨️ **Developer Tools** | IntelliSense, keyboard shortcuts, PSQL terminal access |
| 📤 **Export Data** | Export query results to CSV, JSON, or Excel formats |
| 📉 **Large result streaming** | Optional sliding-window cursor mode for big `SELECT`s — bounded memory, scroll to fetch |
| 🔢 **Binary columns** | Configurable `bytea` display (hex / PostgreSQL / JSON debug) |
| 🤖 **SQL Assistant** | Regenerate last reply or resend from an earlier user message; prefill when attaching context |

---

Expand Down Expand Up @@ -123,7 +126,7 @@

## 📋 Feature Matrix

| Area | PgStudio v1.0.0 | Notes |
| Area | PgStudio v1.2.1 | Notes |
|---|---|---|
| Core PostgreSQL object operations | ✅ | Tables, views, mat views, functions, roles, extensions, FDWs, and more |
| AI-assisted SQL workflows | ✅ | Generate, optimize, explain, analyze, and notebook handoff |
Expand All @@ -136,7 +139,7 @@

---

## ⚠️ Known Limitations (v1.0.0)
## ⚠️ Known Limitations (v1.2.1)

- In-grid editing is currently more limited than full desktop DB IDEs.
- ERD/schema visualization is available but not yet feature-complete.
Expand Down
27 changes: 6 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
[![Version](https://img.shields.io/visual-studio-marketplace/v/ric-v.postgres-explorer?style=for-the-badge&logo=visual-studio-code&logoColor=white&color=0066CC)](https://marketplace.visualstudio.com/items?itemName=ric-v.postgres-explorer)
[![Downloads](https://img.shields.io/visual-studio-marketplace/d/ric-v.postgres-explorer?style=for-the-badge&logo=visual-studio-code&logoColor=white&color=2ECC71)](https://marketplace.visualstudio.com/items?itemName=ric-v.postgres-explorer)
[![Rating](https://img.shields.io/visual-studio-marketplace/r/ric-v.postgres-explorer?style=for-the-badge&logo=visual-studio-code&logoColor=white&color=F39C12)](https://marketplace.visualstudio.com/items?itemName=ric-v.postgres-explorer)
[![Status](https://img.shields.io/badge/status-stable%20v1.0.0%20%2B%20nightly-blue?style=for-the-badge&logo=git&logoColor=white)](https://github.com/dev-asterix/PgStudio/releases)
[![Status](https://img.shields.io/badge/status-stable%20v1.2.1%20%2B%20nightly-blue?style=for-the-badge&logo=git&logoColor=white)](https://github.com/dev-asterix/PgStudio/releases)

**PgStudio** (formerly YAPE) is a comprehensive PostgreSQL database management extension featuring interactive SQL notebooks, real-time monitoring dashboard, AI-powered assistance, and advanced database operations—all within VS Code.

Expand All @@ -17,13 +17,6 @@

---

## 🆕 Since v1.0.0

- 🧩 **SQL Assistant in Editor Tabs** — Open SQL Assistant directly in the main editor area using `SQL Assistant: Open in Editor Tab`.
- 🗂️ **Multiple SQL Assistant Tabs** — Run parallel assistant conversations in separate tabs and switch context faster.

---

## 📺 Video Guides

### 1. Setup
Expand Down Expand Up @@ -71,10 +64,10 @@
- 📋 **Smart Paste** — Context-aware clipboard actions (SQL/CSV/JSON)
- 📊 **Table Intelligence** — Profile, activity monitor, index usage, definition viewer
- 🔍 **EXPLAIN CodeLens** — One-click query analysis directly in notebooks
- 🎛️ **Advanced Result UX** — Column stats, transpose view, enhanced filtering, and improved in-grid editing controls
- 🎛️ **Advanced Result UX** — Column stats, transpose view, enhanced filtering, sliding-window streaming for large `SELECT`s, configurable `bytea` display, and structured in-grid editing with explicit commit confirmation
- 🛡️ **Auto-LIMIT** — Intelligent query protection (configurable, default 1000 rows)
- 🌍 **Foreign Data Wrappers** — Manage foreign servers, user mappings & tables
- 🤖 **AI-Powered** — Generate, Optimize, Explain & Analyze with guided follow-ups and next-step suggestions (GitHub Models, OpenAI, Anthropic, Gemini, VS Code LM)
- 🤖 **AI-Powered** — Generate, Optimize, Explain & Analyze with guided follow-ups; regenerate or branch the conversation from a prior user message (GitHub Models, OpenAI, Anthropic, Gemini, VS Code LM)
- 🧩 **Flexible SQL Assistant Layout** — Open SQL Assistant in editor tabs and keep multiple assistant tabs open simultaneously
- 🖼️ **Vision AI** — Paste or upload images directly in the SQL Assistant; sent to vision-capable AI providers
- 📎 **File Preview** — Click attached file chips to open them as preview tabs in the editor
Expand Down Expand Up @@ -135,27 +128,19 @@

## 📋 Feature Matrix

| Area | PgStudio v1.0.0 | Notes |
| Area | PgStudio v1.2.1 | Notes |
|---|---|---|
| Core PostgreSQL object operations | ✅ | Tables, views, mat views, functions, roles, extensions, FDWs, and more |
| AI-assisted SQL workflows | ✅ | Generate, optimize, explain, and analyze with notebook-first execution |
| Production safety controls | ✅ | Read-only mode, risk scoring, confirmation prompts, Auto-LIMIT |
| Real-time monitoring dashboard | ✅ | Activity and health views in VS Code |
| Interactive SQL notebooks | ✅ | Native `.pgsql` notebook execution with completions |
| In-grid result editing parity with desktop IDEs | ⚠️ Partial | Planned improvements post-v1.0.0 |
| In-grid result editing parity with desktop IDEs | ⚠️ Partial | Stronger commit flow and tooling in v1.2.x; full parity still evolving |
| ERD/schema visualization parity | ⚠️ Partial | Schema designer exists; ERD depth still evolving |
| Advanced replication administration | ⚠️ Partial | Additional publication/subscription depth planned |

---

## ⚠️ Known Limitations (v1.0.0)

- In-grid editing is limited compared to full desktop DB IDEs.
- ERD/schema visualization is still maturing.
- Some advanced PostgreSQL administration areas are partial and will be expanded in v1.x.

---

## 🚀 Quick Start

```bash
Expand Down Expand Up @@ -184,7 +169,7 @@ Then: **PostgreSQL icon** → **Add Connection** → Enter details → **Connect
- `SECURITY.md` - Security policy and vulnerability reporting guidance
- `CHANGELOG.md` - Release notes and what changed across versions

**Stable: v1.0.0 | Nightly: v1.0.0-nightly+ —** Production-ready stable release plus active nightly improvements (dashboard telemetry UX and SQL Preview toggle workflows). See [Release Notes](docs/RELEASE_NOTES_v1.0.0.md), [Migration Guide](docs/MIGRATION_GUIDE_0.x_to_1.0.0.md), and [CHANGELOG.md](CHANGELOG.md) for details.
**Stable: v1.2.1 | Nightly: v1.0.0-nightly+ —** Latest stable adds cursor-based result streaming, `bytea` formatting controls, richer result-grid tooling, export correctness with Auto-LIMIT, and SQL Assistant regenerate/resend. See [CHANGELOG.md](CHANGELOG.md); v1.0 launch materials remain in [Release Notes](docs/RELEASE_NOTES_v1.0.0.md) and [Migration Guide](docs/MIGRATION_GUIDE_0.x_to_1.0.0.md).

---

Expand Down
Binary file modified docs/assets/01-setup.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/02-more-settings.gif
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/03-ai-assist.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/04-ai-copilot.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/05-dashboard.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/07-power-editor.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/assets/08-more-features.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 23 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "postgres-explorer",
"displayName": "PgStudio (PostgreSQL Explorer)",
"version": "1.2.1",
"version": "1.2.2",
"description": "PostgreSQL database explorer for VS Code with notebook support [Nightly]",
"publisher": "ric-v",
"private": false,
Expand Down Expand Up @@ -1751,11 +1751,33 @@
"default": 1000,
"description": "Default row limit for SELECT queries when auto-LIMIT is enabled."
},
"postgresExplorer.performance.slidingWindowSelects": {
"type": "boolean",
"default": true,
"description": "Use a PostgreSQL SCROLL cursor for eligible SELECT queries (no SQL parameters): stream one window of rows into the cell and fetch more on scroll—bounded RAM on host and webview."
},
"postgresExplorer.performance.slidingWindowRowCap": {
"type": "number",
"default": 100,
"minimum": 10,
"maximum": 500,
"description": "Maximum rows kept in the result grid at once when sliding-window streaming is active."
},
"postgresExplorer.query.autoLimitEnabled": {
"type": "boolean",
"default": true,
"description": "Automatically append LIMIT clause to SELECT queries that don't have one. Always enabled in read-only mode."
},
"postgresExplorer.query.byteaDisplayFormat": {
"type": "string",
"enum": [
"hex0x",
"postgresql",
"json"
],
"default": "hex0x",
"description": "Display format for binary (bytea) columns in query results: 0x-prefixed hex, PostgreSQL \\x hex, or JSON Buffer shape (debug)."
},
"postgresExplorer.parameters.cacheLastValues": {
"type": "boolean",
"default": true,
Expand Down
25 changes: 25 additions & 0 deletions src/common/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ export interface BreadcrumbContext {
};
}

/** How decoded `bytea` / binary values are shown in query result grids */
export type ByteaDisplayFormat = 'hex0x' | 'postgresql' | 'json';

export const BYTEA_DISPLAY_DEFAULT: ByteaDisplayFormat = 'hex0x';

/** PostgreSQL notice with client receive time (log-style UI) */
export interface NoticeLogEntry {
message: string;
Expand All @@ -103,6 +108,8 @@ export interface QueryResults {
rowCount?: number | null;
command?: string;
query?: string;
/** Raw query before auto-LIMIT; used by full export reruns. */
exportQuery?: string;
notices?: NoticeLogEntry[];
executionTime?: number;
tableInfo?: TableInfo;
Expand All @@ -124,6 +131,20 @@ export interface QueryResults {
autoLimitApplied?: boolean;
/** Effective LIMIT value when autoLimitApplied is true. */
autoLimitValue?: number;
/** Notebook setting: binary column display mode (embedded for renderer). */
byteaDisplayFormat?: ByteaDisplayFormat;
/** Server-side cursor session: UI loads pages on scroll; keeps small row buffer client-side. */
slidingWindow?: {
sessionId: string;
windowStartRow: number;
windowSize: number;
hasMoreBefore: boolean;
hasMoreAfter: boolean;
};
/** When true with slidingWindow, show the streaming hint banner (policy-gated). */
showSlidingCursorBanner?: boolean;
/** Notebook cell index that produced this output (hover toolbar / focus source cell). */
sourceCellIndex?: number;
}

export interface TableRenderOptions {
Expand All @@ -144,6 +165,9 @@ export interface TableRenderOptions {
onFkLookup?: (req: FkLookupRequest) => void;
onFilterChange?: (filterState: FilterState) => void;
onSortChange?: (sortState: SortState) => void;
byteaDisplayFormat?: ByteaDisplayFormat;
/** 1-based absolute row label for first visible row (sliding-window results). Defaults to 1. */
rowNumberBaseline?: number;
}

export interface ChartRenderOptions {
Expand Down Expand Up @@ -296,4 +320,5 @@ export interface ResultHistoryEntry {
/** PostgreSQL notices (RAISE NOTICE, etc.) for this result */
notices?: NoticeLogEntry[];
timestamp: number;
byteaDisplayFormat?: ByteaDisplayFormat;
}
6 changes: 6 additions & 0 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,12 @@ async function ensureRendererMessageHandlers(
explainHandlersModule,
coreHandlersModule,
queryHandlersModule,
cursorBannerModule,
] = await Promise.all([
import('./services/handlers/ExplainHandlers'),
import('./services/handlers/CoreHandlers'),
import('./services/handlers/QueryHandlers'),
import('./services/handlers/CursorStreamBannerHandler'),
]);

// Explain & Chat Handlers
Expand All @@ -89,8 +91,12 @@ async function ensureRendererMessageHandlers(
registry.register('showDatabaseSwitcher', new coreHandlersModule.ShowDatabaseSwitcherHandler(statusBarInstance));
registry.register('showErrorMessage', new coreHandlersModule.ShowErrorMessageHandler());
registry.register('export_request', new coreHandlersModule.ExportRequestHandler());
registry.register('runDerivedQuery', new coreHandlersModule.RunDerivedQueryHandler());
registry.register('retryCell', new coreHandlersModule.RetryCellHandler());
registry.register('showConnectionInfo', new coreHandlersModule.ShowConnectionInfoHandler());
registry.register('gridCommitPreference', new coreHandlersModule.GridCommitPreferenceHandler(context));
registry.register('cursorStreamBannerDismiss', new cursorBannerModule.CursorStreamBannerDismissHandler(context));
registry.register('cursorStreamBannerMute', new cursorBannerModule.CursorStreamBannerMuteHandler(context));

// Query Execution Handlers
registry.register('execute_update_background', new queryHandlersModule.ExecuteUpdateBackgroundHandler());
Expand Down
Loading