Skip to content

Enhance Postgres Notebook functionality#27

Merged
ric-v merged 1 commit into
mainfrom
fs-refactor-optimize
Apr 28, 2025
Merged

Enhance Postgres Notebook functionality#27
ric-v merged 1 commit into
mainfrom
fs-refactor-optimize

Conversation

@ric-v
Copy link
Copy Markdown
Member

@ric-v ric-v commented Apr 28, 2025

This pull request introduces several updates to the PostgreSQL Explorer extension, including improvements to database connection handling, new database management commands, and enhancements to the user interface. The changes focus on improving functionality, user experience, and error handling.

Enhancements to Database Connection Handling:

  • Updated connection logic to fallback to the postgres database if the specified database does not exist, both during connection testing (src/connectionForm.ts) and tree data loading (src/databaseTreeProvider.ts). [1] [2] [3]
  • Improved error handling for connection failures, providing more detailed and user-friendly error messages.

New Database Management Commands:

  • Added new commands to manage databases: Rename, Change Owner, Change Tablespace, Modify Settings, Create, and Drop. These commands are now integrated into the package.json configuration and available in the UI. [1] [2] [3] [4]

UI and Configuration Updates:

  • Updated package.json to include icons for existing and new commands, enhancing the visual clarity of the command palette. [1] [2]
  • Displayed configured database names in the connection tree view for better context.

Miscellaneous:

  • Updated the version in package.json from 0.1.3 to 0.1.10.
  • Refactored the Makefile to ensure consistent tagging and version updates by normalizing version inputs and handling edge cases.- Implemented serialization and deserialization of notebook metadata, including custom cell metadata.
  • Added executeCell method to handle SQL execution within notebooks, returning results or errors.
  • Improved connection handling in createPgClient to fallback to 'postgres' if the specified database does not exist.
  • Updated createAndShowNotebook to set metadata for each cell, including connection details.
  • Expanded database operations notebook to include additional management commands (e.g., rename, change owner, change tablespace, modify settings, create, and drop databases).
  • Enhanced cmdNewNotebook to initialize notebooks with connection and database metadata.

- Implemented serialization and deserialization of notebook metadata, including custom cell metadata.
- Added executeCell method to handle SQL execution within notebooks, returning results or errors.
- Improved connection handling in createPgClient to fallback to 'postgres' if the specified database does not exist.
- Updated createAndShowNotebook to set metadata for each cell, including connection details.
- Expanded database operations notebook to include additional management commands (e.g., rename, change owner, change tablespace, modify settings, create, and drop databases).
- Enhanced cmdNewNotebook to initialize notebooks with connection and database metadata.
@ric-v ric-v requested a review from Copilot April 28, 2025 12:55
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request enhances PostgreSQL Explorer by improving connection handling (with graceful fallback to the postgres database), adding new database management commands, and updating the user interface for better clarity and usability.

  • Improved connection logic with fallback to 'postgres' if the specified database is not available.
  • Introduced new commands for database management (rename, change owner, drop, etc.) integrated through package.json.
  • Updated UI elements and configuration to display clearer database connection and command information.

Reviewed Changes

Copilot reviewed 8 out of 10 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/subscriptions/notebook.ts Updated notebook creation to include enriched metadata for cells.
src/subscriptions/connection.ts Enhanced client creation with fallback to 'postgres' and improved error handling.
src/postgresNotebook.ts Added context initialization and updated serialization/deserialization logic.
src/extension.ts Integrated additional database management commands into the extension.
src/databaseTreeProvider.ts Modified tree view to display database names and refined connection logic including role management.
src/connectionForm.ts Updated test connection routine to try a fallback connection if needed.
Files not reviewed (2)
  • Makefile: Language not supported
  • package.json: Language not supported

Comment thread src/databaseTreeProvider.ts
@ric-v ric-v merged commit 6db5b82 into main Apr 28, 2025
@ric-v ric-v deleted the fs-refactor-optimize branch December 7, 2025 05:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants