This repository contains a Visual Studio Code extension that can connect to PostgreSQL, MySQL and SQLite databases, extract schema information and generate a Markdown context file for the currently opened workspace.
- Securely store connection details per workspace using VS Code secret storage.
- Support PostgreSQL, MySQL and SQLite connections.
- Settings webview for adding/updating/removing connection settings.
- Import/export connection configuration using
.envformatted text (clipboard, manual paste or file based). - Generate Markdown files summarising database tables and columns.
- Customise the output path and file name template (supports ISO timestamp placeholders).
| Command | Description |
|---|---|
| SQL Context: Open Settings | Opens a settings page (webview) for managing connection and .env import/export. |
| SQL Context: Generate Context Markdown | Query the configured database and generate a Markdown context file. |
You can execute commands from the Command Palette (Ctrl/Cmd + Shift + P).
The following keys are supported when importing/exporting connection settings:
| Provider | Required Keys | Optional Keys |
|---|---|---|
| PostgreSQL/MySQL | DB_TYPE, DB_HOST, DB_PORT, DB_USER, DB_PASSWORD, DB_NAME |
DB_SSL (true/false) |
| SQLite | DB_TYPE, DB_FILE |
– |
DB_TYPE accepts postgres, mysql or sqlite.
The default output path template is context/context-${isoDate}.md. You can change it via the sql-context.outputPathTemplate setting. The following placeholders are available:
${isoDate}/${date}/{{isoDate}}/{{date}}– ISO timestamp (with characters safe for file names).${workspaceFolder}– absolute path to the workspace folder.${workspaceName}– name of the workspace folder.
When running the “Generate Context Markdown” command you can override the final path manually before the file is written.