Skip to content

Add db-schema-explorer extension - #25197

Merged
raycastbot merged 11 commits into
raycast:mainfrom
SciSaif:ext/db-schema-explorer
Feb 17, 2026
Merged

raycastbot merged 11 commits into
raycast:mainfrom
SciSaif:ext/db-schema-explorer

Conversation

@SciSaif

@SciSaif SciSaif commented Feb 6, 2026 •

Copy link
Copy Markdown
Contributor

Description

DB Schema Explorer is a Raycast extension that turns your database into a fast, local, searchable schema dictionary, optimized for AI prompts.
Multiple databases (Postgres, MongoDB): each with its own credentials, local JSON cache, default flag, and exclusion rules.
Instant search over cached schema instead of live DB queries, so browsing tables feels zero-latency.
Sync Schema command to fetch tables/views, columns, relations, enums, and indices and refresh the cache per database.
Explore Tables command with a dual-pane view: searchable table list on the left, clean CREATE TABLE DDL preview on the right; Enter copies DDL to clipboard.
Per-database exclusion rules (regex / contains / does not contain) to hide noisy or internal tables from Explore Tables.
Focused on speed, AI-friendly output, and local privacy—no schema leaves your machine unless you paste it elsewhere.

Screencast

db-schema-explorer-1 db-schema-explorer-2 db-schema-explorer-4 db-schema-explorer-3

Checklist

- Fix ESLint and Prettier for publish
- Refactor schema selection actions in explore-tables component
- Add keyboard shortcuts for copy actions in explore-tables component
- Add table selection functionality in explore-tables component
- Update package.json to enhance the description for clarity and change the icon filename. Remove the old extension icon file to streamline assets.
- Enhance database management to support MongoDB integration. Update package dependencies to include MongoDB, modify UI components to accommodate MongoDB connection options, and adjust schema synchronization logic for MongoDB collections. This improves the extension\'s functionality by allowing users to manage both PostgreSQL and MongoDB databases seamlessly.
- Update subtitle formatting in manage-databases component to remove the "Default" label from the subtitle. This change simplifies the display of database entries, enhancing UI clarity while maintaining essential information.
- Add showTableNamesOnly feature to database management and explore tables
- Remove subtitle from List.Item in explore-tables component to simplify the display of database entries. This change enhances the clarity of the UI by focusing on the title and detail without additional context.
- Refactor database management in Raycast extension by consolidating credential handling and exclusion rules into a per-database model. Remove legacy credential and exclusion rule files, and update commands for managing databases. Enhance the explore tables functionality to support the new structure, ensuring a smoother user experience.
- Enhance Raycast extension to support multiple databases, allowing users to manage connections, local caches, and exclusion rules per database. Update key features and commands for improved usability, including a dual-pane interface for exploring tables and a streamlined schema sync process. Expand storage format to accommodate multiple databases and prepare for future database types.
- Update README.md to clarify the purpose of the schema retrieval feature, specifying it is for reference or context for AI.
- Rename project from "Sql Schema Explorer" to "DB Schema Explorer" across all relevant files, including changelog, package.json, package-lock.json, and README.md. Update descriptions to reflect the new name and enhance clarity.
- Initial commit of the Sql Schema Explorer extension for Raycast. This includes the core functionality to sync and explore PostgreSQL database schemas, manage exclusion rules, and set connection credentials. Added configuration files, TypeScript support, and essential UI components for user interaction.
@raycastbot

Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

Once the PR is approved and merged, the extension will be available on our Store.

- Fix Prettier formatting in explore-tables.tsx
- Update keyboard shortcut for \'Copy DDL\' action in explore-tables component to use standard copy shortcut. This change enhances consistency in user interactions with copy actions.
@SciSaif
SciSaif marked this pull request as ready for review February 9, 2026 05:58
@greptile-apps

greptile-apps Bot commented Feb 9, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Overview

Greptile Summary

This PR adds a new DB Schema Explorer extension that enables users to browse and export database schemas from PostgreSQL and MongoDB. The extension caches schemas locally for fast access and provides powerful filtering with exclusion rules.

Key Features:

  • Multi-database support with per-database credential management
  • Local schema caching for instant table browsing
  • DDL generation and copying for tables
  • Exclusion rules (regex, contains, not-contains) to filter unwanted tables
  • Three commands: Manage Databases, Sync Schema, and Explore Tables

Code Quality:

  • Previous review feedback has been properly addressed (SSL config, preference types, EmptyView icons, exclusion rule fallback)
  • Follows Raycast conventions (Prettier config, ESLint setup, auto-generated preference types)
  • Proper error handling and connection cleanup
  • Well-documented with comprehensive README

Minor Issue:

  • idea.txt file is tracked in git despite being in .gitignore - should be removed from the repository

Confidence Score: 5/5

  • Safe to merge - all previous issues resolved, follows Raycast standards, with only a minor cleanup needed
  • The extension is well-implemented with proper error handling, security practices (SSL config defaults to no SSL for compatibility), and follows all Raycast conventions. Previous review issues have been addressed (EmptyView icons, preference types, SSL security, exclusion fallbacks). The only remaining issue is a tracked file that should be gitignored, which doesn't affect functionality.
  • extensions/db-schema-explorer/idea.txt should be removed from repository tracking

Important Files Changed

Filename Overview
extensions/db-schema-explorer/package.json Extension manifest properly configured with commands, dependencies, and metadata
extensions/db-schema-explorer/src/lib/databases.ts Database registry management with proper migration logic and auto-generated Preferences type usage
extensions/db-schema-explorer/src/lib/pg-config.ts PostgreSQL connection config parser with proper SSL mode handling (defaults to no SSL)
extensions/db-schema-explorer/src/explore-tables.tsx Main table explorer UI with search, filtering, multi-selection, and DDL copying using proper Icon.* constants
extensions/db-schema-explorer/idea.txt Personal notes file tracked in git despite being gitignored

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

26 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +11 to +19
return {
host: url.hostname,
port: Number.isFinite(port) ? port : 5432,
user: url.username ? decodeURIComponent(url.username) : undefined,
password: url.password ? decodeURIComponent(url.password) : undefined,
database: database || undefined,
connectionTimeoutMillis: 10000,
ssl: { rejectUnauthorized: false },
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Insecure forced TLS setting

parseConnectionConfig forces ssl: { rejectUnauthorized: false } for all Postgres connections (pg-config.ts:11-19). This both weakens TLS (accepts MITM certificates) and can break connections to servers that don’t support SSL. This should be opt-in (e.g., only when sslmode=require / user preference) and should not disable cert verification by default.

Comment on lines +73 to +80
let connectionString = "";
const fromStorage = await LocalStorage.getItem<string>(LEGACY_STORAGE_KEY_CONNECTION);
if (fromStorage && String(fromStorage).trim()) connectionString = String(fromStorage).trim();
if (!connectionString) {
const prefs = getPreferenceValues<{ connectionString?: string }>();
const fromPrefs = prefs.connectionString?.trim();
if (fromPrefs) connectionString = fromPrefs;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Disallowed preference typing

getPreferenceValues<{ connectionString?: string }>() in ensureMigratedAsync (databases.ts:73-80) manually types preferences. In this repo the preference types are auto-generated in raycast-env.d.ts and the manual generic is explicitly disallowed, because it can drift from the actual schema. Use the generated Preferences type instead (or avoid typing here entirely if it’s only for legacy migration).

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +33 to +41
"preferences": [
{
"name": "connectionString",
"type": "password",
"required": false,
"title": "Connection String",
"description": "PostgreSQL connection string (e.g. postgresql://user:password@host:5432/database)"
}
],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Unused legacy preference

package.json still declares a connectionString preference (package.json:33-41), but the extension UI uses the per-database registry (Manage Databases) for credentials and doesn’t read this preference anywhere except a one-time migration path. Leaving this preference exposed in the Store UI is confusing and implies a single-DB setup that won’t be used. Either remove the preference or clearly scope it as “Legacy migration only” and stop showing it to users.

- added idea to gitignore
- Remove idea.txt file and update package.json to eliminate deprecated connection string preference. Enhance database management by adding delete functionality for databases in manage-databases component, improving user experience and database management capabilities.
- Enhance explore-tables component by adding a feature to toggle visibility of table names. Users can now choose to display either full table names (schema.table) or just the table names, improving clarity and customization in table management.
… interface. Update fetchMysqlSchemaData function to use this interface, clarifying that MySQL support is not currently integrated into the extension.
@SciSaif

SciSaif commented Feb 9, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai, could you please do a fresh review of this PR?

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

3 files reviewed, 3 comments

Edit Code Review Agent Settings | Greptile

if (fromStorage && String(fromStorage).trim()) connectionString = String(fromStorage).trim();
if (!connectionString) {
// Legacy migration: check for connectionString preference that may no longer exist in Preferences type
const prefs = getPreferenceValues<Preferences>() as Preferences & { connectionString?: string };

ghost Feb 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use auto-generated Preferences type instead of manual typing - don't manually extend with connectionString. This violates the repository's rule that preference types should match raycast-env.d.ts

Suggested change
const prefs = getPreferenceValues<Preferences>() as Preferences & { connectionString?: string };
const prefs = getPreferenceValues<Preferences>();

Context Used: Rule from dashboard - What: Don't manually define Preferences for getPreferenceValues() or commends Argument interfa... (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@greptile-apps

ghost commented Feb 9, 2026

Copy link
Copy Markdown
Contributor
Additional Comments (2)

extensions/db-schema-explorer/idea.txt
Remove idea.txt - development/planning files shouldn't be included in the extension

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!


extensions/db-schema-explorer/README.md
README needs more content - add installation instructions, feature descriptions, usage examples, and screenshots as shown in the PR description

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

scisaif added 3 commits February 9, 2026 14:12
- Refactor connection string retrieval in ensureMigratedAsync function
- Add \'Copy Full Schema\' action in explore-tables component
- Refactor \'Copy DDL\' action in explore-tables component
- Refactor \'Copy Full Schema\' action in explore-tables component
@SciSaif

ghost commented Feb 9, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai, could you please do a fresh review of this PR?

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

29 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Comment on lines +91 to +100
export function ruleDescription(rule: ExclusionRule): string {
switch (rule.type) {
case "regex":
return `Regex: ${rule.pattern}`;
case "contains":
return `Contains: ${rule.pattern}`;
case "not_contains":
return `Does not contain: ${rule.pattern}`;
}
}

ghost Feb 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missing default return

ruleDescription is declared to return string, but it has no default return path. If an invalid rule type ever makes it into storage (e.g., from legacy data or a manual edit), this will return undefined at runtime and can crash when used in string interpolation (e.g., the “Remove Rule” action title). Consider adding a fallback return (or throwing) for unknown rule.type values.

Comment on lines +88 to +94
<List>
<List.EmptyView
title="No databases"
description="Add a database in Manage Databases first."
icon="🔌"
actions={
<ActionPanel>

ghost Feb 9, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Invalid List.EmptyView icon

List.EmptyView’s icon prop expects an ImageLike (asset path, Icon, URL, etc.). Passing a raw emoji string like "🔌" is not a valid icon value and can fail at runtime. This pattern appears multiple times in this PR (see also explore-tables.tsx and manage-databases.tsx). Use an Icon.* or an image asset instead.

Also appears in:

  • extensions/db-schema-explorer/src/sync-schema.tsx:112-134
  • extensions/db-schema-explorer/src/explore-tables.tsx:176-238
  • extensions/db-schema-explorer/src/manage-databases.tsx:319-323

@SciSaif

ghost commented Feb 9, 2026

Copy link
Copy Markdown
Contributor Author

@greptileai, could you please do a fresh review of this PR?

ghost left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

5 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps

ghost commented Feb 9, 2026

Copy link
Copy Markdown
Contributor
Additional Comments (1)

extensions/db-schema-explorer/idea.txt
idea.txt is tracked in git but listed in .gitignore. Remove this file from the repository with git rm --cached extensions/db-schema-explorer/idea.txt

@0xdhrv 0xdhrv self-assigned this Feb 17, 2026
Dhruv Suthar added 2 commits February 17, 2026 17:51

ghost left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me, approved 🔥

@raycastbot
raycastbot merged commit 19b73e3 into raycast:main Feb 17, 2026
@github-actions

ghost commented Feb 17, 2026

Copy link
Copy Markdown
Contributor

@raycastbot

ghost commented Feb 17, 2026

Copy link
Copy Markdown
Collaborator

🎉 🎉 🎉

We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag.

@SciSaif
SciSaif deleted the ext/db-schema-explorer branch March 31, 2026 12:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants